Is it possible (aka safe) to resize a partition while the system is running?

I'm talking about resizing my root partition (/), while the system is on (I know that's usually impossible, but I'm just hoping there is some way to do it). I want to know if there is some way I can boot the system up in read-only mode (without a live cd, just in case), and resize /.

If it can't work, I understand, as that is what I already know to be the case (but you never know =P)


Solution 1:

Some filesystems support "on-line" resizing, and in that case I would consider it reasonably safe unless the manpage/program warns it is not.

Most filesystems that support "on-line resize" only support making it larger (e.g. XFS, ext2/3/4, reiserfs).

Btrfs supports on-line growing and shrinking, but of course it's not as stable as a long-existing filesystem like XFS or ext4 yet.

Solution 2:

I agree with the earlier comment. I would just add to make GOOD BACKUPS before attempting anything like this. I also found that I can do this only if the partition is unmounted, as well as all partitions after this one on the hard disk. I saw this when attempting to merge two partitions together, by first deleting one, freeing up space, and then adding the freed space to an existing partition.

I was told that all partitions above the one to be increased must be unmounted first. I did unmount it, and merged the partition. It was successful.

BUT do backups backups backups backups ....................did I say BACKUP ?