Erich Weiler
2008-Jan-10 00:09 UTC
[Xen-users] Resizing partitions on a VM sitting on a LVM volume
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: 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 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.... Any advice would be greatly appreciated!! -erich _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Alain BARTHE
2008-Jan-10 08:49 UTC
RE [Xen-users] Resizing partitions on a VM sitting on a LVM volume
xen-users-bounces@lists.xensource.com 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@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Erich Weiler
2008-Jan-10 16:49 UTC
Re: RE [Xen-users] Resizing partitions on a VM sitting on a LVM volume
> I don''t know why, but I experienced the same problem with parted, so we > use fdisk.Do have the syntax to resize partitions using fdisk handy? The man page on fdisk was not very helpful... Thanks for the advice! -erich _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Alain BARTHE
2008-Jan-10 17:08 UTC
Re: RE [Xen-users] Resizing partitions on a VM sitting on a LVM volume
Erich Weiler <weiler@soe.ucsc.edu> a écrit sur 10/01/2008 17:49:27 :> > I don''t know why, but I experienced the same problem with parted, sowe> > use fdisk. > > Do have the syntax to resize partitions using fdisk handy? The man page> on fdisk was not very helpful... > > Thanks for the advice! > > -erichAs fdisk is interactive, there is not particular syntax. You have to first delete the partition (d), then to recreate it (n) by giving the same starting cylinder than before, and by giving the total number of cylinders as last cylinder. Note that you can only resize the last partition of your disk. Hope this helps. Alain. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Erich Weiler
2008-Jan-10 21:09 UTC
Re: RE [Xen-users] Resizing partitions on a VM sitting on a LVM volume
That worked beautifully. Thanks for your help on this! -erich Alain BARTHE wrote:> > xen-users-bounces@lists.xensource.com 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@lists.xensource.com > > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2008-Jan-11 13:50 UTC
Re: [Xen-users] Resizing partitions on a VM sitting on a LVM volume
Hi Erich,> 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?Partition 4 is an "easy" one to resize since it''s just the extended partition and doesn''t have a filesystem of its own. Partition 5 is formatted with ext3. parted isn''t liking this but i think that''s because it''s having trouble resizing the ext3 filesystem, rather than because it can''t resize the partition itself. Is the filesystem mounted at the time? Maybe it can''t be live-resized? Cheers, Mark> 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.... > > Any advice would be greatly appreciated!! > > -erich > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Erich Weiler
2008-Jan-11 17:42 UTC
Re: [Xen-users] Resizing partitions on a VM sitting on a LVM volume
> Partition 5 is formatted with ext3. parted isn''t liking this but i think > that''s because it''s having trouble resizing the ext3 filesystem, rather than > because it can''t resize the partition itself. > > Is the filesystem mounted at the time? Maybe it can''t be live-resized?No, the file system was definitely not mounted at the time. I was able to do this using fdisk as Alain suggested earlier. Thanks for offering your advice though! -erich _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2008-Jan-11 17:44 UTC
Re: [Xen-users] Resizing partitions on a VM sitting on a LVM volume
Out of interest, did resizing the ext3 filesystem itself work properly once you''d enlarged the partition? Did you just use resize2fs? Cheers, Mark On Friday 11 January 2008, Erich Weiler wrote:> > Partition 5 is formatted with ext3. parted isn''t liking this but i think > > that''s because it''s having trouble resizing the ext3 filesystem, rather > > than because it can''t resize the partition itself. > > > > Is the filesystem mounted at the time? Maybe it can''t be live-resized? > > No, the file system was definitely not mounted at the time. I was able > to do this using fdisk as Alain suggested earlier. Thanks for offering > your advice though! > > -erich-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Erich Weiler
2008-Jan-11 17:52 UTC
Re: [Xen-users] Resizing partitions on a VM sitting on a LVM volume
Ya, it basically worked OK. 1: kpartx -a /dev/myvg/mylv 2: Resize partition using fdisk (delete old partition, recreate new one with a larger size, note that the file system remains on the partition) 3: Reboot Dom0 4: kpartx -a /dev/myvg/mylv (again) 5: e2fsck -y /dev/myvg/mylv5 6: resize2fs -p /dev/myvg/mylv5 That''s basically it. Mark Williamson wrote:> Out of interest, did resizing the ext3 filesystem itself work properly once > you''d enlarged the partition? Did you just use resize2fs? > > Cheers, > Mark > > On Friday 11 January 2008, Erich Weiler wrote: >>> Partition 5 is formatted with ext3. parted isn''t liking this but i think >>> that''s because it''s having trouble resizing the ext3 filesystem, rather >>> than because it can''t resize the partition itself. >>> >>> Is the filesystem mounted at the time? Maybe it can''t be live-resized? >> No, the file system was definitely not mounted at the time. I was able >> to do this using fdisk as Alain suggested earlier. Thanks for offering >> your advice though! >> >> -erich > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users