WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] LVM partition resize pain...

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] LVM partition resize pain...
From: Erich Weiler <weiler@xxxxxxxxxxxx>
Date: Mon, 07 Jan 2008 16:50:10 -0800
Delivery-date: Mon, 07 Jan 2008 16:51:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.12 (X11/20071220)
Hi All-

Was hoping someone would know what's going on here....

I created a Xen VM on top of a LVM volume. The volume was like 530GB big. Within the volume sits the VM, with 5 partitions, one of them 500GB big (the other 4 file systems comprise the other 30GB). Each virtual disk partition exists as /dev/xvda1 - /dev/xvda5. /dev/xvda5 is the one with the 500GB file system on it.

I wanted to reduce the size of the filesystem on /dev/xvda5 from 500GB to 5GB. So I unmount /dev/xvda5 then run:

# resize2fs /dev/xvda5 5G

Works great. Next, I shut down the VM and reduce the size of my logical volume:

# lvreduce -v -L 40G /dev/vg0/xen1

So the volume is still larger than all the filesystems in it, such that I don't lose any data. The command worked successfully. Then I booted the VM and got errors on boot say something about "/dev/xvda: wanted 500000000 but was limited to 5000000" or something like that. But the VM booted even after the errors and appeared to work OK. So I:

# fdisk -l

Disk /dev/xvda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          13      104391   83  Linux
/dev/xvda2              14        1288    10241437+  83  Linux
/dev/xvda3 1289 2308 8193150 82 Linux swap / Solaris
/dev/xvda4            2309       67620   524618640    5  Extended
/dev/xvda5            2309       67620   524618608+  83  Linux

Notice it says that /dev/xvda is 32.2GB (which is correct), but /dev/xvda4-5 still think they are 500GB big! A 'df' shows that the filesystem is really only 5GB though, as expected. I tried some parted magic but parted can't do anything (even print the partition table!), I get errors like:

[root@template ~]# parted /dev/xvda
GNU Parted 1.8.1
Using /dev/xvda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Can't have a partition outside the disk!
(parted)

and it won't let me make changes, etc. Is there something I missed? Wasn't the OS supposed to recognize the size change in /dev/xvda on boot? Or do I have to manually change the disk label or something? Is it just impossible to resize a VM's file system then change the volume the VM sits on to reflect the change?

Thanks so much for any ideas!

-erich


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>