Expanding existing Hammer FS
mneumann at ntecs.de
Mon Dec 15 16:45:38 PST 2008
I'd be nice to be able to add just another spare disk to an existing
Hammer FS to expand it's capacity. After taking a look at newfs_hammer,
it seems to be pretty easy to do that:
* run format_volume on the new disk
* ondisk->vol_num += 1 (number of volumes)
for each volume of the filesystem.
I think that would be enough and I can hack it. My question is more
API-oriented. How would the command line look like?
How about this:
hammer newfs label [... specify some defaults...]
will create the following file:
which will list all devices that make filesytem "label".
Now add a volume:
hammer add-volume label /dev/ad0
This will format /dev/ad0 and attach it to the filesystem
"label" by iterating over all volumes in /etc/hammer/label and
increasing the volume count.
Of course it would be more beautiful if the root volume would
store those device names. That would also ease mounting of
a multi-volume HAMMER fs:
# create multi-volume Hammer FS
newfs_hammer /dev/ad0 /dev/ad1
# mount multi-volume Hammer FS by specifying the root volume
# add /dev/ad2 to the filesystem specified by the root volume ad0
hammer add-volume /dev/ad0 /dev/ad2
More information about the Kernel