Tuesday, April 20, 2010

save or copy vtoc on solaris 10

To capture it to a file:
prtvtoc /dev/rdsk/c#t#d#s2 > out

To use it to format another disk:

prtvtoc /dev/rdsk/c#t#d#s2 | fmthard -s - /dev/rdsk/c#t#d#s2

This comes up because I had a drive get wiped and need to fix the partitioning before I could restore the backup. So now I run a script weekly that keeps the vtoc in a directory and also mails it to me so I have it stored elsewhere. Very convenient in really horrible situations. But also convenient if you need to create a mirror of a drive you've already created.

No comments: