I have a Linux server with /var in XFS and I want to change to EXT4. There is enough space in /home, so I can backup all files in /var.

Is there a way to do it while the system in running ?

I think mount --bind and mount --move can help, but I cannot find an example.


As far as I know, you can't change the filesystem while the partition is mounted. You will first need to umount <partition name> and once that is done, you can use something like GParted to change the filesystem type to EXT4.

  • I think I can mount /var to read-only first. Since rsyslogd and screen are using /var, I cannot umount it. – Galaxy Jul 3 '14 at 13:41
  • You might be able to get away with that umount -r <partition name> – ryekayo Jul 3 '14 at 13:43
  • Yes, mount to readonly, and then, how to switch to backup ? – Galaxy Jul 3 '14 at 13:45
  • You can tarball all the files in the partition to home.. tar cvfz /target/tarname.tgz ~/destination/tarname.tgz – ryekayo Jul 3 '14 at 13:48
  • Did this information help you at all? – ryekayo Jul 3 '14 at 14:33

It seems we cannot switch a Linux partition online while there is opened file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.