Solaris: Copy disk labels to duplicate drive layout

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

The Conversation

Follow the reactions below and share your own thoughts.