Standard disk setup here used to include a 5GB root partition (this has been upped to 10GB for a while now). I’ve just encountered the first machine with this setup to be running out of space on
/ - mostly this seems to be down to
Unfortunately resizing on-the-fly in this situation is difficult, due to the
parted restriction that partitions can only be resized at the end - i.e. their start point must remain the same - which means that I can’t just take space off the front of the next partition along. The disk looks like this:
/dev/hda1 / 5GB /dev/hda2 /local 105GB(there’s swap and so on in there too, but let’s ignore that for the moment).
There is a solution to this, which goes like this (to expand
/dev/hda1 by 5GB):
/dev/hda2to be 5GB, leaving 95GB spare.
- Create a new partition in that 95GB.
- Copy the data from
/dev/hda2to the new partition.
/dev/hda1to include that newly spare 5GB which used to be the resized
- Tidy up as appropriate - all partition labels will have changed so you’ll need to edit
/etc/fstaband possibly your boot loader, before you reboot.
- This only works if you have less than 5GB of data in
- You’ll need to be running from a rescue disk or similar if you want to mess around with your
- Read the
partedmanual before actually doing the above :-)
/dev/hda2 partition in the above has rather more than 5GB of data so this plan won’t work. I was intending to dump the data off and then resize; but looking again at the partition table, I’ve noticed the existence of a swap partition between
/local. Now, the data on this obviously doesn’t matter. So I can delete that partition, expand
/dev/hda1 into that, shrink what is actually
/dev/hda3 down by the appropriate size, and put in a new swap partition at the end of the disk. This will only get me 2GB, but that should be enough breathing space to be going on with.
All this did also lead me to thinking about the appropriate size for a
/ partition. 10GB seems like a lot to me… but for a machine with a lot of software, 5GB clearly isn’t enough any more. (There are operational reasons for keeping the root partition separate from ‘data’ partitions.). How much do I really need to allow for futureproofing on boxes I buy now and expect to last 3 yrs? Should I be upping the space to 15GB?