From owner-freebsd-questions@FreeBSD.ORG Sun Jun 15 23:21:01 2003 Return-Path: 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 313E537B401 for ; Sun, 15 Jun 2003 23:21:01 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 861A443FBD for ; Sun, 15 Jun 2003 23:20:59 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h5G6Kmcm019443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Jun 2003 07:20:57 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)h5G6KmI1019442; Mon, 16 Jun 2003 07:20:48 +0100 (BST) (envelope-from matthew) Date: Mon, 16 Jun 2003 07:20:48 +0100 From: Matthew Seaman To: Roger Merritt Message-ID: <20030616062048.GB19062@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Roger Merritt , freebsd-questions@freebsd.org References: <5.2.0.9.0.20030616120100.00a47500@127.0.0.1> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CUfgB8w4ZwR/yMy5" Content-Disposition: inline In-Reply-To: <5.2.0.9.0.20030616120100.00a47500@127.0.0.1> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-7.5 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-questions@freebsd.org Subject: Re: Can I delete a partition (or is it a slice?) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 06:21:01 -0000 --CUfgB8w4ZwR/yMy5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 16, 2003 at 12:11:25PM +0700, Roger Merritt wrote: > I have a chance to get my hands on a 4-GB hard drive that's being replace= d=20 > by a 40-GB drive. My other machine really needs more space (it also has a= =20 > 4-GB drive), and I'd like to move the /usr/home slice (or is it partition= ?)=20 > to the new(er) HDD and delete the /usr/home slice from the older drive. I= =20 > presume the space would then be available to the /usr partition (the two= =20 > are adjacent and /usr/home was created after /usr). Would deleting the=20 > slice cause my partition table to be rewritten with disastrous results? So long as the /usr/home partition follows the /usr partition, you should be able to merge the two by judicious use of 'disklabel -e'. Then use growfs(8) to expand the filesystem into the new space. If the partitions are ordered the other way round then you're pretty much going to have to backup the /usr partition to tape, wipe both the /usr and /usr/home partitions, rebuild the filesystem on the merged area using newfs(8) and restore from the backup. Of course, wiping out the /usr partition will remove a large number of tools that you might need for doing the backup and restore. You can do this using only the tools available in /bin and /sbin --- ie. use dump(8) and restore(8), but you might find it easier to boot from disk 2 of the install media -- the live filesystem image -- and mount your harddrives from there. =20 > Or would it be better to set up three slices, for /, /var, and /usr, on t= he=20 > new drive, transfer the data from the old drive with backup and restore,= =20 > backing up the contents of /usr/home to a tarball on the new drive, then= =20 > repartition the old drive with a single slice, /usr/home, and copy the=20 > backup tarball? That will work too, at the cost of some juggling the disks around so that everything remains bootable. If you're moving the root partition, make sure that you set up /etc/fstab with the correct device names before you try and reboot. Or copy the /, /var and /usr partitions, and then rejumper and swap master and slave disks. Recovering from an incorrect fstab is painful. =20 > Also, since these two drives would be on the same cable, would using tar = to=20 > transfer the data be faster than backup and restore? No -- any differences in speed between different utilities are going to be inconsequential compared to other considerations: tar(1) lives in /usr/bin, which is part of what you're going to be modifying. Better to use tools from outside that area. --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --CUfgB8w4ZwR/yMy5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE+7WHAdtESqEQa7a0RAqj6AJ99MlReFvcKdtU3EDXLwMzfOFvN8wCeNstI soMn4K6NVbQUvMmqvyCpxjw= =Ne7H -----END PGP SIGNATURE----- --CUfgB8w4ZwR/yMy5--