On Thu, Oct 24, 2002 at 09:50:12AM -0400, [EMAIL PROTECTED] wrote:
> How can I enlarge my /usr slice on a disk?
> Do I need to re-partition my disks?
> I have: 34gb Raid and 2 10gb SCSI HDD's. The RAID  array is now NTFS and 
> the other 2 are chopped into NTFS, fat16 and FreeBSD. I could add another 
> 4gb to FreeBSD - but how?
> I am not too enthusiastic about reinstalling everything. I just updated to 
> FBSD 4.7 and need to add space to install openofice.

The easiest thing to do is probably to use some or all of the
available 4Gb as a new filesystem mounted under /usr.  For instance,
/usr/local might be a good choice.  You need to copy the current
contents of /usr/local onto the new partition, move the old /usr/local
aside somewhere and mount the new one in it's place:

Assuming the disk partition where you have space is /dev/da2s2
something like the following (in single user mode):

    mount -a
    fdisk -i da2            [ Mark slice 2 as belonging to FreeBSD ]
    disklabel -e da2s2      [ Create a 4.2BSD partition /dev/da2s2e, say ]
    newfs /dev/da2s2e
    mkdir /usr/local.new
    mount -t ufs /dev/da2s2e /usr/local.new
    rsync -avx /usr/local/ /usr/local.new/   

        [ rsync(1) is only one way to copy the whole directory tree over.
          Obviously, you need to install ports/net/rsync before dropping to
          single user... Another alternative might be:

          cd /usr/local ; tar -cf - . | ( cd /usr/local.new ; tar -xvpf - )

          or there are similar methods using find+cpio, dump+restore etc.]

    umount /usr/local.new
    mv /usr/local /usr/local.old
    mkdir /usr/local
    mount -t ufs /dev/da2s2e /usr/local
    diff -ur /usr/local.old /usr/local  [ make sure everything copied OK etc. ]
    vi /etc/fstab                       [ add /dev/da2s2e to standard mounts ]
    reboot

Now, when the system comes back up multiuser you should have a
separate /usr/local partition containing the same files as the
original /usr/local directory.  Once you're satisfied that everything
has gone according to plan you can delete /usr/local.old and make
merry in the extra space that becomes available.

        Cheers,

        Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
                                                      Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to