Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Sep 2005 16:25:21 +0200
From:      cpghost <cpghost@cordula.ws>
To:        Daniel Gonzalez <spammesilly@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Re-use disk Space?
Message-ID:  <20050913142521.GA32306@epia2.farid-hajji.net>
In-Reply-To: <ef208e530509130704ec74cf2@mail.gmail.com>
References:  <ef208e530509130704ec74cf2@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 13, 2005 at 10:04:48AM -0400, Daniel Gonzalez wrote:
> My /usr partiton is almost at capacity (90%) on a separate disk
> (/dev/ad1) from the rest of the other partitons. I allocated way too
> much space for my /music partition (dev/ad0s1f). I don't plan on ever
> using up the 4.1GB that's left over. I've been archiving (to CD) my
> mp3s, oggs etc so I always have a backup. What I wanted to know is
> would it be possible to reclaim some disk space under the /music
> partion and link a /usr sub-partition (/usr/home) to that reclaimed
> space? Hopefully I've explained myself clearly. What part of the
> handbook sections could I start with?

You could e.g. use md(4). Just create a big file (say: /music/usr_home.data)
and create a file system on it:

### Do this only one:
# setenv SIZE_IN_MB 300
# dd if=/dev/zero of=/music/usr_home.data bs=1024k count=${SIZE_IN_MB}
# mdconfig -a -t vnode -f /music/usr_home.data
md0
# newfs /dev/md0
# mount /dev/md0 /usr/home

### Do this every time you reboot:
# mdconfig -a -t vnode -f /music/usr_home.data
# mount /dev/md0 /usr/home

### Do this before shutting down:
# umount /usr/home
# mdconfig -d -u md0

If you want, you can also encrypt /dev/md0 with gbde(1) before
creating a filesystem on it; something like this:

### Do this only one:
# setenv SIZE_IN_MB 300
# dd if=/dev/zero of=/music/usr_home.data bs=1024k count=${SIZE_IN_MB}
# mdconfig -a -t vnode -f /music/usr_home.data
md0
# gbde init /dev/md0 -L /etc/usr_home.lock
Passphrase: .....
# gbde attach /dev/md0 -l /etc/usr_home.lock
Passpharse: .....
# newfs /dev/md0.bde
# mount /dev/md0.bde /usr/home

### Do this every time you reboot:
# mdconfig -a -t vnode -f /music/usr_home.data
md0
# gbde attach /dev/md0 -l /etc/usr_home.lock
Passphrase: .....
# mount /dev/md0.bde /usr/home

### Do this before shutting down:
# umount /usr/home
# gbde detach /dev/md0
# mdconfig -d -u md0

> Dan Gonzalez
> spammesilly@gmail.com
> AOL IM: signulth
> Google Talk: spammesilly

Regards,
-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050913142521.GA32306>