Solaris 10 – How to access SVM root disk from fail safe / Cdrom boot
This procedure explains the steps required to access a root filesystem under SVM, during the situation when the solaris cannot boot in normal way and it require to boot from failsafe or cdrom. In this procedure the device /dev/dsk/c0t0d0s0 is used as our root filesystem slice..
The important point we need to remember when the root filesystem is under SVM, we should not mount the physical disks in read-write and run the fsck.
Boot the failsafe archive.
SPARC platform: From the ok prompt, type the following command:
ok boot -F failsafe
If the system is already running, open a terminal window, become superuser, and type the following command:
# reboot -- "-F failsafe"
Booting the system in failsafe mode produces the following output:
Starting shell. #
During the failsafe boot, when prompted by the system to select a device to mount, type q to indicate none:
Please select a device to be mounted (q for none)[?,??,q]: q
Temporarily mount a submirror of the root (/) file system as read-only on the /a directory:
# mount -o ro /dev/dsk/c0t0d0s0 /a
Copy the md.conf file to the /kernel/drv directory:
# cp /a/kernel/drv/md.conf /kernel/drv/
Cat the vfstab file to identify the root disk, /var, /usr file systems, etc:
# cat /a/etc/vfstab
Unmount the /a directory:
# umount /a
Use the update_drv command to load the Solaris Volume Manager md driver. Ignore any warning messages printed by the update_drv command:
# update_drv -f md
Running the update_drv command causes the configuration to be read, and the necessary devices to be created.
Use metastat to confirm that the SVM database has been loaded:
# metastat -p
Use the metasync command to ensure that the root (/) file system is in sync:
# metasync d0
Now fsck can be safely run on d0:
# fsck -o f -y /dev/md/rdsk/d0
Please repeat this command if any file system errors were fixed. You have to repeat it until the file system is clean. This can take 3 or 4 runs of fsck command.
Force option -o f prevents fsck from skipping the file system check. It is recommended to use option -y as well to confirm all changes to the file system.
Mount the root mirror metadevice on the /a directory:
# mount /dev/md/dsk/d0 /a
Update the boot archive:
# bootadm update-archive -v -R /a
If the boot archive fails to be updated, or an error message is displayed, update the timestamp on the /a/kernel/drv/md.conf file, then run bootadm update-archive again.
This will force an update of the boot archive:
# touch /a/kernel/drv/md.conf # bootadm update-archive -v -R /a
The update of the boot archive takes a few minutes to complete. If the boot archive was updated successfully, a message similar to the following is displayed:
changed /a/etc/system cannot find: /a/etc/cluster/nodeid: No such file or directory cannot find: /a/etc/devices/mdi_ib_cache: No such file or directory Creating ram disk on /a updating /a/platform/i86pc/boot_archive
This is expected output and does not constitute an error.
These messages are a result of entries in /boot/solaris/filelist.ramdisk , which may or may not exist on system.
# less /boot/solaris/filelist.ramdisk etc/cluster/nodeid etc/dacf.conf etc/mach kernel platform
Unmount all previously mounted file systems /a/var, /a/usr and /a:
# umount /a/var # umount /a/usr # umount /a
Reboot the system: