From owner-freebsd-questions@FreeBSD.ORG Thu Mar 18 09:58:02 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA2E6106564A for ; Thu, 18 Mar 2010 09:58:02 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 1CF168FC15 for ; Thu, 18 Mar 2010 09:58:01 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id o2I9uF18031755 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 18 Mar 2010 09:56:16 GMT (envelope-from m.seaman@infracaninophile.co.uk) Message-ID: <4BA1F8BF.3010902@infracaninophile.co.uk> Date: Thu, 18 Mar 2010 09:56:15 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Aiza References: <4BA1F42C.1030607@comclark.com> In-Reply-To: <4BA1F42C.1030607@comclark.com> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.95.3 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, SPF_FAIL autolearn=no version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on happy-idiot-talk.infracaninophile.co.uk Cc: FreeBSD Questions Subject: Re: shrink /usr size 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: Thu, 18 Mar 2010 09:58:02 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 18/03/2010 09:36:44, Aiza wrote: > /usr is the last partition in the slice. It has 15GB and only 600mb > used. I would like to shrink /usr to 7GB leaving me 7GB for another new > partition for mysql DB testing. How do I shrink /usr? Backup the contents or /usr to a different partition, or preferably to some external media. Unmount /usr and destroy it by using bsdlabel(1) to create two appropriately sized partitions in its place. Create filesystems on the new partitions using newfs(1). Restore the backup of /usr. Edit /etc/fstab as appropriate and mount the new partitions. Everything you really need to do this is on the root partition, but you might find lack of vi(1) and various other utilities somewhat inconvenient. Also editing the label of a disk with mounted partitions is a pretty risky operation and forbidden by default: you will need to know the magic incarnation: sysctl kern.geom.debugflags=16 Also, there's no real reason to keep the mysql data in its own partition - -- if it was on a different disk that would be a different matter -- so if your /var is big enough, you could just swap /var and /usr, which saves you all that mucking around with partitions. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuh+L8ACgkQ8Mjk52CukIzTxwCfWuPe6vDdoQIvbiQFxoLTp/Wu PIAAn1YhLHwzKfcJF4BPssNt6WgvdXTN =2DGA -----END PGP SIGNATURE-----