Search code examples
resizefat32lvm

How can I resize a fat32 file system in an LVM partition?


Simple enough: I have an LVM partition (e.g. /dev/mapper/foo-fat) that contains a Fat32 file system. Prior to reducing the size of this LVM partition (which I'll do with lvmreduce), I want to reduce the size of the Fat32 filesystem it contains.

It looks like parted should be able to do it, but I can't find the magic invocation to make it work.


Solution

  • Use fatresize (manpage) and then proceed with lvresize.

    To avoid truncating the FS, you should first shrink the VFAT volume a few hundreds (to be safe) megabytes more than wanted, then resize the LVM container and finally grow the volume to fill the LVM partition.

    Besides, this question does not belong to StackOverflow but to ServerFault.