Growing your filesystem with growfs
This article was written by Will Andrews.
Copyright (c) 2002 Will Andrews <will@csociety.org>. All rights reserved.
The Story
I needed more disk space on my vinum volume, which I created about 18
months ago using 2 IBM DeskStar 30GXP 30GB ATA100 drives. Originally,
I created a RAID 0 (stripe) filesystem on top of these drives using vinum.
But now I needed more disk space for various processes that I was running
on the machine. So I got a new IBM DeskStar 80GB ATA100 drive.
Just like the FreeBSD diary article on vinum,
I had an /etc/vinum.conf
.
Its contents were:
drive drive1 device /dev/ad4s1e drive drive2 device /dev/ad6s1e volume firepipe plex org concat sd length 29314m drive drive1 sd length 29314m drive drive2
The result was a ~55GB vinum volume. Starting with FreeBSD 4.4, a new
command, called growfs(8), was introduced which allows one to grow (but
not shrink) a filesystem. It was particularly designed to work with
vinum, but also works on normal filesystems.
The problem and the solution
Not being exactly sure how to format the new disk, I visited the FreeBSD
documentation link suggested by the Diary’s vinum page and read the
details on how to create a “dangerously dedicated” (the original drives
on the plex were sliced by sysinstall) disk. Once that was done, all I
had to do was change /etc/vinum.conf
to this:
drive drive1 device /dev/ad4s1e drive drive2 device /dev/ad6s1e drive drive3 device /dev/ad0e volume firepipe plex org concat sd length 29314m drive drive1 sd length 29314m drive drive2 sd length 78355m drive drive3
Then I rebooted the system to single user mode, and did this:
# vinum resetconfig Type 'NO FUTURE' as is necessary. This will destroy the previous configuration on the vinum volume. # vinum create -f /etc/vinum.conf [..some vinum output..] # growfs /dev/vinum/firepipe
Growfs(8) will ask whether the filesystem is backed up.
NOTE: Backing up the filesystem is HIGHLY recommended. I did this
*BEFORE* touching the new drive or the RAID filesystem.
Growfs(8) will then proceed to extend the filesystem and it will give an
output similar to newfs(8), in that it prints the locations of the
superblocks. Note, however, that these are *new* superblocks on the
filesystem, as they are being placed on the *new* drive. Once this
process finishes, the system should be able to mount the filesystem with
the additional disk space.
It’s quite unnecessary to obliterate the whole vinum config. Since you already have a volume with a concatenated plex you can just add another subdisk to this plex and then run growfs on top of it.
fine and you can tell me the way???
i have had problems vinum had sayed
i use my drive with 200%, and the attachement
from a new generated subdisk have many errors
produced.
The way described in this article has gone fine and
relatively easy, easier then the other with errors.
once growfs have taked a long time for the "growing" ;-))
sincerelly
sorry for my bad english
michael
I ran growfs to expand a file system. growfs ran OK but it printed "Nothing changed" when it finished. I had to use the -y flag to get growfs to actually do something. Fun stuff.
Are you shure, that the volume is correctly configured
and not mounted, vinum started??
i have ran growfs on the growed volume from me and
he says we not growing (bs->bs)
where bs is the size of this volume..
hi,
first i thanks to the author, that he has tested
this critical mission.
i have yesterday at night reconfigure my big
concatenated volume.
it was a little bit tricky and critical for
the data on the volume, may it work’s
an i find this is a great thing,
vinum have not the tools and the comfort
like the veritas volumemanager, may it is stable.
so long… have fun and use FreeBSD….
michael