Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jun 2002 02:01:24 -0700
From:      Darren Pilgrim <dmp@pantherdragon.org>
To:        omax@mail.lviv.ua
Cc:        FBSD Newbies <freebsd-newbies@FreeBSD.ORG>
Subject:   Re: Add new slice
Message-ID:  <3D085F64.94EEC5B2@pantherdragon.org>
References:  <1128093858.20020613082903@mail.lviv.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D085F64.94EEC5B2>