Disallow resizing of LVM2 PVs which are members of exported VGs (#670171)
When an inactive LVM2 Volume Group is exported it makes it unknown to the local system, ready for moving the member Physical Volumes to another system, where the VG can be imported and used. In this state a PV can't be resized. # lvm pvresize /dev/sda10 Volume group Test-VG1 is exported Unable to read volume group "Test-VG1". 0 physical volume(s) resized / 1 physical volume(s) not resized # echo $? 5 Fix this by preventing resizing of such a PV. This has been coded in a generic way using new function filesystem_resize_disallowed() to determine whether a file system is allowed to be resized or not. For a file system which can be resized, but is currently not allowed to be resized, the behaviour is as follows: 1) Pasting into unallocated space is limited to creating a new partition which is the same size as the copied partition. 2) Resizing the partition is disallowed, only moving the partition is allowed. 3) Pasting into an existing partition will only copy the file system. If the destination partition is larger a warning will report that growing the file system is not currently allowed. 4) Checking a partition will also report a warning that growing the file system is not currently allowed. This is exactly the same behaviour as for a file system which does not implement resizing, except for a different warning message. Bug #670171 - Add LVM PV read-write support
parent
96c9fc12
Please register or sign in to comment