File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lib/puppet/provider/logical_volume Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1515 :blkid => 'blkid' ,
1616 :dmsetup => 'dmsetup' ,
1717 :lvconvert => 'lvconvert' ,
18- :lvdisplay => 'lvdisplay'
18+ :lvdisplay => 'lvdisplay' ,
19+ :lsblk => 'lsblk'
1920
2021 optional_commands :xfs_growfs => 'xfs_growfs' ,
2122 :resize4fs => 'resize4fs'
@@ -240,7 +241,10 @@ def size=(new_size)
240241 elsif blkid_type =~ /\b TYPE=\" (ext[34])\" /
241242 resize2fs ( path ) || fail ( "Cannot resize file system to size #{ new_size } because resize2fs failed." )
242243 elsif blkid_type =~ /\b TYPE=\" (xfs)\" /
243- xfs_growfs ( path ) || fail ( "Cannot resize filesystem to size #{ new_size } because xfs_growfs failed." )
244+ # New versions of xfs_growfs only support resizing by mount point, not by volume (e.g. under RHEL8)
245+ # * https://tickets.puppetlabs.com/browse/MODULES-9004
246+ mount_point = lsblk ( '-o' , 'MOUNTPOINT' , '-nr' , path ) . chomp
247+ xfs_growfs ( mount_point ) || fail ( "Cannot resize filesystem to size #{ new_size } because xfs_growfs failed." )
244248 elsif blkid_type =~ /\b TYPE=\" (swap)\" /
245249 swapoff ( path ) && mkswap ( path ) && swapon ( path ) || fail ( "Cannot resize swap to size #{ new_size } because mkswap failed." )
246250 end
You can’t perform that action at this time.
0 commit comments