Hi,
I have two guest vm instance running CentOS 5 with ext3 partition. I will like to reduce 1 VM harddisk space and using the 'release' harddisk space to add onto my second VM. Basically I need to know how can I reduce and increase an ext3 partition in CentOS KVM. I did a search and basically i can do it by booting the VM using Knoppix and use Gparted to reduce and increase the diskspace. I am thinking of the following
1) Boot first VM using Knoppix 2) Reduce the ext3 partition disk size using Gparted 3) Shutdown the VM and resize the diskspace using Virtual Manager 4) Increae the diskspace of the second VM using Virtual Manager 5) Boot up second VM using Knoppix 6) Increase the ext3 partition disk size using Gparted 7) Reboot the second VM
As this is the first time i am doing it, will these work? Anyone has experience resiziing their EXT3 partition in KVM environment before?
Thanks!
Regards yongsan
Yes, it will, works all the time with me but using SysrescueCD. But don't forget to backup your data before the resizing, any operation with disk partitions may lost data.
2011/1/26 Poh Yong Hwang yongsan@gmail.com
Hi,
I have two guest vm instance running CentOS 5 with ext3 partition. I will like to reduce 1 VM harddisk space and using the 'release' harddisk space to add onto my second VM. Basically I need to know how can I reduce and increase an ext3 partition in CentOS KVM. I did a search and basically i can do it by booting the VM using Knoppix and use Gparted to reduce and increase the diskspace. I am thinking of the following
- Boot first VM using Knoppix
- Reduce the ext3 partition disk size using Gparted
- Shutdown the VM and resize the diskspace using Virtual Manager
- Increae the diskspace of the second VM using Virtual Manager
- Boot up second VM using Knoppix
- Increase the ext3 partition disk size using Gparted
- Reboot the second VM
As this is the first time i am doing it, will these work? Anyone has experience resiziing their EXT3 partition in KVM environment before?
Thanks!
Regards yongsan
CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
Poh Yong Hwang ha scritto:
Hi,
I have two guest vm instance running CentOS 5 with ext3 partition. I will like to reduce 1 VM harddisk space and using the 'release' harddisk space to add onto my second VM. Basically I need to know how can I reduce and increase an ext3 partition in CentOS KVM. I did a search and basically i can do it by booting the VM using Knoppix and use Gparted to reduce and increase the diskspace. I am thinking of the following
- Boot first VM using Knoppix
- Reduce the ext3 partition disk size using Gparted
- Shutdown the VM and resize the diskspace using Virtual Manager
- Increae the diskspace of the second VM using Virtual Manager
- Boot up second VM using Knoppix
- Increase the ext3 partition disk size using Gparted
- Reboot the second VM
As this is the first time i am doing it, will these work? Anyone has experience resiziing their EXT3 partition in KVM environment before?
Thanks!
Regards yongsan
I guess it would work, but just in case remember: do backup beforehand :D
Regards Lorenzo
Hi,
Great! Thanks for the quick response. I will try it out then. Yes. I do have backup for the host as well as the guest nodes. :)
Regards yongsan
On Wed, Jan 26, 2011 at 6:43 PM, Lorenzo Quatrini < lorenzo.quatrini@gmail.com> wrote:
Poh Yong Hwang ha scritto:
Hi,
I have two guest vm instance running CentOS 5 with ext3 partition. I will like to reduce 1 VM harddisk space and using the 'release' harddisk space to add onto my second VM. Basically I need to know how can I reduce and increase an ext3 partition in CentOS KVM. I did a search and basically i can do it by booting the VM using Knoppix and use Gparted to reduce and increase the diskspace. I am thinking of the following
- Boot first VM using Knoppix
- Reduce the ext3 partition disk size using Gparted
- Shutdown the VM and resize the diskspace using Virtual Manager
- Increae the diskspace of the second VM using Virtual Manager
- Boot up second VM using Knoppix
- Increase the ext3 partition disk size using Gparted
- Reboot the second VM
As this is the first time i am doing it, will these work? Anyone has experience resiziing their EXT3 partition in KVM environment before?
Thanks!
Regards yongsan
I guess it would work, but just in case remember: do backup beforehand :D
Regards Lorenzo _______________________________________________ CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
Hi,
I have an issue. I have already resize the partition using Gparted. Now how can i resize the actual image size in virtual manager? I do not see any option for me to change the size of the allocated hard disk.
Please advise.
Thanks!
On Wed, Jan 26, 2011 at 6:54 PM, Poh Yong Hwang yongsan@gmail.com wrote:
Hi,
Great! Thanks for the quick response. I will try it out then. Yes. I do have backup for the host as well as the guest nodes. :)
Regards yongsan
On Wed, Jan 26, 2011 at 6:43 PM, Lorenzo Quatrini < lorenzo.quatrini@gmail.com> wrote:
Poh Yong Hwang ha scritto:
Hi,
I have two guest vm instance running CentOS 5 with ext3 partition. I will like to reduce 1 VM harddisk space and using the 'release' harddisk space to add onto my second VM. Basically I need to know how can I reduce and increase an ext3 partition in CentOS KVM. I did a search and basically i can do it by booting the VM using Knoppix and use Gparted to reduce and increase the diskspace. I am thinking of the following
- Boot first VM using Knoppix
- Reduce the ext3 partition disk size using Gparted
- Shutdown the VM and resize the diskspace using Virtual Manager
- Increae the diskspace of the second VM using Virtual Manager
- Boot up second VM using Knoppix
- Increase the ext3 partition disk size using Gparted
- Reboot the second VM
As this is the first time i am doing it, will these work? Anyone has experience resiziing their EXT3 partition in KVM environment before?
Thanks!
Regards yongsan
I guess it would work, but just in case remember: do backup beforehand :D
Regards Lorenzo _______________________________________________ CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
2011/2/6 Poh Yong Hwang yongsan@gmail.com:
Hi, I have an issue. I have already resize the partition using Gparted. Now how can i resize the actual image size in virtual manager? I do not see any option for me to change the size of the allocated hard disk.
You're probably looking for the resize feature of the qemu-img command, I'm fairly sure that virt-manager doesn't do resizing: man qemu-img
Best regards Kenni
Well, I can tell you how I do it. Might help.
1) create a new storage volume of the size you want with Virtual Manager. (Host details>Storage tab)
2) shut down the VM and add the new volume to the VM ( it now has two virtual drives - the original and the new)
3) boot with clonezilla, clone one drive to the other. Then boot gparted and resize as needed
4) delete both drives from the vm, and then add back the new volume. Boot.
5) keep the old, smaller volume around for a while as backup.
When you add a volume, Virtual Manager assigns a device name to it: hda to the first drive, hdb to the second, ect.
So, you have to delete them both to get Virtual Manager to assign hda to the new one, otherwise the OS will not be able to boot.
Hi,
Thanks but my issue is i do not have enough diskspace to create another partition of the size that i needed. Is there a way for me to reduce the actual image size?
Thanks!
On Mon, Feb 7, 2011 at 3:09 AM, compdoc compdoc@hotrodpc.com wrote:
Well, I can tell you how I do it. Might help…
- create a new storage volume of the size you want with Virtual Manager.
(Host details>Storage tab)
- shut down the VM and add the new volume to the VM ( it now has two
virtual drives - the original and the new)
- boot with clonezilla, clone one drive to the other. Then boot gparted
and resize as needed
delete both drives from the vm, and then add back the new volume. Boot.
keep the old, smaller volume around for a while as backup.
When you add a volume, Virtual Manager assigns a device name to it: hda to the first drive, hdb to the second, ect.
So, you have to delete them both to get Virtual Manager to assign hda to the new one, otherwise the OS will not be able to boot.
CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
2011/2/6 Poh Yong Hwang yongsan@gmail.com:
Hi, Thanks but my issue is i do not have enough diskspace to create another partition of the size that i needed. Is there a way for me to reduce the actual image size?
Yes, like I wrote 10 minutes ago: qemu-img resize
Best regards Kenni
Hi Kenni,
Sorry i might have miss it but if i do a man of qemu-img, i do not see resize option. I only see create, convert, commit and info.
Thanks
On Mon, Feb 7, 2011 at 3:18 AM, Kenni Lund kenni@kelu.dk wrote:
2011/2/6 Poh Yong Hwang yongsan@gmail.com:
Hi, Thanks but my issue is i do not have enough diskspace to create another partition of the size that i needed. Is there a way for me to reduce the actual image size?
Yes, like I wrote 10 minutes ago: qemu-img resize
Best regards Kenni _______________________________________________ CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
2011/2/6 Poh Yong Hwang yongsan@gmail.com:
Hi Kenni, Sorry i might have miss it but if i do a man of qemu-img, i do not see resize option. I only see create, convert, commit and info.
Ohh, I'm sorry then :( Guess the qemu-img version in CentOS 5 just is too old...
qemu-img *is* the tool you want, nevertheless...you might want to use another system with a newer version of qemu-img to do the resizing or manually compiling a newer version of qemu-kvm on your current system (to avoid conflicts with the installed qemu-kvm version). Otherwise you'll have to use another approach, like the one compdoc proposed.
Best regards Kenni
You can't add a drive temporarily and have Virtual Manager create the new volume there? I would think even a USB stick would work...
I am coming into this discussion a little late, so apologies if I ask for any information previously provided.
I can help you with this, but I'll need to know the domU's file system layout to do so. Can you send the output of the following commands? * fdisk -l * mount * df -h
And if you're using LVM: * vgdisplay * lvdisplay
~ Tom (Sent from my mobile.)
On Feb 6, 2011, at 12:25, Poh Yong Hwang yongsan@gmail.com wrote:
Hi Kenni,
Sorry i might have miss it but if i do a man of qemu-img, i do not see resize option. I only see create, convert, commit and info.
Thanks
On Mon, Feb 7, 2011 at 3:18 AM, Kenni Lund kenni@kelu.dk wrote: 2011/2/6 Poh Yong Hwang yongsan@gmail.com:
Hi, Thanks but my issue is i do not have enough diskspace to create another partition of the size that i needed. Is there a way for me to reduce the actual image size?
Yes, like I wrote 10 minutes ago: qemu-img resize
Best regards Kenni _______________________________________________ CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
2011/2/6 Thomas Smith theitsmith@gmail.com:
I am coming into this discussion a little late, so apologies if I ask for any information previously provided. I can help you with this, but I'll need to know the domU's file system layout to do so. Can you send the output of the following commands?
- fdisk -l
- mount
- df -h
And if you're using LVM:
- vgdisplay
- lvdisplay
KVM not Xen according to original post - and the partition in the guest has already been resized with gparted, so no reason to perform any more actions within the guest - only thing missing is to resize the qemu image on the host (I assume the OP is using regular file-based images in virt-manager as nothing has been mentioned about this, eg. not iSCSI, NFS, LVM, etc.).
Best regards Kenni
I see. So we are looking to decrease the size, not increase it. (I also assumed we were talking about a disk image.)
OP, what are you using as the backing storage device? That is, are you using a disk image or a block device?
If you are using a disk image, what format is the image? QCOW2? RAW? Something else? * Use "qemu-img info disk.img" to determine this. Execute this command on the host.
If you are using a block device, knowledge of your file system structure (on the host) will be necessary.
On Sun, Feb 6, 2011 at 1:14 PM, Kenni Lund kenni@kelu.dk wrote:
2011/2/6 Thomas Smith theitsmith@gmail.com:
I am coming into this discussion a little late, so apologies if I ask for any information previously provided. I can help you with this, but I'll need to know the domU's file system layout to do so. Can you send the output of the following commands?
- fdisk -l
- mount
- df -h
And if you're using LVM:
- vgdisplay
- lvdisplay
KVM not Xen according to original post - and the partition in the guest has already been resized with gparted, so no reason to perform any more actions within the guest - only thing missing is to resize the qemu image on the host (I assume the OP is using regular file-based images in virt-manager as nothing has been mentioned about this, eg. not iSCSI, NFS, LVM, etc.).
Best regards Kenni _______________________________________________ CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
Hi,
Apologies for the late reply. Here is the result of the command:
qemu-img info staging.img image: staging.img file format: raw virtual size: 195G (209715200000 bytes) disk size: 196G
Yes. I am looking to reduce this size to 100G.
Thanks!
On Mon, Feb 7, 2011 at 7:35 AM, Thomas Smith theitsmith@gmail.com wrote:
I see. So we are looking to decrease the size, not increase it. (I also assumed we were talking about a disk image.)
OP, what are you using as the backing storage device? That is, are you using a disk image or a block device?
If you are using a disk image, what format is the image? QCOW2? RAW? Something else?
- Use "qemu-img info disk.img" to determine this. Execute this command on
the host.
If you are using a block device, knowledge of your file system structure (on the host) will be necessary.
On Sun, Feb 6, 2011 at 1:14 PM, Kenni Lund kenni@kelu.dk wrote:
2011/2/6 Thomas Smith theitsmith@gmail.com:
I am coming into this discussion a little late, so apologies if I ask
for
any information previously provided. I can help you with this, but I'll need to know the domU's file system layout to do so. Can you send the output of the following commands?
- fdisk -l
- mount
- df -h
And if you're using LVM:
- vgdisplay
- lvdisplay
KVM not Xen according to original post - and the partition in the guest has already been resized with gparted, so no reason to perform any more actions within the guest - only thing missing is to resize the qemu image on the host (I assume the OP is using regular file-based images in virt-manager as nothing has been mentioned about this, eg. not iSCSI, NFS, LVM, etc.).
Best regards Kenni _______________________________________________ CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
-- Thomas Smith Cell: 602-882-2917
CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
On Sun, Feb 6, 2011 at 8:02 PM, Poh Yong Hwang yongsan@gmail.com wrote:
Hi,
Apologies for the late reply. Here is the result of the command:
qemu-img info staging.img image: staging.img file format: raw virtual size: 195G (209715200000 bytes) disk size: 196G
Yes. I am looking to reduce this size to 100G.
Hi Poh,
Sorry for the delayed reply...
The first thing you'll need for this is _at least_ 100G of free disk space. (100G should be sufficient, but it's generally a good idea to have a little more than necessary just to be on the safe side.)
I will also still need to see the guest file system layout, if you wouldn't mind sending that info please. (If you are using LVM within the guest *and* on the host, please also send the name of the volume group that the host uses.)
Having the file system information will allow me to provide you with information that is specific to your configuration.
~ Tom
Hi,
Sorry to bring this up again. Now i am trying the clonezilla method to downsize one of my VM. I have created a smaller storage volume and added to the VM. I boot up wih clonezilla but have issue cloning the drive over. Should I use Disk-Image or Device-Device?
Please advise.
Thanks!
Yongsan
On Mon, Feb 7, 2011 at 3:09 AM, compdoc compdoc@hotrodpc.com wrote:
Well, I can tell you how I do it. Might help…
- create a new storage volume of the size you want with Virtual Manager.
(Host details>Storage tab)
- shut down the VM and add the new volume to the VM ( it now has two
virtual drives - the original and the new)
- boot with clonezilla, clone one drive to the other. Then boot gparted
and resize as needed
delete both drives from the vm, and then add back the new volume. Boot.
keep the old, smaller volume around for a while as backup.
When you add a volume, Virtual Manager assigns a device name to it: hda to the first drive, hdb to the second, ect.
So, you have to delete them both to get Virtual Manager to assign hda to the new one, otherwise the OS will not be able to boot.
CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt
Sorry to bring this up again. Now i am trying
the clonezilla method to downsize one of my
VM. I have created a smaller storage volume
and added to the VM. I boot up wih clonezilla
but have issue cloning the drive over. Should
I use Disk-Image or Device-Device?
To make it smaller, you need to resize your partition(s) first with gparted, and then use device-device if you have both 'drives' mounted. This clones the drive.
Use Disk-Image only if you want to store a copy of the drive to local or remote storage. This creates a file backup of the disk.
Hi,
Thanks! It works!
:)
Yongsan
On Sun, Mar 13, 2011 at 7:47 PM, compdoc compdoc@hotrodpc.com wrote:
Sorry to bring this up again. Now i am trying
the clonezilla method to downsize one of my
VM. I have created a smaller storage volume
and added to the VM. I boot up wih clonezilla
but have issue cloning the drive over. Should
I use Disk-Image or Device-Device?
To make it smaller, you need to resize your partition(s) first with gparted, and then use device-device if you have both 'drives' mounted. This clones the drive.
Use Disk-Image only if you want to store a copy of the drive to local or remote storage. This creates a file backup of the disk.
CentOS-virt mailing list CentOS-virt@centos.org http://lists.centos.org/mailman/listinfo/centos-virt