Is there a way for a domU to discover size changes of block devices modified by dom0? To make it clear - if I do in dom0 a lvresize of a logical volume given as physical disk to a domU, is there a way to use the new size of this device within the domU without reboot? Thanks Ralf _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jonas Roberto de Goes Filho (sysdebug)
2007-Nov-19 16:40 UTC
Re: [Xen-users] Resize domU block device?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ralf Müller wrote: | Is there a way for a domU to discover size changes of block | devices modified by dom0? | | To make it clear - if I do in dom0 a lvresize of a logical volume given | as physical disk to a domU, is there a way to use the new size | of this device within the domU without reboot? Hi Ralf, If you use xfs filesystem in domU, will be possible to resize filesystem without reboot domU. Is this your question? | | Thanks | Ralf Regards, - -- http://www.goes.eti.br -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHQbxwDo8Z2PVlFN8RAqlnAJ9zv5odKpsIqyb9yyZUO4PTGM9NMQCdG254 eBCzB1FapYvOL+emWDJpI3w=X6yj -----END PGP SIGNATURE----- _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Quoting Ralf Müller <ralf@bj-ig.de>:> Is there a way for a domU to discover size changes of block > devices modified by dom0? > > To make it clear - if I do in dom0 a lvresize of a logical volume given > as physical disk to a domU, is there a way to use the new size > of this device within the domU without reboot? > > Thanks > Ralf >The domU will be aware of the additional space. How you take advantage of that is depending upon the filesystem and more importantly, the OS. For example, ext3 filesystems must be unmounted before you can resize them. You''ll probably need to delete the partition, recreate it, using up all the free space you gave it. That is , unless you use some of the other tools available. I''m talking about using sfdisk, fdisk or parted.. ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Am 19.11.2007 um 17:40 schrieb Jonas Roberto de Goes Filho (sysdebug):> > If you use xfs filesystem in domU, will be possible to resize > filesystem without reboot domU.I do.> Is this your question?Not exactly - when I do resize a volume in dom0 the domU doesn''t notice that so I can''t resize the xfs filesystem until I actually reboot the domU. So my question is: how can I trigger a reread of the block device parameters within the domU without reboot? Thanks Ralf _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Am 19.11.2007 um 17:54 schrieb Errol Neal:> Quoting Ralf Müller <ralf@bj-ig.de>: > >> Is there a way for a domU to discover size changes of block >> devices modified by dom0? > > The domU will be aware of the additional space.Sure?> How you take advantage of that is depending upon the filesystem and > more importantly, the OS. For example, ext3 filesystems must be > unmounted before you can resize them. You''ll probably need to > delete the partition, recreate it, using up all the free space you > gave it. That is , unless you use some of the other tools > available. I''m talking about using sfdisk, fdisk or parted..I use lvm for the block devices in dom0 and most of them I give directly as e.g. xvdc1 to a domU. Within domU the block device is not partitioned anymore (except they are boot devices - but this is another story), but directly formated with xfs. The day before I tested to do "lvresize -L+20G" on a logical volume given to a domU and do a "xfs_growfs" of this volume inside the domU it belongs to. It didn''t notice that until I rebooted the domU. Thatswhy I asked here. Is this a new feature which is not in my Xen 3.1? Regards Ralf _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Am 19.11.2007 um 17:54 schrieb Errol Neal:> Quoting Ralf Müller <ralf@bj-ig.de>: > >> Is there a way for a domU to discover size changes of block >> devices modified by dom0?> The domU will be aware of the additional space.Ok - I did it again :) dom0 > rpm -q xen xen-3.1.0_15042-51 dom0 > lvdisplay /dev/data0/test-xx --- Logical volume --- LV Name /dev/data0/test-xx VG Name data0 LV UUID U8e3ZH-xMFZ-TwUf-qpi1-r5Ee-y07c-PtskZe LV Write Access read/write LV Status available # open 0 LV Size 1.00 GB Current LE 256 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:47 give it to test domU: disk=[ ''phy:/dev/data0/test-hda,xvda,w'', ''phy:/dev/data0/test-swap,xvdb2,w'', ''phy:/dev/data0/test-xx,xvdc1,w'', ] test > mkfs.xfs /dev/xvdc1 test > mount /dev/xvdc1 /mnt/ test > df /mnt/ Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvdc1 1038336 288 1038048 1% /mnt dom0 > lvresize -L+1G /dev/data0/test-xx Extending logical volume test-xx to 2.00 GB Logical volume test-xx successfully resized test > xfs_growfs /mnt/ meta-data=/dev/xvdc1 isize=256 agcount=8, agsize=32768 blks = sectsz=512 attr=0 data = bsize=4096 blocks=262144, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal bsize=4096 blocks=2560, version=1 = sectsz=512 sunit=0 blks, lazy- count=0 realtime =none extsz=4096 blocks=0, rtextents=0 test > df /mnt/ Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvdc1 1038336 288 1038048 1% /mnt The filesystem is still 1GB. What am I doing wrong? Regards Ralf _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Nov 19, 2007 12:42 PM, Ralf Müller <ralf@bj-ig.de> wrote:> > Am 19.11.2007 um 17:54 schrieb Errol Neal: > > > Quoting Ralf Müller <ralf@bj-ig.de>: > > > >> Is there a way for a domU to discover size changes of block > >> devices modified by dom0? > > > The domU will be aware of the additional space. > > Ok - I did it again :) > > dom0 > rpm -q xen > xen-3.1.0_15042-51 > dom0 > lvdisplay /dev/data0/test-xx > --- Logical volume --- > LV Name /dev/data0/test-xx > VG Name data0 > LV UUID U8e3ZH-xMFZ-TwUf-qpi1-r5Ee-y07c-PtskZe > LV Write Access read/write > LV Status available > # open 0 > LV Size 1.00 GB > Current LE 256 > Segments 1 > Allocation inherit > Read ahead sectors 0 > Block device 253:47 > > give it to test domU: > disk=[ ''phy:/dev/data0/test-hda,xvda,w'', > ''phy:/dev/data0/test-swap,xvdb2,w'', > ''phy:/dev/data0/test-xx,xvdc1,w'', > ] > > test > mkfs.xfs /dev/xvdc1 > test > mount /dev/xvdc1 /mnt/ > test > df /mnt/ > Filesystem 1K-blocks Used Available Use% Mounted on > /dev/xvdc1 1038336 288 1038048 1% /mnt > > dom0 > lvresize -L+1G /dev/data0/test-xx > Extending logical volume test-xx to 2.00 GB > Logical volume test-xx successfully resized > > test > xfs_growfs /mnt/ > meta-data=/dev/xvdc1 isize=256 agcount=8, agsize=32768 > blks > = sectsz=512 attr=0 > data = bsize=4096 blocks=262144, imaxpct=25 > = sunit=0 swidth=0 blks, > unwritten=1 > naming =version 2 bsize=4096 > log =internal bsize=4096 blocks=2560, version=1 > = sectsz=512 sunit=0 blks, lazy- > count=0 > realtime =none extsz=4096 blocks=0, rtextents=0 > test > df /mnt/ > Filesystem 1K-blocks Used Available Use% Mounted on > /dev/xvdc1 1038336 288 1038048 1% /mnt > > The filesystem is still 1GB. What am I doing wrong?I am not sure if the feature is available in the version of Xen you are using or not, but the fact that it has been done, see the thread below, means that there is hope, you may just need to upgrade the version and/or apply patches. http://forums.xensource.com/message.jspa?messageID=8404 Also online resizing is also available in ext3, at least that is true for growing of partitions. I hope to look into these type of issues soon and I will report more if I find out more. If you reply back and have questions or comments for me, make sure I am in the CC, as I don''t always have time to follow the list completely. Best Regards, Todd> > Regards > Ralf > _______________________________________________ > 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
2007/11/20, Todd Deshane <deshantm@gmail.com>:> > > > On Nov 19, 2007 12:42 PM, Ralf Müller <ralf@bj-ig.de> wrote: > > > > > > Am 19.11.2007 um 17:54 schrieb Errol Neal: > > > > > > > Quoting Ralf Müller <ralf@bj-ig.de>: > > > > > >> Is there a way for a domU to discover size changes of block > > >> devices modified by dom0?Please, if using lvm, look for a version of the "pvresize" command which, as far as i know is meant to do the trick you need: Make LVM aware of PV size changes. flo -- ''Sie brauchen sich um Ihre Zukunft keine Gedanken zu machen'' _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi Jonas, On Mon, Nov 19, 2007 at 02:40:16PM -0200, Jonas Roberto de Goes Filho (sysdebug) wrote:> Ralf Mller wrote: > | Is there a way for a domU to discover size changes of block > | devices modified by dom0? > | > | To make it clear - if I do in dom0 a lvresize of a logical volume given > | as physical disk to a domU, is there a way to use the new size > | of this device within the domU without reboot? > > If you use xfs filesystem in domU, will be possible to resize > filesystem without reboot domU. Is this your question?Have you actually tried this? In my experience it is not possible. You may be thinking of online resize of filesystems. Yes that is possible in xfs and recent ext3 and others. But that is unrelated to changing the size of a block device exported from dom0 to domU, which is what the original poster''s question refers to. I would be happy to know if this feature has been added. Cheers, Andy _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi Ralf, On Mon, Nov 19, 2007 at 06:23:02PM +0100, Ralf Müller wrote:> The day before I tested to do "lvresize -L+20G" on a logical volume > given to a domU and do a "xfs_growfs" of this volume inside the domU > it belongs to. It didn''t notice that until I rebooted the domU. > Thatswhy I asked here. Is this a new feature which is not in my Xen 3.1?Not that I am aware of. It simply does not work, despite the many people who will claim it does without actually trying it. If it is not the domU''s root fs then you can unmount it in the domU, from dom0 detach the block device, then re-attach the block device again and the domU will see the new size. Obviously not possible if this is the domU''s root fs. Cheers, Andy _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Am 23.11.2007 um 19:40 schrieb Andy Smith:> On Mon, Nov 19, 2007 at 06:23:02PM +0100, Ralf Müller wrote: >> The day before I tested to do "lvresize -L+20G" on a logical volume >> given to a domU and do a "xfs_growfs" of this volume inside the domU >> it belongs to. It didn''t notice that until I rebooted the domU. >> Thatswhy I asked here. Is this a new feature which is not in my >> Xen 3.1? > > Not that I am aware of. It simply does not work, despite the many > people who will claim it does without actually trying it.Thanks for that answer. I felt e bit stupid as the one who isn''t able to this, under all the ones who told me it is no problem at all.> If it is not the domU''s root fs then you can unmount it in the domU, > from dom0 detach the block device, then re-attach the block device > again and the domU will see the new size. Obviously not possible if > this is the domU''s root fs.Uiii - hardcore solution. Near to no way to do this automatically. So I will have to stick with the reboot solution for a while ... Thanks a lot Ralf _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users