Solaris 10 – How to access SVM root disk from fail safe / Cdrom boot

soalris-how-toThis 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

 

Note: You might have to wait a few seconds (up to a minute) before the metastat command executes successfully. The md driver takes some time to load its configuration. If you are too quick, the metastat (and metasync) commands will give you an error message. Just wait some more seconds in this case and execute the metastat or metasync commands again.

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

 

Note: If you have separate usr or var file systems repeat the previous fsck step for the corresponding meta devices for /usr and /var and mount the file systems to /a/usr and /a/var respectively.

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:

# reboot

 

 

Ramdev

Ramdev

I have started unixadminschool.com ( aka gurkulindia.com) in 2009 as my own personal reference blog, and later sometime i have realized that my leanings might be helpful for other unixadmins if I manage my knowledge-base in more user friendly format. And the result is today's' unixadminschool.com. You can connect me at - https://www.linkedin.com/in/unixadminschool/

1 Response

  1. Sukaji Naik says:

    Thanks very much buddy!!!
    Ihave same problem with Sun Fire v240 machine.Unable to boot the system from primary and secondary disk.

    I followed above procedure and system has been recover…Gr8t awesome !!!

    Thanks for sharing your knowledge.

What is in your mind, about this post ? Leave a Reply

Close
  Our next learning article is ready, subscribe it in your email

What is your Learning Goal for Next Six Months ? Talk to us