Quantcast
Channel: How do I resize a logical volume to the size of the filesystem within it? - Server Fault
Viewing all articles
Browse latest Browse all 3

How do I resize a logical volume to the size of the filesystem within it?

$
0
0

Target system is CentOS 6.x but resizing operations will be done in %pre section of CentOS 7.6 kickstart.

I have already run resize2fs -M /dev/mapper/centos-home successfully. If I mount the volume, df says it's 100% full. This is good.

Now I need to reduce the size of the logical volume to match the size of the ext4 filesystem. I don't want to use rough estimates. I also don't need to conserve every possible extent. Within a >= 1GB range is fine. i.e. volume can be reduced to 1GB >= filesystem size.

The target volume does contain data I can't lose. I don't have shell (or any other) access to the system. The system has no CentOS repos available so I cannot upgrade it. I don't even have remote hands I can talk to. I'm using a different computer to build and test my install ISO on.

My %pre syntax/script needs to safely reduce /dev/mapper/centos-home so I can create a new root volume for CentOS 7.6 install. Yes, this entire proposition is nuts.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>