i''m trying to find a way to expand a selected partition in my DomU... when in a console in the domU, here are the disks available: [root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 13G 3.5G 8.1G 30% / /dev/xvda1 99M 21M 74M 22% /boot tmpfs 257M 0 257M 0% /dev/shm I''d like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G The domU is based on an image file, ''webs.img'' that resides on a disk in the Dom0. In the dom0, I add space to the webs.img file with the following command: |dd if=/dev/zero bs=1024k count=12288 >> webs.img then, when i create the webs domu, i.e. xm create webs; it starts, and the new space shows up as "unintialized'' space | in the domu. (I see this using vnc to reach the desktop, and open the LVM tool to see the new space). The problem that I''m having is to ''attach'' the unintialized space in the domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand the LogVol00 disk to take advantage of the space. I''m running Centos5 on the dom0, and in the domU. Xen is version 3. Any suggestions? if so, can you please be explicit as to _where_ to run the various commands, in the Dom0 or DomU? At this point, I''m pretty confused about what to do where.... Thanks! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
i''m trying to find a way to expand a selected partition in my DomU... when in a console in the domU, here are the disks available: [root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 13G 3.5G 8.1G 30% / /dev/xvda1 99M 21M 74M 22% /boot tmpfs 257M 0 257M 0% /dev/shm I''d like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G The domU is based on an image file, ''webs.img'' that resides on a disk in the Dom0. In the dom0, I add space to the webs.img file with the following command: |dd if=/dev/zero bs=1024k count=12288 >> webs.img then, when i create the webs domu, i.e. xm create webs; it starts, and the new space shows up as "unintialized'' space | in the domu. (I see this using vnc to reach the desktop, and open the LVM tool to see the new space). The problem that I''m having is to ''attach'' the unintialized space in the domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand the LogVol00 disk to take advantage of the space. I''m running Centos5 on the dom0, and in the domU. Xen is version 3. Any suggestions? if so, can you please be explicit as to _where_ to run the various commands, in the Dom0 or DomU? At this point, I''m pretty confused about what to do where.... Thanks! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
The "webs.img" file is a LVM partition, which primarily resides in /dev/mapper and then you decided to mount it ? De: "Dan Waterloo" <dan.waterloo@gmail.com> Para: xen-users@lists.xensource.com Enviados: Lunes, 26 de Abril 2010 15:36:02 Asunto: [Xen-users] how to expand disk inside of domU? i''m trying to find a way to expand a selected partition in my DomU... when in a console in the domU, here are the disks available: [root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 13G 3.5G 8.1G 30% / /dev/xvda1 99M 21M 74M 22% /boot tmpfs 257M 0 257M 0% /dev/shm I''d like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G The domU is based on an image file, ''webs.img'' that resides on a disk in the Dom0. In the dom0, I add space to the webs.img file with the following command: dd if=/dev/zero bs=1024k count=12288 >> webs.img then, when i create the webs domu, i.e. xm create webs; it starts, and the new space shows up as "unintialized'' space in the domu. (I see this using vnc to reach the desktop, and open the LVM tool to see the new space). The problem that I''m having is to ''attach'' the unintialized space in the domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand the LogVol00 disk to take advantage of the space. I''m running Centos5 on the dom0, and in the domU. Xen is version 3. Any suggestions? if so, can you please be explicit as to _where_ to run the various commands, in the Dom0 or DomU? At this point, I''m pretty confused about what to do where.... 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
Rubén Marrero wrote:> > The "webs.img" file is a LVM partition, which primarily resides in > /dev/mapper and then you decided to mount it ? > > > ------------------------------------------------------------------------ > *De: *"Dan Waterloo" <dan.waterloo@gmail.com> > *Para: *xen-users@lists.xensource.com > *Enviados: *Lunes, 26 de Abril 2010 15:36:02 > *Asunto: *[Xen-users] how to expand disk inside of domU? > > i''m trying to find a way to expand a selected partition in my DomU... > > when in a console in the domU, here are the disks available: > > [root@localhost ~]# df -h > Filesystem Size Used Avail Use% Mounted on > /dev/mapper/VolGroup00-LogVol00 > 13G 3.5G 8.1G 30% / > /dev/xvda1 99M 21M 74M 22% /boot > tmpfs 257M 0 257M 0% /dev/shm > > I''d like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G > > The domU is based on an image file, ''webs.img'' that resides on a disk > in the Dom0. > In the dom0, I add space to the webs.img file with the following command: > |dd if=/dev/zero bs=1024k count=12288 >> webs.img > > then, when i create the webs domu, i.e. xm create webs; > it starts, and the new space shows up as "unintialized'' space | > in the domu. (I see this using vnc to reach the desktop, and > open the LVM tool to see the new space). > > The problem that I''m having is to ''attach'' the unintialized space in the > domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand the > LogVol00 disk to take advantage of the space. > > I''m running Centos5 on the dom0, and in the domU. Xen is version 3. > > Any suggestions? if so, can you please be explicit as to _where_ to run the various > commands, in the Dom0 or DomU? At this point, I''m pretty confused about > what to do where.... > > 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-usersNo, the webs.img file exists in the dom0, and is located at: /mnt/iscsi/webs.img which is on an iscsi drive... I haven''t mounted webs.img, the domU ''webs'' uses that file as it''s hard drive(s). _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Mon, 2010-04-26 at 15:36 -0500, Dan Waterloo wrote:> i'm trying to find a way to expand a selected partition in my DomU... > > when in a console in the domU, here are the disks available: > > [root@localhost ~]# df -h > Filesystem Size Used Avail Use% Mounted on > /dev/mapper/VolGroup00-LogVol00 > 13G 3.5G 8.1G 30% / > /dev/xvda1 99M 21M 74M 22% /boot > tmpfs 257M 0 257M 0% /dev/shm > > I'd like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G > > The domU is based on an image file, 'webs.img' that resides on a disk > in the Dom0. > In the dom0, I add space to the webs.img file with the following > command: > dd if=/dev/zero bs=1024k count=12288 >> webs.img > > then, when i create the webs domu, i.e. xm create webs; > it starts, and the new space shows up as "unintialized' space > in the domu. (I see this using vnc to reach the desktop, and > open the LVM tool to see the new space). > > The problem that I'm having is to 'attach' the unintialized space in the > domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand the > LogVol00 disk to take advantage of the space. > > I'm running Centos5 on the dom0, and in the domU. Xen is version 3. > > Any suggestions? if so, can you please be explicit as to _where_ to run the various > commands, in the Dom0 or DomU? At this point, I'm pretty confused about > what to do where.... > > Thanks! >So to sum it up - your DomU hdd is file based. This virtual disk is "LVMed" in the DomU. You resized the virtual disk in the Dom0 and now want to utilize this space into the domu using the LVM. My guess is, you need to allocate the non-utilized new space to the main LVM volume group. This volume group is made of actual physical volumes. So this point me to pvresize, which can be used to extend existing physical volume after extending the partition via fdisk. LVMs inside DomU can be pain in the *** sometimes, but it should be just few more commands. Rough walk-thru (smaller steps are missing - man and google are good friends): 0. back up your data 01. back up your data 02. well, do it, really! 1. shut down DomU 2. mount the virtual disk img file in the Dom0 3. expand the partition with fdisk 4. expand the physical volume with pvresize 5. expand the filesystem with apropriate command for your filesystem (e.g. resize2fs) another solution could be using liveCD with some linux distribution with LVM tools and boot it from virtual cdrom (iso image) in hvm VM setting and do these steps "inside" the DomU. Someone correct me please if this is dumb solution. :) Regards matej _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Matej Zary
2010-Apr-26 22:32 UTC
Re: Re: Re: [Xen-users] how to expand disk inside of domU?
On Tue, 2010-04-27 at 00:04 +0200, Matej Zary wrote:> On Mon, 2010-04-26 at 15:36 -0500, Dan Waterloo wrote: > > i'm trying to find a way to expand a selected partition in my > DomU... > > > > when in a console in the domU, here are the disks available: > > > > [root@localhost ~]# df -h > > Filesystem Size Used Avail Use% Mounted on > > /dev/mapper/VolGroup00-LogVol00 > > 13G 3.5G 8.1G 30% / > > /dev/xvda1 99M 21M 74M 22% /boot > > tmpfs 257M 0 257M 0% /dev/shm > > > > I'd like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G > > > > The domU is based on an image file, 'webs.img' that resides on a > disk > > in the Dom0. > > In the dom0, I add space to the webs.img file with the following > > command: > > dd if=/dev/zero bs=1024k count=12288 >> webs.img > > > > then, when i create the webs domu, i.e. xm create webs; > > it starts, and the new space shows up as "unintialized' space > > in the domu. (I see this using vnc to reach the desktop, and > > open the LVM tool to see the new space). > > > > The problem that I'm having is to 'attach' the unintialized space in > the > > domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand > the > > LogVol00 disk to take advantage of the space. > > > > I'm running Centos5 on the dom0, and in the domU. Xen is version 3. > > > > Any suggestions? if so, can you please be explicit as to _where_ to > run the various > > commands, in the Dom0 or DomU? At this point, I'm pretty confused > about > > what to do where.... > > > > Thanks! > > > > So to sum it up - your DomU hdd is file based. This virtual disk is > "LVMed" in the DomU. You resized the virtual disk in the Dom0 and now > want to utilize this space into the domu using the LVM. > > My guess is, you need to allocate the non-utilized new space to the > main > LVM volume group. This volume group is made of actual physical > volumes. > So this point me to pvresize, which can be used to extend existing > physical volume after extending the partition via fdisk. > > LVMs inside DomU can be pain in the *** sometimes, but it should be > just > few more commands. > > Rough walk-thru (smaller steps are missing - man and google are good > friends): > > 0. back up your data > 01. back up your data > 02. well, do it, really! > 1. shut down DomU > 2. mount the virtual disk img file in the Dom0 > 3. expand the partition with fdisk > 4. expand the physical volume with pvresize4.5 ensure that volume group expanded too (vgscan?) 4.6 expand the logical volume with lvresize> 5. expand the filesystem with apropriate command for your filesystem > (e.g. resize2fs) > > another solution could be using liveCD with some linux distribution > with > LVM tools and boot it from virtual cdrom (iso image) in hvm VM setting > and do these steps "inside" the DomU. > > > Someone correct me please if this is dumb solution. :) > > Regards > > matej > >forgot few things... Matej _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
You will need to extend your lv and then expand the underlying filesystem. lvextend and resize2fs will be the tools you will want to use. With an img file I am not sure of the exact steps, but it can''t be too hard. You will need to do this with the domu stopped. -- Donny B. On Monday, April 26, 2010 09:12 AM CDT, Dan Waterloo <dan@i-t.com> wrote:> i''m trying to find a way to expand a selected partition in my DomU... > > when in a console in the domU, here are the disks available: > > [root@localhost ~]# df -h > Filesystem Size Used Avail Use% Mounted on > /dev/mapper/VolGroup00-LogVol00 > 13G 3.5G 8.1G 30% / > /dev/xvda1 99M 21M 74M 22% /boot > tmpfs 257M 0 257M 0% /dev/shm > > I''d like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G > > The domU is based on an image file, ''webs.img'' that resides on a disk in > the Dom0. > In the dom0, I add space to the webs.img file with the following command: > > |dd if=/dev/zero bs=1024k count=12288 >> webs.img > > then, when i create the webs domu, i.e. xm create webs; > it starts, and the new space shows up as "unintialized'' space | > in the domu. (I see this using vnc to reach the desktop, and > open the LVM tool to see the new space). > > The problem that I''m having is to ''attach'' the unintialized space in the > domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand the > LogVol00 disk to take advantage of the space. > > I''m running Centos5 on the dom0, and in the domU. Xen is version 3. > > Any suggestions? if so, can you please be explicit as to _where_ to run the various > commands, in the Dom0 or DomU? At this point, I''m pretty confused about > what to do where.... > > Thanks! > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Sounds more like he will need resize the physical volume in the DomU first - pvresize (to initialize the new added space in his volume group). (this could be done also in Dom0 with DomU in shut down state). Regards Matej ________________________________________ From: xen-users-bounces@lists.xensource.com [xen-users-bounces@lists.xensource.com] On Behalf Of Donny Brooks [dbrooks@mdah.state.ms.us] Sent: 04 May 2010 15:54 To: xen-users@lists.xensource.com Subject: Re: [Xen-users] how to expand disk inside of domU? You will need to extend your lv and then expand the underlying filesystem. lvextend and resize2fs will be the tools you will want to use. With an img file I am not sure of the exact steps, but it can''t be too hard. You will need to do this with the domu stopped. -- Donny B. On Monday, April 26, 2010 09:12 AM CDT, Dan Waterloo <dan@i-t.com> wrote:> i''m trying to find a way to expand a selected partition in my DomU... > > when in a console in the domU, here are the disks available: > > [root@localhost ~]# df -h > Filesystem Size Used Avail Use% Mounted on > /dev/mapper/VolGroup00-LogVol00 > 13G 3.5G 8.1G 30% / > /dev/xvda1 99M 21M 74M 22% /boot > tmpfs 257M 0 257M 0% /dev/shm > > I''d like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G > > The domU is based on an image file, ''webs.img'' that resides on a disk in > the Dom0. > In the dom0, I add space to the webs.img file with the following command: > > |dd if=/dev/zero bs=1024k count=12288 >> webs.img > > then, when i create the webs domu, i.e. xm create webs; > it starts, and the new space shows up as "unintialized'' space | > in the domu. (I see this using vnc to reach the desktop, and > open the LVM tool to see the new space). > > The problem that I''m having is to ''attach'' the unintialized space in the > domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand the > LogVol00 disk to take advantage of the space. > > I''m running Centos5 on the dom0, and in the domU. Xen is version 3. > > Any suggestions? if so, can you please be explicit as to _where_ to run the various > commands, in the Dom0 or DomU? At this point, I''m pretty confused about > what to do where.... > > 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
On Mon, Apr 26, 2010 at 9:12 PM, Dan Waterloo <dan@i-t.com> wrote:> i''m trying to find a way to expand a selected partition in my DomU... > > when in a console in the domU, here are the disks available: > > [root@localhost ~]# df -h > Filesystem Size Used Avail Use% Mounted on > /dev/mapper/VolGroup00-LogVol00 > 13G 3.5G 8.1G 30% / > /dev/xvda1 99M 21M 74M 22% /boot > tmpfs 257M 0 257M 0% /dev/shm > > I''d like to expand the /dev/mapper/VolGroup00-LogVol00 disk to 25G > > The domU is based on an image file, ''webs.img'' that resides on a disk in the > Dom0. > In the dom0, I add space to the webs.img file with the following command: > > dd if=/dev/zero bs=1024k count=12288 >> webs.imgThat command is highly useful when use file images directly as partition. However, when using LVM on domU, that''s not the recommended way to increase domU''s storage (at least according to RedHat). It''s much easier to just add new disk to domU, and use pvcreate+vgextend+lvresize+resize2fs.> > then, when i create the webs domu, i.e. xm create webs; > it starts, and the new space shows up as "unintialized'' space > in the domu. (I see this using vnc to reach the desktop, and > open the LVM tool to see the new space). > > The problem that I''m having is to ''attach'' the unintialized space in the > domU to the /dev/mapper/VolGroup00-LogVol00 disk, and then to expand the > LogVol00 disk to take advantage of the space. > > I''m running Centos5 on the dom0, and in the domU. Xen is version 3. > > Any suggestions? if so, can you please be explicit as to _where_ to run the > various > commands, in the Dom0 or DomU? At this point, I''m pretty confused about > what to do where....all on domU, try: - adjust domU''s partition (e.g. using fdisk), so the partition containing the PV (should be xvda2 on your setup) uses all available disk space. A domU reboot afterwards might be necessary. BE CAREFUL though, this could potentially be dangerous if you accidently mess up existing partition table. - run pvresize to get LVM recognize the extra space - run lvresize+resize2fs -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users