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?
2 Answers
there is no need to resort to an liveCD. I mostly follow those steps:
- resize the partition as needed
- if the resized partition can't be reread because it's active umount it
- if it can't be umounted because it's vital to the running system we must reboot
- now the resized partition can be online-expanded by 'resize2fs -p /dev/xxx'
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.
-
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. Jan 4, 2013 at 15:27
-