From owner-freebsd-newbies Thu Jun 13 2: 2:28 2002 Delivered-To: freebsd-newbies@freebsd.org Received: from spork.pantherdragon.org (spork.pantherdragon.org [206.29.168.146]) by hub.freebsd.org (Postfix) with ESMTP id C94D737B4D6 for ; Thu, 13 Jun 2002 02:01:27 -0700 (PDT) Received: from spark.techno.pagans (spark.techno.pagans [4.61.202.145]) by spork.pantherdragon.org (Postfix) with ESMTP id 96355471DC; Thu, 13 Jun 2002 02:01:26 -0700 (PDT) Received: from pantherdragon.org (speck.techno.pagans [172.21.42.2]) by spark.techno.pagans (Postfix) with ESMTP id EBE2BFFD5; Thu, 13 Jun 2002 02:01:24 -0700 (PDT) Message-ID: <3D085F64.94EEC5B2@pantherdragon.org> Date: Thu, 13 Jun 2002 02:01:24 -0700 From: Darren Pilgrim X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: omax@mail.lviv.ua Cc: FBSD Newbies Subject: Re: Add new slice References: <1128093858.20020613082903@mail.lviv.ua> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org omax@mail.lviv.ua wrote: > > How can I add new disk slice and my /usr become smaller and smaller > and I wanna enlarge it by adding this unformated slice. > What command should I use. > I dont want use /stand/sysinstall because it always asks me to remap > all old slices. Moving /usr is a big operation. Have you tried doing make clean in existing kernel compile directories and the ports tree? Do you have anything lingering under /usr/local from old software or project? Is there any third-party compile directories you can remove or clean? Do you have any ports installed that you don't use/need? Is your /home, /tmp, or /var symlinked into /usr? Are they full of stuff? Basically, have you done any general housekeeping? Anyway, to move /usr: Using sysinstall, add the slice, use the w key to write changes to disk, then add a partition to the slice using a mount point of something like /usr.new, or whatever, use the w key again to write the new label to disk. Sysinstall should automatically newfs and mount the new partition for you. It shouldn't be asking you to remap your slices. Edit /etc/fstab to add the new entry. Drop to single-user mode. You may need to reboot to do this. If you reboot, "fsck" then "mount -a" after you get the shell prompt. Type "mount" again to make sure everything is mounted properly. Transfer the entire contents of your /usr to the new partition. Don't use cp or mv, you *will* screw something up. The recommended method is a pair of tar's piped together like so: tar -cf - -C /usr . | tar xpf - -C /usr.new This operation can take a long time depending on how much data you have and how fast it can be copied. You can swap "xpf" for "xpvf" if you want to watch the process, but doing so will slow things down. After the copy is complete, walk through /usr.new and do a visual inspection to make sure everything looks ok. Don't edit /etc/fstab just yet. Umount /usr.new and /usr, and mount the new partion at /usr. You can't do this if you're using a shell in /usr/local/bin. Double check any symlinks (like /home, /sys, /compat) to make sure they all still work. Logout. The machine will now go through the multi-user startup. Watch for problems. If the machine has problems or won't start up, record the problem/error and reboot. Because you haven't editted fstab yet, the machine will restart using the old /usr. Fix whatever, reboot to single-user mode, repeat. After everything is running as it was, you can edit fstab. It's a good idea to keep the old /usr around for a while until you're ABSOLUTELY certain that everything is intact and working properly. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message