[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE [Xen-users] Resizing partitions on a VM sitting on a LVM volume




xen-users-bounces@xxxxxxxxxxxxxxxxxxx a écrit sur 10/01/2008 01:09:18 :

> Greetings all!
>
> I emailed a little while ago about an issue similar to this one but am
> having issues with it....
>
> I have a Xen VM sitting on an LVM volume.  I want to grow a file system
> in the VM.  So I 'lvextend' the LVM volume first from 24GB to 64.4GB.
> No problems there.  Then I boot the VM and run parted:


We don't boot the VM at this time. We continue resizing the partitions from the dom0. If you are resizing the VM root filesystem, you will need to use this way.

>
> sh-3.1# 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
>
> Model: Xen Virtual Block Device
> Disk /dev/xvda: 64.4GB
> Sector size (logical/physical): 512B/512B
> Partition Table: msdos
>
> Number  Start   End     Size    Type      File system  Flags
>   1      32.3kB  107MB   107MB   primary   ext3         boot
>   2      107MB   10.6GB  10.5GB  primary   ext3
>   3      10.6GB  19.0GB  8390MB  primary   linux-swap
>   4      19.0GB  24.0GB  5017MB  extended
>   5      19.0GB  24.0GB  5017MB  logical   ext3
>
> (parted) resize 4 19.0GB 64.4GB
> (parted) resize 5 19.0GB 64.4GB
> Error: File system has an incompatible feature enabled.
>
> So I can resize partition 4 with no problems, but can't resize partition
> 5 because of that error.  It clearly sees that the 'disk' has more space
> now.  Anyone know why I can't resize the filesystem/partition this way?


I don't know why, but I experienced the same problem with parted, so we use fdisk. You have to delete partition 4 and 5 in your case, then recreate them with the right size.

>
> I tried deleting the whole partition and re-creating it with the bigger
> size, then re-creating the ext3 file system in it, and that works.  But
> when I do that I lose all my data obviously, so I'd like to be able to
> just use the 'resize' command in parted....


Don't recreate your file system !!! Resize it instead.
From the dom0, run kpartx on your LV:

kpartx -a /dev/myvg/mylv

This will create entries in dev/mapper that correspond to your partitions on the LV, something like:
/dev/mapper/myvg-mylvp1, /dev/mapper/myvg-mylvp2, etc.

Then resize the file system on the growed partition, something like:

resize2fs /dev/mapper/myvg-mylvp5

We used several times this method, it works. If you want to minimize the time your domU is off, you can perform all steps except the last one (filesystem resize) while the domU is alive.

Hope this help.

Alain.

>
> Any advice would be greatly appreciated!!
>
> -erich
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.