Cook Books

To create a identical copy of a boot disk in Solaris

Using ufsdump and ufsrestore, we are going to make a copy of disk c0t0d0 to c0t1d0 including boot block

01. Partition the second disk same as first disk

    prtvtoc /dev/dsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2

02. Create New filesystems on all the required slices on the second disk

    newfs -v /dev/rdsk/c0t1d0s0

    Continue to cretae filesystems on remaining slices 

03. Create new filesystems mount directory under /mnt directory

    mkdir /mnt/root

    Continue to create the directories for each filesystems 
    to be copied

04. Mount the newly created filesystems on the new mount points just created

    mount /dev/dsk/c1t1d0s0 /mnt/root

    Continue mounting the filesystems for the remaining slices

05. Dump the data from the old disk to the newly created filesystems

    ufsdump 0f - /dev/rdsk/c0t0d0s0 |(cd /mnt/root; ufsrestore xf -)

    Contiune dumping data for the remaining slices

06. Change the /etc/vfstab entry in the newly created filesytesms

    sed < /mnt/etc/vfstab -e s/c0t0d0/c0t1d0/g > /tmp/vfstab.new 
    mv /tmp/vfstab.new /mnt/etc/vfstab 

07. Install the boot block in the second disk

    installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0

08. Unmount the filesystems and removed the directory which we created under /mnt.

    umount /mnt/root
    rmdir /mnt/root

    Continue doing this for remaining filesystesm.

09. Change the bootlist from the OK prompt.

How to replace an internal FibreChannel drive that is under VERITAS Volume Manager (tm) control

Details:
This specific procedure must be used when replacing one of the internal fibre drives within the following servers and/or arrays:

  Sun Fire 280R, V480, and V880.
  SENA A5X00 Arrays.

Note: Failure to follow this procedure could result in a duplicate device entry for the replaced disk in Volume Manager. This is most notable when running a vxdisk list command.

Example:

 # vxdisk list
 DEVICE       TYPE      DISK         GROUP      STATUS
 c1t0d0s2     sliced       rootdisk      rootdg        online
 c1t1d0s2     sliced        -               -                error
 c1t1d0s2     sliced        -               -                error

1. Select vxdiskadm option 4 - Select the Volume Manager disk to be replaced

2. luxadm -e offline <device_path> - detach ssd instance

Use luxadm to get this disk out of the Solaris kernel configuration. The device path should end in ",raw" (for example, pci@1f,0/ide@d/dad@0,0:a,raw). This is the path from the /devices directory, not /dev/rdsk/c?t?d?s?.

  • If the disk is multipathed, run the luxadm -e offline on the second path as well

3. devfsadm -C

 The -C option cleans up the /dev directory, and removes any lingering logical links to the device link names. 
 It should remove all the device paths for this particular disk. This can be verified with:

      # ls -ld /dev/dsk/c1t1d* - This should return no devices entries for c1t1d*.

4. The drive can now be pulled physically

5. luxadm insert_device

This is an interactive command. It will go through the steps to insert the new device and create the necessary entries in the Solaris device tree.

6. vxdctl enable

This is for Volume Manager to rescan the disks. It should pick up the new disk with an "error" status. If not in error, the disk might contain some Volume Manager information, and might need to be formatted.

7. Select vxdiskadm option 5

This will start the recovery process (if needed).

Example show is for c1t0d0s2, please use your c#t#d#s# in place of for your problem.

 # vxdisk list

 c1t0d0s2 sliced - - error
 c1t0d0s2 sliced - - error
 c1t1d0s2 sliced disk01 rootdg online
 - - root-disk rootdg removed was:c1t0d0s2

Remove c1t0d0s2 entries from vxvm control.
Do "vxdisk -f rm c1t0d0s2" for all the duplicate entries.
[since there is no telling which one is the valid one, do
it for all ...there can be more than 2 duplicate entries
also ...]

 # vxdisk rm c1t0d0s2

 # vxdisk rm c1t0d0s2 <-- do it again to remove all the entries.

2. Remove the disk c1t0d0s2 using luxadm.

  Remove device c1t0d0s2 using "luxadm remove_device" command.


  [luxadm remove_device cxtxdxsx]


   1.

      luxadm remove_device /dev/rdsk/c1t0d0s2

   Pull the disk out as per luxadm instructions.

3. Run command "devfsadm -C"

4. Run command "vxdctl enable"

[Till this point, we have removed the dev_t corresponding to the physical disk. Now we will remove all the stale dev_t's.] Please loop as per below instructions.

LOOP :

 [notice that there is one entry less, since we can have more than 2 duplicate

entries]

   # vxdisk list
   c1t0d0s2 sliced c1t0d0 - error
   c1t1d0s2 sliced disk01 rootdg online
   - - root-disk rootdg removed was:c1t0d0s2

5. Again remove *ALL* duplicate c1t0d0s2 entries from vxvm control.

   # vxdisk rm c1t0d0s2

6. Run command "luxadm -e offline <device path>" on *ALL THE PATHS* to the disk [this removes the stale dev_t. The test machine has 2 paths to the disk, one through controller c1, and the other through controller c2.

   # luxadm -e offline /dev/dsk/c1t0d0s2

   # luxadm -e offline /dev/dsk/c2t0d0s2

7. Run command "devfsadm -C"

8. Run command "vxdctl enable"

goto LOOP:
[Continue this process until there are no more entries in vxdisk list of corresponding disk c1t0d0s2 ]

Result:

   # vxdisk list
   DEVICE TYPE DISK GROUP STATUS
   c1t0d0s2 sliced root-disk rootdg online
   c1t1d0s2 sliced disk01 rootdg online

Now both OS device tree and VxVM are in a clean state corresponding to disk c1t0d0s2.