Skip to contentSkip to conversation

changing the size of a mounted partition

linux-lvm Andreas Dilger 1 participant 1 message Oct 18, 1999 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · Andries

If you want to be able to shrink a mounted partition then that seems tricky - we have to collect from the rest of the kernel how much is being used as swap, or how large the currently mounted filesystem is. On the other hand, if you only want to grow a partition, there is no problem.

Currently, my patch only allows growing the filesystem, so your patch will probably do the right thing. At some time in the future it might allow shrinking the filesystem. The real problem with shrinking an ext2 filesystem is that ext2 normally spreads the directories across all of the available groups, so it is rare that the groups at the end of a filesystem are totally empty, even if the filesystem is mostly unused.

I don't think it will be very easy to do an online shrink unless the end groups are free, which will only happen if the filesystem was newly extended, or if it is nearly empty. This shouldn't be a major problem, since most other filesystems don't allow shrinking at all, even when unmounted. For ext2, you can always unmount your filesystem and use ext2resize to shrink it.

Cheers, Andreas

Signature · 3 lines
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert