3月 282008
 

— by Will Andrews 19 August 2002

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.

 回复

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>