Solaris: Copy disk labels to duplicate drive layout

Contributor Icon Contributed by Michilimackinac Date Icon January 13, 2004  
Tag Icon Tagged: Solaris system administration

While the format command can be used to manually lay out the slices of a disk and save the label to disk, when performing administrative steps like preparing for mirroring drives with DiskSuite it can be useful to copy the label of an existing disk to another. This Tech-Recipe uses the fmthard command to save a disk label to a file and then another fmthard command to write to the second disk.


fmthard -i -n "" /dev/rdsk/c0t0d0s2 > /tmp/d0

This command writes the disk label on c0t0d0 out to a file

fmthard -s /tmp/d0 -n "" /dev/rdsk/c0t1d0s2

This command writes the disk label defined in the file /tmp/d0 to disk c0t1d0

Previous recipe | Next recipe |
 
  • Anonymous
    You can also skip the step of saving to a file and do it this way:

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

    -pbeckhelm
  • jbully
    prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -n "" /dev/rdsk/c0t1d0s2

    no need to messabout with other files, this takes it stright from one disk and puts it right on the other.

    Joe :lol:
blog comments powered by Disqus