0

I have a Centos 7 VM which was built from an OVA template. I have it running under Virtualbox.

Issue I have is the VM has a dynamic disk of 200G - but only 4 Gb used.

I want to shrink the partition to 40Gb.

EDIT. The file system is xfs

Its an LVM structure with 2 partitions, swap and root. Root is the one i want to shrink.

I have tried everything.

i have booted from a Live CD and tried using resize2fs but i just keep getting bad magic block / superblock error.

anyone please help me out ?

cheers

Adam
  • 11
  • 2
  • Why are you trying to use resize2fs? Did you check your filesystem type is actually ext*? By default it is not ext* but XFS. And XFS filesystems cannot be shrunk. – Michael Hampton Jun 10 '20 at 20:05
  • Like Michael Hampton said, obtain what filesystem you are using first, and add that to your question. You can find out by running `mount` and looking for your root partition. You are looking for the word **type XYZ**, such as **type ext4** or **type xfs**. – ender.qa Jun 10 '20 at 20:47
  • Yes it’s xfs I’d like to clone the vm to an img or qcow format to deploy online to a cloud vps and don’t need the 200g disk size – Adam Jun 11 '20 at 23:30
  • Honestly you should just build a new VM with the correct disk size. It will be a lot easier. – Michael Hampton Jun 12 '20 at 03:58
  • can you output of `pvs`. , `vgs` & `lvs` – EchoMike444 Jun 14 '20 at 00:37

0 Answers0