Hi all, I have created a DomU guest based on the following method :- 1) I create a LV with size 6GB : lvcreate -L 6G 2) I setup a new guest DomU with /dev/VolGroup00/vm1 as disk device 3) In DomU, I use /dev/hda as device to create partition for /boot, /, and swap without using LVM fdisk -l /dev/hda Disk /dev/hda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 521 4080510 83 Linux /dev/hda3 522 782 2096482+ 82 Linux swap / Solaris 4) I am now resize the /dev/VolGroup00/vm1 device to 10G in Dom0 lvextend -L 10g dev/VolGroup00/vm1 How can DomU to recongnize the new disk space? Thanks! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi, Shutdown DomU e2fsck -f /dev/VolGroup00/vm1 resize2fs /dev/VolGroup00/vm1 fsck -n /dev/VolGroup00/vm1 boot DomU and that should do it. Resize2fs should automatically use all available space, if not you will need to add the parameter. Ian -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of KC LO Sent: 01 March 2010 22:17 To: xen-users@lists.xensource.com Subject: [Xen-users] Resize DomU partition Hi all, I have created a DomU guest based on the following method :- 1) I create a LV with size 6GB : lvcreate -L 6G 2) I setup a new guest DomU with /dev/VolGroup00/vm1 as disk device 3) In DomU, I use /dev/hda as device to create partition for /boot, /, and swap without using LVM fdisk -l /dev/hda Disk /dev/hda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 521 4080510 83 Linux /dev/hda3 522 782 2096482+ 82 Linux swap / Solaris 4) I am now resize the /dev/VolGroup00/vm1 device to 10G in Dom0 lvextend -L 10g dev/VolGroup00/vm1 How can DomU to recongnize the new disk space? Thanks! _______________________________________________ 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
Ian Tobin wrote:>Shutdown DomU > >e2fsck -f /dev/VolGroup00/vm1 >resize2fs /dev/VolGroup00/vm1 >fsck -n /dev/VolGroup00/vm1 > > >boot DomU and that should do it. Resize2fs should automatically use all >available space, if not you will need to add the parameter.No, the OP has partitioned the virtual volume within the DomU. IIRC there is a way to mount the device so as to be visible to the Dom0 as a block device (but I can''t recall the command name), after which it''s possible to work with the partitions within it. SInce it''s been done without LVM, only the last partition on the disk can be resized in place - to resize anything else will mean copying the files elsewhere, repartitioning the device, making new filesystems, and copying the files back. Alternatively, temporarily add the device to another DomU to work with it - slightly safer as there''s less risk of working with the wrong block device and breaking Dom0 ! -- Simon Hobson WANTED: "Software CD ROM Kit" for Canon CLBP 360-PS printer (Canon part no RH6-3612, or possibly RH6-3810, or RH6-3610 might do). I''ve a dead HD and need this CD so I can replace the disk and re-install the printer OS on it. If anyone knows where I might get hold of one I''d be grateful - requests to Canon drew a blank, it''s been out of support for years. Alternatively, if anyone has one of these and would let me image their hard disk ... Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, Mar 2, 2010 at 5:17 PM, Simon Hobson <linux@thehobsons.co.uk> wrote:> IIRC there is a way to mount the device so as to be visible to the Dom0 as a > block device (but I can''t recall the command name), after which it''s > possible to work with the partitions within it.xm block-attach 0 ... either way, domU needs to be restarted to recognize the new block device size. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi , Thanks for your reply! However, I got the following errors on the first command e2fsck 1.39 (29-May-2006) Couldn''t find ext2 superblock, trying backup blocks... e2fsck: Bad magic number in super-block while trying to open /dev/VolGroup00/vm3 The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> I guess that the file system is ext3 which got this problem. Any hints? On 2 March 2010 06:25, Ian Tobin <itobin@tidyhosts.com> wrote:> Hi, > > Shutdown DomU > > e2fsck -f /dev/VolGroup00/vm1 > resize2fs /dev/VolGroup00/vm1 > fsck -n /dev/VolGroup00/vm1 > > > boot DomU and that should do it. Resize2fs should automatically use all > available space, if not you will need to add the parameter. > > Ian > > > > > -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of KC LO > Sent: 01 March 2010 22:17 > To: xen-users@lists.xensource.com > Subject: [Xen-users] Resize DomU partition > > Hi all, > > I have created a DomU guest based on the following method :- > 1) I create a LV with size 6GB : lvcreate -L 6G > 2) I setup a new guest DomU with /dev/VolGroup00/vm1 as disk device > 3) In DomU, I use /dev/hda as device to create partition for /boot, /, > and swap without using LVM > fdisk -l /dev/hda > > Disk /dev/hda: 10.7 GB, 10737418240 bytes > 255 heads, 63 sectors/track, 1305 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Device Boot Start End Blocks Id System > /dev/hda1 * 1 13 104391 83 Linux > /dev/hda2 14 521 4080510 83 Linux > /dev/hda3 522 782 2096482+ 82 Linux swap / > Solaris > > 4) I am now resize the /dev/VolGroup00/vm1 device to 10G in Dom0 > lvextend -L 10g dev/VolGroup00/vm1 > > How can DomU to recongnize the new disk space? > > Thanks! > > _______________________________________________ > 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
KC LO wrote:>Thanks for your reply! >However, I got the following errors on the first command > >e2fsck 1.39 (29-May-2006) >Couldn''t find ext2 superblock, trying backup blocks... >e2fsck: Bad magic number in super-block while trying to open >/dev/VolGroup00/vm3 > >The superblock could not be read or does not describe a correct ext2 >filesystem. If the device is valid and it really contains an ext2 >filesystem (and not swap or ufs or something else), then the superblock >is corrupt, and you might try running e2fsck with an alternate superblock: > e2fsck -b 8193 <device> > >I guess that the file system is ext3 which got this problem. Any hints?The command isn''t appropriate for your setup. /dev/VolGroup00/vm3 does not contain a single filesystem, it has been partitioned in your DomU. Just FYI - Ext3 and Ext2 are essentially the same filesystem and most of the tools are the same - Ext3 just adds journalling. You need to connect the block device to your Dom0, Fajar gives the command as "xm block-attach 0 ...". As I read the man page, I think the command would be "xm block-attach 0 /dev/VolGroup00/vm3 /dev/hde W" to connect it as device hde. Once you''ve attached it, then you can work with the partitions in it - eg "fsck /dev/hde1" to check the filesystem in the first partition. I''m not sure if any of the common partitioners are capable of relocating a partition, but for the standard fdisk you''ll need to mount the filesystems, copy the files elsewhere, then use fdisk to delete the partitions and create new ones of the size you want (this WILL destroy all the data in them), create new filesystems and mount them, and copy the file back again. There''s a lot to be said for using LVM and creating an lv per filesystem. With that setup, you can resize a filesystem by : - shutdown the DomU - fsck -f <lv path> - resize2fs <lv path> - startup DomU -- Simon Hobson WANTED: "Software CD ROM Kit" for Canon CLBP 360-PS printer (Canon part no RH6-3612, or possibly RH6-3810, or RH6-3610 might do). I''ve a dead HD and need this CD so I can replace the disk and re-install the printer OS on it. This is NOT the same thing as the printer drivers to load on the computer - there''s no problem there. If anyone knows where I might get hold of one I''d be grateful - requests to Canon drew a blank, it''s been out of support for years. Alternatively, if anyone has one of these and would let me image their hard disk ... Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users