Date: Sun, 16 Jun 2002 11:39:06 +0930 From: Greg 'groggy' Lehey <grog@FreeBSD.org> To: Corey Snow <corey@snowpoint.com> Cc: freebsd-questions@freebsd.org Subject: Re: Adding hard drive, moving /usr/src Message-ID: <20020616020906.GJ65995@wantadilla.lemis.com> In-Reply-To: <3D0B8EE1.6924.A196528@localhost> References: <3D0B8EE1.6924.A196528@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, 15 June 2002 at 19:00:49 -0700, Corey Snow wrote: > Here's the situation. I have a machine that has a 540 MB hard drive. > I'm running out of room on the /usr slice (partition?). It's fine as > long as I don't try and download any of the source, but in order to > make this box a headless one (cf my previous postings) I need to > recompile the loader, and maybe even have to do a "make world" (I'm > still researching that part. I hope not, because it would probably > take days on this 486). > > Problem is I can't download the all the sources I need because the > /usr partition is running out of space. Lucky me, I've got some extra > hard drives around. I can toss a second drive in, around 800 MB or > so, and add it to the system. Then I can store my /usr/src files > there. > > So here's the questions: > > 1) How do you add a drive to a FreeBSD machine? There are two ways: with /stand/sysinstall or with fdisk and disklabel. The former is much easier. This is described in detail in "The Complete FreeBSD", but basically: 1. Start sysinstall. Go to the index, then select "Partition" to find the drive and set up a partition table. Use the W command to write the partition table. You don't need a boot selector, since you won't be booting from this drive. 2. Exit the partition menu, enter the label menu, and set up your file systems. Use the W command, which will newfs them, so it'll take a while to come back. 3. I think you still need to edit /etc/fstab. Check, anyway. > Does the kernel have to be recompiled? No. > 2) When I have the new drive in and set up, how can I relocate my > /usr/src files to the new larger slice on the second drive? My > thought was this: mv the files currently in /usr/src to a temp > directory, like /usr/srctemp. Then edit fstab to mount the new slice > to /usr/src and mv the files from srctemp into the new src > directory. Is this the right approach? No. umount the new file system, and remount it on /mnt. Then move the files across to /mnt. I use tar, but others use dump and restore. With tar it would be something like: # umount /usr/src (if necessary) # mount /dev/ad2s1h /mnt # cd /usr/src # tar cf - . | (cd /mnt; tar xvf -) After this is done, check that the files made it, then: # rm -rf /usr/src/* # umount /mnt # mount /usr/src (assuming that /etc/fstab has been updated) It's important to remove the files under /usr/src before mounting the file system in the correct place; otherwise you won't be able to access them at all. Greg -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply. For more information, see http://www.lemis.com/questions.html See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020616020906.GJ65995>