As of GNU coreutils 7.5 released in August 2009, sort
allows a -h
parameter, which allows numeric suffixes of the kind produced by du -h
:
du -hs * | sort -h
If you are using a sort that does not support -h
, you can install GNU Coreutils. E.g. on an older Mac OS X:
brew install coreutils
du -hs * | gsort -h
From sort
manual:
-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)
For some reason, c2t5d0s4 (/d001) and c2t5d0s5 (/d002) are set up as one-way mirrors in SDS. Perhaps someone forgot to metattach
another disk at some point?
To accomplish what you want, there are two methods.
Method 1
As you suggest, dd
could be used. I would first verify that you don't need the data on c2t6d0s6 by mounting it and reviewing the filesystem contents.
mount /dev/dsk/c2t6d0s6 /mnt
You also have two small partitions at the start of the disk. Check with metadb
that these aren't required by SDS. If they are listed and there are partitions on the other disks in the metadb, remove them:
metadb -d c2t6d0s0
metadb -d c2t6d0s1
Then you will be able to use dd
to clone:
umount /d001
umount /d002
dd if=/dev/rdsk/c2t5d0 of=/dev/rdsk/c2t6d0
Method 2
As you already have SDS configured you can use this to complete the mirrors.
First you need to copy the partition table:
prtvtoc /dev/rdsk/c2t5d0s2 | fmthard -s - /dev/rdsk/c2t6d0s2
Then create metadevices:
metainit d72 1 1 c2t6d0s4
metainit d82 1 1 c2t6d0s5
Then attach these do the existing mirrors:
metattach d7 d72
metattach d8 d82
Warning: metadevice d71 already has errors logged against it by SDS and has been placed into maintenance. It might refuse to copy this partition.
Periodically check that the mirrors are syncing:
metastat
You'll get a progress next to each submirror that is rebuilding. The State:
field will say Okay once rebuilding has finished.
Removing the old drive
Disconnect each partition that is mirrored.
metadetach d7 d71
metadetach d8 d81
I can't remember if Solaris 8 has cfgadm
or not, but if it does, run:
cfgadm -al
to check which device you want to remove (probably c2::dsk/c2t5d0), then unconfigure it:
cfgadm -c unconfigure c2::dsk/c2t5d0
It will then be safe to remove it.
HOW CAN I VERIFY THAT /d001 and /d002 are the ONLY THING MOUNTED FROM THE OLD DRIVE?!
Simple: They're the only partitions on the disk. (Slice 2 is the whole disk, not an actual usable partition.)
Best Answer
There is also FreeVXFS, which might help you. Though I do now know how well supported it is, and how compatible it is with your VXFS filesystem.
It's worth looking into I guess:
http://www.advogato.org/proj/FreeVxFS/