Create a Secondary (Diagnostic) Root Filesystem ------------------------------------------------ #! The purpose of this lab is to create an alternative root #! filesystem. Should the production root filesystem #! become unavailable, the root file system created #! in this lab will serve as a temporary replacement #! #! The assumption of this exercise is that each of #! the following directories has a seperate slice: #! #! /var #! /usr #! /opt #! 1) Bring the system down to PROM level. # shutdown -y -g 0 -i 0 "SYS DOWN!" 2) Boot off of the Solaris install cdrom. ok boot cdrom -s 3) Mount the root filesystem to /a. # mount /dev/dsk/c0t0d0s0 /a #! You might be asked to run fsck first. 4) Backup the root filesystem. # ufsdump 0u / #! The backup device is a tape (/dev/rmt/0) which #! does not need to be specified on the command line #! without the -f switch. See ufsdump man pages for #! more details. 5) Cover your rear and verify the backup. # ufsrestore t #! You should see the tape archive table of contents. 6) Partition and newfs the disk that will contain the new root filesystem. # newfs /dev/rdsk/cXtXdXsX #! X=controller, target #! lun, & slice number 7) Mount the alternative filesystem to /mnt. # mount /dev/dsk/cXtXdXsX /mnt 8) # cd /mnt 9) Restore the root filesystem. # ufsrestore rv 10) # ls -l /mnt #! You should now see the copy of the root filesystem. 11) Install the bootblock. # cd /usr/platform/sun4u/lib/fs/ufs # ls #! You should see the bootblk file. # installboot bootblk /dev/rdsk/cXtXdXsX 12) Modify the /mnt/etc/system file to specify the alternative root device. rootdev:/pci@1f,0/pci@1,1/ide@3/dad@X,X:X #! This is the physical location of an ide drive on #! the primary pci host adapter of an Ultra 5/10 #! workstation. If you do not know the physical device #! name of the new partitio then STOP. This has to be #! correct for this lab to work. 13) Update the /mnt/etc/vfstab to reflect the new root location. #! You only need to modify the old entry for the #! root filesystem. Change the first two fields for #! the / mount point to: /dev/dsk/cXtXdXsX /dev/rdsk/cXtXdXsX #! The X value is the appropriate slice #! containing the new filesystem. 14) Unmount and fsck the new root filesystem. # umount /mnt # fsck /dev/rdsk/cXtXdXsX 15) Come back down to PROM level. # init 0 16) Create a device alias for the new root filesystem. ok nvalias disk2 /pci@1f,0/pci@1,1/ide@3/disk@X,X:X #! The appropriate device name for a dad/ide drive at the #! PROM level is "disk". 17) Boot the system off of the new root filesystem! ok boot disk2 18) Cross your fingers! 19) When the system comes up, verify the root mounts: # df -k # mount #! Both should reflect the cXtXdXsX filesystems as #! mounted onto root. Troubleshooting ---------------- #! "Unable to open boot device" is the most common problem #! with this exercise. It happens when you attempt to boot off of disk2. #! Make sure that the /etc/system and devaliases are correct. #! #! If you booted the system but it mounted the old root filesystem, #! then check your /etc/vfstab on the new partition. Do not check #! the /etc/vfstab on c0t0d0s0, this is not the file the new #! root filesystem will be using. #!