[H-GEN] altering disk partitions

Russell Stuart russell at stuart.wattle.id.au
Tue Mar 18 17:34:31 EST 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

On Tue, 2003-03-18 at 22:16, Michael Anthon wrote:
> > I have a question however - my disk usage is as follows
> >
> > Filesystem           1K-blocks      Used Available Use% Mounted on
> > /dev/hdd1               249871     39532    197439  17% /
> > none                         0         0         0   -  /proc
> > none                         0         0         0   -  /proc/bus/usb
> > none                         0         0         0   -  /dev
> > none                         0         0         0   -  /dev/pts
> > /dev/hda5              1249104     88500   1160604   8% /home
> > /dev/hda1              8209164   3106304   5102860  38% /mnt/windows
> > /dev/hdd7               421680      8863    391046   3% /tmp
> > /dev/hdd5               845256    797612      4708 100% /usr
> > /dev/hdd6               555564     51236    476108  10% /var
> 
> This isn't an answer but more of a question about disk management for those
<snip>

Two points.  Firstly, it is possible to resize your partitions without
backing everything up - just some of it.  This assumes you are using
ext2, and are willing to take a risk.  The steps are:
  1.  Move /var to / (I notice you do have enough space for this).
  2.  "man resize2fs".  I like the way they say "you may loose your
      entire file system".  If you make they mistake they describe, you
      *will* loose your file system.
  3.  Drop down to single user mode, or better still boot off a rescue
      CD such as RedHat or Knoppix.
  4.  Run fdisk, and adjust the sizes of /usr and /var.
  5.  Run resize2fs to grow /usr.
  6.  Reformat hdd6 and move /var back to it.


Secondly, it been a long time since I have bothered having more than one
partition.  And this applies to home and work.  I used to, but things
have changed:

  1.  I have grown older and wiser.  I have found myself in the position
      you are in too many times.

  2.  Now that there are rescue CD's the very good argument of having
      a separate /boot so you can at least boot the thing if something
      goes badly wrong no longer applies.  Its faster, easier, and
      safer to boot off a CD.

  3.  The argument of "if something goes wrong, it won't trash
      everything if I have separate partitions" does not apply either.
      If was always iffy because a single applications files tend to
      be smeared across several file systems, but in any case the
      argument has been completely killed by the huge disk drives
      available nowadays.  Having separate file systems is never as
      good as having a backup, and you can afford to back a backup
      partition with these large drives.  You only need about 1/4 of
      your drive for the backup partition.  Run a command like this
      from cron once a day or week, according to taste:

        find / -mount | cpio -o -H ustar | bzip2 >/dev/hda-backup

      If you are willing to set aside 1/2 your disk space for a
      backup then take a mirror image instead and make it bootable.
      This is what I do.

  4.  The argument about not filling up the root partition is also
      iffy.  By allocating the lusers a partition you are implementing
      a primitive disk quota system - the lusers disk quota is that
      partition.  Only it does not work.  The real havoc happens when
      /tmp and/or /var are filled up, and they aren't protected by
      this method.  But they are protected by ext2, which only allows
      the root to write to the disk when it exceeds a certain usage
      (tunable, but typically 95%).  If this is a problem a real
      quota system is much better than separate partitions.  It will
      protect all file systems, including /tmp and /var.


--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list