Bug#688757: pvmove onto disk with different sector size hazardous
daniel at pocock.com.au
Tue Sep 25 12:45:47 UTC 2012
I have marked this `severe' because it has a high probability of
filesystem corruption and drives with 4096 byte sectors are likely to
become much more widespread.
I recently purchased a 3TB drive and created one big 3TB partition for lvm
I then used pvmove to move some filesystems from my internal drive to
the external drive. As a test run, I was just moving filesystems that
were mounted but with no open files.
Many errors appeared during the pvmove operation
I unmounted them all and did an fsck on all of them and they are all
clean. Mounting them again, some fail to mount, this error is in dmesg:
error: fsblocksize 1024 too small for hardware sectorsize 4096
The old disk has 512 byte sectors and the new disk has 4096 byte sectors.
It appears that pvmove is potentially a lot more dangerous than the man
page suggests. Although they were mounted during the pvmove, they were
not in use (they are backup filesystems and they only get written to on
demand). If they had open files at the time, I suspect that corruption
would have occurred.
Some potential ideas:
a) pvmove should check sector sizes and require --force if there is a
b) more elaborate: pvmove could check filesystem block sizes
More information about the pkg-lvm-maintainers