[Techtalk] Resizing A Partition?

Conor Daly conor.daly at oceanfree.net
Sun Nov 23 01:11:44 EST 2003


On Sat, Nov 22, 2003 at 12:29:55PM -0800 or so it is rumoured hereabouts, 
Raquel Rice thought:
> On Sat, 22 Nov 2003 18:46:10 +1100
> Rasjid Wilcox <rasjidw at openminddev.net> wrote:
> 
> > On Saturday 22 November 2003 16:31, Raquel Rice wrote:
> > > I need to resize the /usr partition on an existing installation.
> > > What is the best way to do that with the minimum damage?
> > 
> > Other options depend a bit on your disk layout and/or whether you
> > have any empty (non-partitioned) disk space.  In which case the
> > output of df would be useful, and possibly fdisk.
> 
> This was one thing I failed to mention.  The hard disk is 80 GB,
> with about 70 GB non-partitioned.

Still 'df -h' and 'fdisk -l' would be helpful.  Anyway, assuming /usr is
on its own partition, one easy way would be to make a new "/usr"
partition, create a filesystem on it, mount it under /mnt/usr and do a:

cp -ax /usr/* /mnt/usr/

Then mount the new /usr partition in place of the old one.  If /usr is not
in its own partition you do the same as above but, _after_ you've
confirmed that the new /usr contains everything, you have to unmount /usr
and then delete the old /usr files to reclaim the space.  To do this:

unmount /usr and anything under it.  Now do:

rm -r /usr/*

then remount /usr and you should be done.

Conor
-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
---------------------
Faenor.cod.ie
 11:05pm  up 30 days, 16:14,  0 users,  load average: 0.00, 0.00, 0.13
Hobbiton.cod.ie
 12:03am  up 30 days, 16:06,  1 user,  load average: 0.15, 0.10, 0.02


More information about the Techtalk mailing list