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:
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
show us the filesystemlayout of the device you try to clone (df -k output) and the commands you used to make the dumps.
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?
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:
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:
#!/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
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.
Here is the dd command I'm using that results in the same error that can not find "/usr" on boot:
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
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.:
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.
TonyFullerMalv,
Thanks... I can bring up the clone drive in Slot 1 after the modification of "/etc/vfstab" and at the ok prompt typing "boot disk1". I need to move the cloned drive to Slot 0 and leave the "/etc/vfstab" alone per operational requirements.
When I run the "printenv" at the ok prompt I'm finding the original drive being listed under "boot-device" and wondering how I can modifiy this after the clone script has finished?
Thanks,
John
---------- Post updated at 01:56 PM ---------- Previous update was at 11:08 AM ----------
During my latest testing I've discovered the following:
1) I'm able to clone a drive from slot 0 (boot drive) to slot 1
2) Only way I can boot up the clone drive is by doing the following:
- Leaving the drive in slot 1
- Modifying the "/etc/vfstab" and changing c1t0d0 to c1t1d0 for all
slices.
- At the ok prompt type: boot disk1
3) Clone drive comes up and application is started no problem.
When I change the "/etc/vfstab" back to c1t0d0 for all slices and move the drive to slot 0 I get the failures that I can't find the boot drive? Does Solaris write something specific to the hard drive that for some reason the clone of the boot drive would miss?
Thanks,
John
---------- Post updated at 02:32 PM ---------- Previous update was at 01:56 PM ----------
Wondering if these drives are slot dependent? If so, would changing or updating the "devalias" as mentioned in one of the previous comments would be required and allow me to move the hard drive to slot 0?
Thanks again,
John
Thanks for the "eeprom" information and I was able to change the boot drive location. Still unsure why the clone drive will not boot up in Slot 0?
It's almost like it's slot dependant?
Thanks again,
John
I'm now able to clone a drive in slot 1 from slot 0. I can move the drive to slot 0 and it's boots up. I'm still required to type at the ok prompt: boot disk -- On the original boot drive I was able to type boot or on a reboot the startup would occurr automatically.
Any way to change the startup sequence within Solaris so I don't need to pass in the "boot disk" and simply type "boot".
Thanks,
John