0

I'm trying to restore a clonezilla image of a server that had a total disk size of 1TB, however the server I need to restore to only has 400GB of space available. I figured by reducing the mounted /var partition by 600GB I could easily fit it onto the new server.

So I restored the clonezilla image to a separate server, started up single user mode and resized the partition using resize2fs and lvreduce to get it to the right size. df shows that I've successfully reduced the partition while I'm in centOS (single user or regular).

Only problem? Gparted and clonezilla still see the partition as 860GB rather than the 250GB I reduced it to.

Any input?

Luke
  • 203
  • 1
  • 7

1 Answers1

1

You still have to reduce the partition size manually AFTER doing the filesystem resize and lvreduce. These two utilities do not change the pre-allocated size on the disk, you'll have to do that with either fdisk or gparted.

Assumption: Your PV for the VG is not a full disk but contained within a disk partition.

mdpc
  • 11,856
  • 28
  • 53
  • 67
  • Gparted still won't allow me to resize it... It's still telling me that it can't resize LVMs. – Luke Feb 15 '12 at 19:47
  • You may not be able to resize it, per se. However, you can delete and then recreate the partition with the smaller size. You'll have to be sure you use the same starting location and for safety just a touch more space than you need, to be sure that your space is fully contained in full cylinders. – mdpc Feb 15 '12 at 19:51
  • Oh, deletion of the partition and recreation will NOT touch any of the data on the filesystem/volume group. – mdpc Feb 15 '12 at 19:52
  • So the LVM is "inside" the ext. Do I delete both? Then how do I recreate the LVM? I'm guessing you can't just add a new ext3 partition and have it magically work... – Luke Feb 15 '12 at 20:12
  • OK. Shrunk the extension that the contained the LVM, but I have no clue how to recreate the LVM inside the extension within gparted. – Luke Feb 15 '12 at 20:20
  • shouldn't have to do anything if you did things properly just reboot and things should come up fine. – mdpc Feb 15 '12 at 20:23
  • Well that didn't work. It's expecting an ext2 file system. When I go to create it in gparted it won't let me create it without 1MB space before the partition. – Luke Feb 15 '12 at 20:47