Growing your filesystem with growfs
This article was written by Will Andrews.
Copyright (c) 2002 Will Andrews <firstname.lastname@example.org>. All rights reserved.
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
Its contents were:
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.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 problem and the solutionNot 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
Then I rebooted the system to single user mode, and did 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
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.# 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