3

We need to resize the partition that is mounted to /var on a running machine. The only way to access it is via SSH, so live CD is not an option for us.

Can we repartition the file system without losing any data? (The system is freshly installed so there isn't any data yet.)

We tried parted but we got following warning:

Error: File system was not cleanly unmounted! You should run e2fsck. Modifying an unclean file system could cause severe corruption.

Igor Pavelek
  • 133
  • 5
  • 2
    Here you go! http://serverfault.com/questions/90270/resize-var-partition-on-a-remote-system-linux-debian-lenny – michalwu Aug 31 '11 at 09:03

1 Answers1

2

First you have to stop all programs which use /var. You can find them with fuser -m /var.

Here you have to take care that you do not kill your SSH session. In order to keep SSH alive it might be necessary to temporarily reconfigure your SSH server to prevent any access to /var.

After that you can unmount your /var partition. And then you can use parted or any other partition tool, which also resizes the Ext2/3 filesystem.

It might be better to discuss this on https://unix.stackexchange.com/

ceving
  • 499
  • 4
  • 24