From owner-freebsd-questions Thu Oct 24 7:22:16 2002 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 8CCD537B401 for ; Thu, 24 Oct 2002 07:22:14 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A06B43E42 for ; Thu, 24 Oct 2002 07:22:12 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.6/8.12.6) with ESMTP id g9OEM1Kf013835; Thu, 24 Oct 2002 15:22:01 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.6/8.12.6/Submit) id g9OELufW013834; Thu, 24 Oct 2002 15:21:56 +0100 (BST) Date: Thu, 24 Oct 2002 15:21:56 +0100 From: Matthew Seaman To: info@lespetitsplaisirs.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: how to add space Message-ID: <20021024142156.GA87313@happy-idiot-talk.infracaninophi> Mail-Followup-To: Matthew Seaman , info@lespetitsplaisirs.com, freebsd-questions@FreeBSD.ORG References: <5.1.0.14.2.20021024093139.00a8df48@mail.host45.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20021024093139.00a8df48@mail.host45.com> User-Agent: Mutt/1.5.1i X-Spam-Status: No, hits=-11.2 required=5.0 tests=IN_REP_TO,REFERENCES,SPAM_PHRASE_02_03,USER_AGENT, USER_AGENT_MUTT version=2.41 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Oct 24, 2002 at 09:50:12AM -0400, info@lespetitsplaisirs.com wrote: > How can I enlarge my /usr slice on a disk? > Do I need to re-partition my disks? > I have: 34gb Raid and 2 10gb SCSI HDD's. The RAID array is now NTFS and > the other 2 are chopped into NTFS, fat16 and FreeBSD. I could add another > 4gb to FreeBSD - but how? > I am not too enthusiastic about reinstalling everything. I just updated to > FBSD 4.7 and need to add space to install openofice. The easiest thing to do is probably to use some or all of the available 4Gb as a new filesystem mounted under /usr. For instance, /usr/local might be a good choice. You need to copy the current contents of /usr/local onto the new partition, move the old /usr/local aside somewhere and mount the new one in it's place: Assuming the disk partition where you have space is /dev/da2s2 something like the following (in single user mode): mount -a fdisk -i da2 [ Mark slice 2 as belonging to FreeBSD ] disklabel -e da2s2 [ Create a 4.2BSD partition /dev/da2s2e, say ] newfs /dev/da2s2e mkdir /usr/local.new mount -t ufs /dev/da2s2e /usr/local.new rsync -avx /usr/local/ /usr/local.new/ [ rsync(1) is only one way to copy the whole directory tree over. Obviously, you need to install ports/net/rsync before dropping to single user... Another alternative might be: cd /usr/local ; tar -cf - . | ( cd /usr/local.new ; tar -xvpf - ) or there are similar methods using find+cpio, dump+restore etc.] umount /usr/local.new mv /usr/local /usr/local.old mkdir /usr/local mount -t ufs /dev/da2s2e /usr/local diff -ur /usr/local.old /usr/local [ make sure everything copied OK etc. ] vi /etc/fstab [ add /dev/da2s2e to standard mounts ] reboot Now, when the system comes back up multiuser you should have a separate /usr/local partition containing the same files as the original /usr/local directory. Once you're satisfied that everything has gone according to plan you can delete /usr/local.old and make merry in the extra space that becomes available. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message