• If you ever shift around any bootable drives within a Sun Solaris box, you may find that either the device names (cxtxd0sx) do not follow the disk position within the server, or, the system just fails to boot because it can’t mount the other disk slices.

    Let’s assume you are booting off of target 8 (c1t8d0s0), but wish to move that disk to the appropriate slot to make it target 0 (c1t0d0s0). You have changed all references in the /etc/vfstab file to reflect the new disk position, physically moved the drive from the target 8 slot to the target 0 slot, and changed the boot-device variable within the OBP to the appropriate disk. You should now be all set to boot from the disk in target 0, right?

    Not quite yet.

    Solaris creates a device tree with links to all the disks it knows about, and these don’t get rebuilt upon reboot. If you simply tried to boot the disk now in target 0, it would find the kernel, but fail to mount any of the other filesystems, because these device links are still pointing to the disk slices on target 8.

    In order to boot off the drive in the new position, you will have to remove these device links and rebuild them. Here is how we do that:

    1. Insert a Solaris 8, 9 or 10 cd into the hosts cdrom

    2. From the ok prompt, enter boot cdrom -s

    ok> boot cdrom -s

    3. fsck the boot disk

    # fsck -y /dev/rdsk/c1t0d0s0

    Remember that your boot disk may differ than the example above. Since in our example above, we have put the disk into the slot for target 0 (c1t0d0), that is what we are using here.

    4. Mount the root slice on /mnt

    # mount /dev/dsk/c1t0d0s0 /mnt

    Note that your root slice may differ than the above example.

    5. Move path_to_inst

    # mv /mnt/etc/path_to_inst /mnt/etc/PATH_TO_INST_ORIG

    6. Remove all old device links

    # rm /mnt/dev/rdsk/c* ; rm /mnt/dev/dsk/c* ; rm /mnt/dev/rmt/* ; rm
    /mnt/dev/cfg/c*

    7. Rebuild path_to_inst and devices

    # devfsadm -r /a -p /mnt/etc/path_to_inst

    8. Unmount the root slice and reboot

    # umount /mnt ; init 6

    You should now be able to boot off your old drive in its new slot.

    This entry was posted on Wednesday, December 21st, 2005 at 1:58 pm and is filed under Data and Technology. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
  • 9 Comments

    Take a look at some of the responses we've had to this article.

    1. [...] Notice that the target number will remain 2, not move to 0 when we swap the disks and boot from the new one. To resolve this, it is strongly suggested that you rebuild the solaris device tree and change the vfstab file to reflect the new disk position. [...]

    2. Jim Weller
      Posted on July 23rd

      Shouldn’t


      # devfsadm -r /a -p /mnt/etc/path_to_inst

      be


      # devfsadm -r /mnt -p /mnt/etc/path_to_inst

    3. A Braunsdorf
      Posted on August 16th

      /etc/inst_to_path doesn’t seem to be used (or created by this procedure) on i86pc. Moved a drive from an older V40 to a newer one and can’t get it to work, so any clues would be appreciated. I’ve done basically what’s above moving from SPARC to SPARC, but doesn’t seem to work on the AMDs. :-(

    4. Jay Herbig
      Posted on August 21st

      Your directions look pretty good but I’m not quite sure about the arguments. Why, when you have the root mounted under /mnt are you using -r /a? I know the /a convention is usually what you’ll use if you’re mounting a filesystem under a failed boot which exits to the degraded single user mode… but wouldn’t the -r (root_dir) also be the mounted filesystem under /mnt?

      Thanks, other than that looks great. I’m using some of your notes to migrate a fibre based V480 disk to a scsi based V440.

      Jay

    5. Jay Herbig
      Posted on August 21st

      Doh, sorry, should have looked further down the page. Pardon my redundancy.

      Jay

    6. Robert Sturrock
      Posted on December 21st

      Very useful article - thanks. Like another poster, I was able to use this to help clone an already installed system from a V440 to a V240 with a different device layout.

      Robert.

    7. [...] we swap the disks and boot from the new one. To resolve this, it is strongly suggested that you rebuild the solaris device tree and change the vfstab file to reflect the new disk [...]

    8. Guillermo Salas
      Posted on May 7th

      A. Braunsdorf:

      I was having the same problem you are having. (because I installed it on one machine and then moved the disk to a completely different machine). I got the system running by starting up in safe mode and copying the file “path_to_inst” from the failsafe instance to the normal “etc” directory. I then modified the boot archive in the normal instance so that the file /boot/solaris/bootenv.rc had the parameter “boot device” pointing to the correct device. To find out what the new device was, I just made a ls -l to the /dev/dsk directory. Lastly I had to make some modifications to the vfstab file in the “normal” /etc/ directory. Hope this helps.

    9. [...] we swap the disks and boot from the new one. To resolve this, it is strongly suggested that you rebuild the solaris device tree and change the vfstab file to reflect the new disk [...]

  • Post a Comment

    Let us know what you thought.

  • Name:

    Email (required):

    Website:

    Message:

Visitors have tagged this post: solaris path_to_inst (286) - t (271) - rebuild path_to_inst (205) - solaris rebuild device tree (122) - solaris rebuild devices (121) - solaris rebuild path_to_inst (102) - solaris device tree (96) - rebuilding path_to_inst (75) - "path_to_inst" solaris (72) - solaris rebuild /dev (63) - rebuild solaris device tree (50) - rebuild device tree solaris (47) - rebuild device tree (42) - "solaris 10 " path_to_inst (42) - "solaris 10" devfsadm (37) - devfsadm solaris 10 (35) - rebuild /devices solaris (34) - path_to_inst rebuild (34) - solaris 10 rebuild device tree (34) - solaris rebuild device (33) - rebuild path_to_inst solaris (33) - "solaris 10" rebuild path_to_inst (30) - rebuild path_to_inst solaris 10 (29) - f (26) - spiralbound net (25) - solaris devfsadm (23) - device tree solaris (23) - path_to_inst solaris 10 (22) - solaris 10 rebuild devices (21) - solaris 8 path_to_inst (20) - devfsadm path_to_inst (20) - target (20) - solaris 10 devfsadm (20) - rebuild /dev solaris (19) - solaris devices (18) - solaris (17) - rebuilding solaris device tree (17) - all (16) - Solaris path_to_inst rebuild (16) - solaris remove disk (14) - solaris 9 rebuild device tree (14) - rebuild /devices (14) - rebuild device tree solaris 10 (14) - Solaris device naming (13) - solaris 8 rebuild path_to_inst (12) - rebuild solaris devices (12) - delete path_to_inst (11) - rebuild /etc/path_to_inst (11) - solaris rebuild kernel (11) - Rebuilding the Solaris Device tree (11) - path_to_inst solaris 8 (11) - devfsadm +solaris (10) - path_to_inst (10) - solaris 10 cdrom device (10) - Solaris rebuild /dev/rmt (10) - Solaris device rebuild (10) - solaris 10 devfsadm path_to_inst (10) - solaris 10 rebuild dev (10) - solaris 10 device tree (10) - rebuild path_to_inst Solaris 8 (9) - rebuilding device tree (9) - how to rebuild path_to_inst (9) - rebuild devices solaris 10 (9) - solaris devfsadm path_to_inst (9) - solaris +rebuilding "device tree" (9) - /devices solaris (9) - "devfsadm -R" (9) - remove device solaris (9) - solaris 10 path_to_inst (9) - path_to_inst solaris (9) - device tree (8) - solaris find cdrom device (8) - rebuild vfstab (8) - solaris device (8) - solaris 10 mount cdrom (8) - solaris disk device names (8) - solaris 10 cdrom device name (8) - devfsadm rebuild path_to_inst (8) - device tree in Solaris (8) - rebuild device Solaris (8) - rebuild solaris device (8) - solaris rebuild (8) - solaris :boot -ar (7) - rebuild path_to_inst file (7) - solaris rebuilding dev (7) - Solaris /etc/path_to_inst (7) - remove disk solaris (7) - mount cdrom solaris 8 (7) - solaris "cdrom device" (7) - rebuild solaris kernel (7) - rebuild path_to_inst devfsadm (7) - solaris kernel rebuild (7) - solaris remove path_to_inst (7) - rebuilding the device tree (7) - solaris rebuilding path_to_inst (7) - rebuild solaris path_to_inst (7) - remove devices solaris (7) - solaris rebuild device files (7) - path_to_inst devfsadm (6) - boot cdrom solaris (6) - rebuilding /dev solaris (6) - solaris boot path_to_inst (6) - Rebuild /dev/rmt (6) - rebuild the solaris device tree (6) - solaris delete path_to_inst (6) - rebuild "/dev" (6) - solaris 9 rebuild path_to_inst (6) - path_to_inst rebuild solaris 10 (6) - solaris device tree rebuild (6) - jay herbig (6) - solaris "remove device" (6) - path_to_inst in solaris (6) - mss (6) - remove path_to_inst (6) - solaris remove devices (6) - solaris boot rebuild devices (6) - rebuilding devices (6) - solaris 10 remove devices (6) - solaris rebuild dev devices (5) - /etc/path_to_inst (5) - solaris cdrom device name (5) - rebuild path_to_inst solaris 9 (5) - solaris change boot device (5) - boot path_to_inst (5) - solaris +boot +cdrom (5) - Rebuild device tree "Solaris 8" (5) - solaris device links (5) - solaris rebuild devices tree (5) - remove device path_to_inst "solaris 9" (5) - rebuild device tree Solaris 9 (5) - device tree rebuild (5) - +solaris +/devices +rebuild (5) - rebuilding devices solaris (5) - how to rebuild the device tree on solaris 8 (5) - Solaris /dev/cfg (5) - solaris 8 rebuild devices (5) - solaris 9 devices tree rebuild (5) - rebuild the device tree solaris (5) - solaris remove disk device (5) - rebuild devices on solaris (5) - devfsadm cdrom rebuild (5) - solaris rebuild dev (5) - device links (4) - solaris "device names" (4) - solaris rebuild kernel boot (4) - solaris rebuild devices path_to_inst (4) - solaris disk device naming (4) - delete devices solaris (4) - tree solaris (4) - solaris 10 find cdrom device (4) -