[linux-lvm] Filesystem corruption with LVM's pvmove onto a PV with a larger physical block size
ifranzki at linux.ibm.com
Thu Feb 28 16:30:36 UTC 2019
On 28.02.2019 15:36, Ilia Zykov wrote:
>> Discarding device blocks: done
>> Creating filesystem with 307200 1k blocks and 76912 inodes
>> # pvs
>> /dev/LOOP_VG/LV: read failed after 0 of 1024 at 0: Invalid argument
>> /dev/LOOP_VG/LV: read failed after 0 of 1024 at 314507264: Invalid argument
>> /dev/LOOP_VG/LV: read failed after 0 of 1024 at 314564608: Invalid argument
>> /dev/LOOP_VG/LV: read failed after 0 of 1024 at 4096: Invalid argument
>> PV VG Fmt Attr PSize PFree
>> /dev/loop0 LOOP_VG lvm2 a-- 496.00m 496.00m
>> /dev/mapper/enc-loop LOOP_VG lvm2 a-- 492.00m 192.00m
>> In case the filesystem of the logical volume is not mounted at the time of pvmove, it gets corrupted anyway, but you only see errors when trying to mount it.
> It's because you FS had 1k blocks.
> New device can't read with block 1k.
> If you plan pvmove on device with 4k. Maybe you need make fs with:
> "mkfs.ext4 -b 40
The beauty of pvmove is that it works on existing LVs with filesystems on it.
So I might have filesystems on LVs that used the default block size that I want to move via pvmove.
At the time the file system was created (possibly may years ago), I did not know that I would ever move it to a device with a larger block size.
If I have to create a new filesystem after the move, then pvmove is useless.... I then could just create a new LV on the desired PV(s).
> See comments:
eMail: ifranzki at linux.ibm.com
Tel: ++49 (0)7031-16-4648
Fax: ++49 (0)7031-16-3456
Linux on IBM Z Development, Schoenaicher Str. 220, 71032 Boeblingen, Germany
IBM Deutschland Research & Development GmbH / Vorsitzender des Aufsichtsrats: Matthias Hartmann
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM DATA Privacy Statement: https://www.ibm.com/privacy/us/en/
More information about the linux-lvm