Solaris 8 Clone - Help


 
Thread Tools Search this Thread
Operating Systems Solaris Solaris 8 Clone - Help
# 1  
Old 01-21-2010
Solaris 8 Clone - Help

I've got two drives in the same Sun server and I've been cloning the boot drive to the secondary drive by using both ufsdump/ufsrestore and the dd command sucessfully.

When I try and boot the cloned drive I get the following error:

Code:
WARNING - /usr/sbin/fsck not found. Most likely the mount of
/usr failed or the /usr filesystem is badly
damaged. The system is being halted.
Either re-install the system of boot with -b 
option in an attempt to recover

Same error received if I use ufs or dd to create the cloned drive.

Any help would be appreciated.

John

Last edited by pludi; 01-21-2010 at 12:29 PM.. Reason: code tags, please...
# 2  
Old 01-21-2010
show us the filesystemlayout of the device you try to clone (df -k output) and the commands you used to make the dumps.
# 3  
Old 01-21-2010
Bearing in mind the clone disk has a different device name the /etc/vfstab file on the clone will need to be edited to reflect the change, e.g. from c0d0t0s? to c0d1t0s?
# 4  
Old 01-23-2010
I'm pulling together the (df -k output) and will be posting it this morning. It's a standard solaris setup and both the ufsdump/ufsrestore and dd are giving me the same errors with /usr mentioned in my initial posting. The "/etc/vfstab" file is a clone from the boot drive and once the clone has finished I move the drive from slot 1 to slot 0, boot with the the following at the ok prompt: boot disk

Thanks,
John

---------- Post updated at 07:48 AM ---------- Previous update was at 07:07 AM ----------

Here is my "df -k" output:
Code:
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c1t0d0s0     962573  473998  430821    53%    /
/dev/dsk/c1t0d0s4    1984564 1466407  458621    77%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
mnttab                     0       0       0     0%    /etc/mnttab
swap                 9445136      24 9445112     1%    /var/run
/dev/dsk/c1t0d0s7    16861739 1985663 14707459    12%    /h
/dev/dsk/c1t0d0s5    3008649 2036753  911724    70%    /opt
/dev/dsk/c1t0d0s3     962573   17498  887321     2%    /tmp

Here is the script I'm using for the clone:
Code:
#!/bin/sh
#
#Use and distribute freely
#
#Define variables for use in the script
#! Important, these must be set correctly !
#

# The root disk to duplicate (leave off slice numbers and path)
SRC=c1t0d0

# The empty disk to duplicate it to (leave off slice numbers and path)
DEST=c1t1d0

# The directory to mount destination partitions on while duplicating
MOUNTDIR=/dup_0

# The file name of this script, to rename it on the destination to avoid execution
SCRIPT=/opt/local/etc/rootcopy

# The slices that should be copied
SLICES="s0 s3 s4 s5 s6 s7"

echo ===================================
echo Disk Copy script started `date`
echo

# Make sure the mount point for duplicate partitions exists

if [ ! -d $MOUNTDIR ]; then
mkdir $MOUNTDIR
chmod 700 $MOUNTDIR
fi

# Partition the duplicate disk, make filesystems, make it bootable

prtvtoc /dev/rdsk/${SRC}s2 > /tmp/vtoc
fmthard -s /tmp/vtoc /dev/rdsk/${DEST}s2
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/${DEST}s0

# Modify the following loop to handle any special cases

for fs in $SLICES
do
 newfs /dev/dsk/${DEST}${fs} < /dev/null; mount /dev/dsk/${DEST}${fs} ${MOUNTDIR};
 ufsdump 0f - /dev/dsk/${SRC}${fs}|(cd ${MOUNTDIR}; ufsrestore rf -);
 if [ $fs = "s0" ]; then
  sed 's/${SRC}/${DEST}/g' /etc/vfstab > ${MOUNTDIR}/etc/vfstab;
  #mv ${MOUNTDIR}/${SCRIPT} ${MOUNTDIR}/${SCRIPT}.DONTRUN;
 fi
umount ${MOUNTDIR}
done

echo 
echo Disk Copy script ended `date`
echo =====================================
echo


Last edited by Scott; 01-23-2010 at 09:05 AM.. Reason: Code tags, PLEASE!
# 5  
Old 01-23-2010
does the script run without any problems? after the dump, is there any data on the NEW /usr slice? also there is NO slice 6 in your df output so you should probably delete the s6 in the slices definition of the script.
# 6  
Old 01-23-2010
Here is the dd command I'm using that results in the same error that can not find "/usr" on boot:

Code:
dd if=/dev/rdsk/c1t0d0s2 of=/dev/rdsk/c1t1d0s2



---------- Post updated at 08:12 AM ---------- Previous update was at 08:08 AM ----------

DukeNuke2,

Yes the script runs without error and I'm able to mount "/usr" from the clone drive and all looks good? I've ran fsck against this slice and no errors being reported. I'm simply looking for a way to clone a boot drive. I'm running this script from single user.

Thanks,
John

Last edited by DukeNuke2; 01-23-2010 at 09:10 AM.. Reason: code tags!
# 7  
Old 01-23-2010
If you are swapping the cloned disk to the original disk's slot to use the clone then you should not to edit the vfstab file on the disk you are cloning to.

If you edit the vfstab then you can use it by leaving in the slot where you had it when you did then clone and then specify that disk when booting, e.g.:
Code:
ok> boot disk1

You will need to run devalias in the OBP to confirm the path to your second disk slot and what alias it has been given.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

How to clone an AIX 5.3?

Hello all, I am trying to clone an entire aix 5.3 machine , not sure on the procedure.Can anyone help on what can be done ?Thanks (9 Replies)
Discussion started by: gull05
9 Replies

2. Solaris

Need to Clone Solaris OS to another disk

Hi, I am trying to clone the hard disk image of Solaris OS on one disk to another disk. After some googling I found that there is a command "dd" to achieve this. However there is a condition to use the dd command, that the disk geometry of both the disks (source and target disks) should... (5 Replies)
Discussion started by: rajujayanthy
5 Replies

3. UNIX for Dummies Questions & Answers

Clone redhat to another PC

Hi, I'm a new user of this forum and I'm not an expert of linux. I have a broken old pc with red hat linux, I clone hdd to another pc with different mainboard and it's ok but it has only one problem, the usb ports not work. In the boot this message appears: ... (9 Replies)
Discussion started by: aitv
9 Replies

4. Red Hat

Redhat Clone

What is the best method to use to clone a Redhat machine, to ensure all software and config can be easily installed on new hardware? Thank you! (3 Replies)
Discussion started by: da2013
3 Replies

5. UNIX for Advanced & Expert Users

Clone mounts as is

Hello, Iam trying to clone AS IS two mounts like below /class_test/sa /class_dev/fd from one server onto another. I want to use tar and gzip to compress. Please let me know the options I have to use. Also I want to untar it in the destination server, so let me know how to do... (3 Replies)
Discussion started by: baanprog
3 Replies

6. Solaris

Backup / Clone Solaris Zone Issue

Hi, I'd like to discuss the subject of backing up / cloning Solaris zone. I was trying to clone zone A to zone B (Solaris 10 11/06: Cloning a Non-Global Zone on the Same System (System Administration Guide: Oracle Solaris Containers-Resource Management and Oracle Solaris Zones)). The first test... (7 Replies)
Discussion started by: aixlover
7 Replies

7. Solaris

Clone scsi disc solaris 8

I have a SunOS 5.8 Generic_108528-29 sun4u sparc SUNW,UltraAX-i2, i have 2 scsi disk, the first with the S.O. and the second free. I read many in the forum about this: with single user, miniroot, dd, flarcreate, ufsdump and ufsrestore. Which is the best metod? If i clone the disk with... (6 Replies)
Discussion started by: tirher
6 Replies

8. Solaris

clone solaris

I have a Sun Solaris 9 and I would like to clone the Operating System from a sun4u Sun Fire 480R machine to a Sun Fire 280R machine. The disk is the same size, the 480R has no space disk slot to the 280R disk for mirrioring, i have no external disk, I am not allowed to take the machine down. ... (1 Reply)
Discussion started by: hassan1
1 Replies

9. Filesystems, Disks and Memory

clone disk

Disk cloning I had an external SCSI master disk that I used to clone to an identical external SCSI disk because the other SCSI disk would become corrupted. My original Master became corrupted so I used one of the other to good disk to copy back to the master. Unfortunately the new master needs... (1 Reply)
Discussion started by: stamperr
1 Replies

10. UNIX Desktop Questions & Answers

How do I clone Solaris 7 disk

could anyone give me a general idea of how i may clone a 2 Gig disk running Solaris 7 on it to another disk of the same size? currently, this system only has one disk in it though. i do have the ability to hook up another disk via SCSI. i have been told i need to boot to "miniroot" to run... (9 Replies)
Discussion started by: obosha
9 Replies
Login or Register to Ask a Question