The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Things look quiet here. But I've been doing a lot of blogging at dan.langille.org because I prefer WordPress now. Not all my posts there are FreeBSD related. I am in the midst of migrating The FreeBSD Diary over to WordPress (and you can read about that here). Once the migration is completed, I'll move the FreeBSD posts into the new FreeBSD Diary website.

Growing your filesystem with growfs --- by Will Andrews 19 August 2002
Need more help on this topic? Click here
This article has 5 comments
Show me similar articles

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.


Share
Need more help on this topic? Click here
This article has 5 comments
Show me similar articles