1

I'm running a linux server and I need to expand the /tmp partion. Everything I come across using fdisk or parted is saying that I need to unmount before expanding. Is this true, or can it be safely done while still mounted?

0

2 Answers 2

1

there is no need to resort to an liveCD. I mostly follow those steps:

  1. resize the partition as needed
  2. if the resized partition can't be reread because it's active umount it
  3. if it can't be umounted because it's vital to the running system we must reboot
  4. now the resized partition can be online-expanded by 'resize2fs -p /dev/xxx'
3

This is true, you can not resize a mounted partition.

Download the gparted LiveCD, put it on a USB stick using unetbootin and boot from it. That way, the filesystem is not mounted and you can resize it.

Edit: with /tmp, you may also get away with rebooting the machine in single user mode or just booting to a shell. For example, if you pass init=/bin/bash as boot parameter, you boot nothing but a shell, so /tmp will probably not be mounted.

2
  • This is a remote server, with live traffic. /tmp is on it's own partition, so I could unmount, but I'll take down all the sites on the box that depend on the tmp data. Like sessions, mysql, etc. Thanks. I'll just take it down on an off hour.
    – Eric Leroy
    Jan 4, 2013 at 15:27
  • There are some cases in which live resizing is possible, particularly if you use LVM, a resizable filesystem such as ext3, and a kernel that supports resizing live filesystems.
    – Sjoerd
    Jan 4, 2013 at 15:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .