From owner-freebsd-questions@FreeBSD.ORG Tue Sep 13 14:23:21 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C537016A41F for ; Tue, 13 Sep 2005 14:23:21 +0000 (GMT) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3566343D4C for ; Tue, 13 Sep 2005 14:23:20 +0000 (GMT) (envelope-from cpghost@cordula.ws) Received: from epia2.farid-hajji.net (epia-2 [192.168.254.11]) by fw.farid-hajji.net (Postfix) with ESMTP id 955324C7A3; Tue, 13 Sep 2005 16:23:37 +0200 (CEST) Date: Tue, 13 Sep 2005 16:25:21 +0200 From: cpghost To: Daniel Gonzalez Message-ID: <20050913142521.GA32306@epia2.farid-hajji.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.10i Cc: freebsd-questions@freebsd.org Subject: Re: Re-use disk Space? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2005 14:23:21 -0000 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/