Yes, resize2fs
moves data as needed (at least on ext4). That means that lvreduce -r
(the -r
is critical) is safe as well, because it first calls resize2fs
via fsadm
. Note that ext4 can shrink only in offline mode (when unmounted); trying to do it while mounted should just error out.
Of course, "safe" is only if there are no bugs, power isn't cut in the middle, etc. So you should still have backups.
BTW: roaima informs me that resize2fs
actually syncs after each write, I presume that's to be safe in case of power failure. That'd of course depend on sync actually fully working, which it doesn't always (sometimes disk and especially SSDs do not handle power failures well). That also means that eatmydata
(which prevents sync) can speed it up a bit — something roaima has tried — with of course making it much less safe if any failure occurs.