Hi,
My host and guest are CentOS 6. The guest is going to be a web server in production. I am trying to resize (extend) of the base partition of my guest. But I can of course start the installation of CentOS 6 guest all over again with a larger image size. However, just for the sake of better understanding I an trying to solve things not to be end up in a dead end after some years.
1. I created a guest CentOS 6 with 12G total disk (on a iscsi drive). No Desktop, just for terminal use. No LVM, just a simple basic partitioning. 2. Later I wanted to increase the size of total image to 200G. 3. I managed to resize the image to 200G on my iscsi drive. So, there is 188G unallocated/unformatted volume within the guest image.
Now, the hardest part. I have to resize the partition. I have been trying to find a way to do that. A search on Google showed that GParted is tool to do that. I had to install all Desktop and X as Gparted is a GUI tool. Installed vncserver. Then, I found out that GParted can not resize the live guest. So, I downloaded GParted Live CD.
Now, the questions:
1. If it was a physical machine I would boot from the CD. If I can boot it from host CDROM but then how should I operate on a specific guest? What is the easiest way to access GUI of the guest if I boot from Live CD. 2. I am wondering if a simple LVM route at the beginning would be preferred. Changing size of the iscsi volume on my NAS is easy. I thought there was no need for more complication, so went with basic /boot / and swap partitions. Is resizing partitions for LVM easier than basic partitioning (without LVM)? 3. Is there a specific tool in KVM suit which performs resizing partition within the image? Or as I prefer command line tools, is there a way to achieve resizing without any graphical tool like GParted? With GParted I had to install all the X and Gnome files, vncserver which otherwise I don't need.
I would appreciate any information/hint/experience.
All the best.
Vreme: 10/19/2011 06:34 PM, Müfit Eribol piše:
Hi,
My host and guest are CentOS 6. The guest is going to be a web server in production. I am trying to resize (extend) of the base partition of my guest. But I can of course start the installation of CentOS 6 guest all over again with a larger image size. However, just for the sake of better understanding I an trying to solve things not to be end up in a dead end after some years.
- I created a guest CentOS 6 with 12G total disk (on a iscsi drive). No
Desktop, just for terminal use. No LVM, just a simple basic partitioning. 2. Later I wanted to increase the size of total image to 200G. 3. I managed to resize the image to 200G on my iscsi drive. So, there is 188G unallocated/unformatted volume within the guest image.
Now, the hardest part. I have to resize the partition. I have been trying to find a way to do that. A search on Google showed that GParted is tool to do that. I had to install all Desktop and X as Gparted is a GUI tool. Installed vncserver. Then, I found out that GParted can not resize the live guest. So, I downloaded GParted Live CD.
Now, the questions:
- If it was a physical machine I would boot from the CD. If I can boot
it from host CDROM but then how should I operate on a specific guest? What is the easiest way to access GUI of the guest if I boot from Live CD. 2. I am wondering if a simple LVM route at the beginning would be preferred. Changing size of the iscsi volume on my NAS is easy. I thought there was no need for more complication, so went with basic /boot / and swap partitions. Is resizing partitions for LVM easier than basic partitioning (without LVM)? 3. Is there a specific tool in KVM suit which performs resizing partition within the image? Or as I prefer command line tools, is there a way to achieve resizing without any graphical tool like GParted? With GParted I had to install all the X and Gnome files, vncserver which otherwise I don't need.
I would appreciate any information/hint/experience.
All the best.
Hi.
My view is:
a) Use LVM so you can manipulate size of partition(s). Resizing etx4 partitions is horrible job, long and dangerous.
b) You can mount ISO image file of any CD via Guests VirtualCD, no need to mess with physical CD/DVD drives. There is System Rescue CD, CentOS LiveCD (I have one 5.3 with mdadm raid support and bunch of tools,I will soon be making 6.1 version) or Hiren's Boot CD - Parted. Root partition needs offline resize since extX partitions can not be mounted at the time of the resizing.
c) All text-based resize tools require higher knowledge and/or experience, like alignment to sectors and similar mambo-jumbo. When you need to make it happen on production server without experimentation and you have done it only once 3 years ago it IS mambo-jumbo.
d) As far as I know, KVM can not mount virtual hard drives, so meesing with them is not an option, unless you use "raw" partition on the Host (still haven't tried it).
On 19.10.2011 21:07, Ljubomir Ljubojevic wrote:
Vreme: 10/19/2011 06:34 PM, Müfit Eribol piše:
Hi,
My host and guest are CentOS 6. The guest is going to be a web server in production. I am trying to resize (extend) of the base partition of my guest. But I can of course start the installation of CentOS 6 guest all over again with a larger image size. However, just for the sake of better understanding I an trying to solve things not to be end up in a dead end after some years.
- I created a guest CentOS 6 with 12G total disk (on a iscsi drive). No
Desktop, just for terminal use. No LVM, just a simple basic partitioning. 2. Later I wanted to increase the size of total image to 200G. 3. I managed to resize the image to 200G on my iscsi drive. So, there is 188G unallocated/unformatted volume within the guest image.
Now, the hardest part. I have to resize the partition. I have been trying to find a way to do that. A search on Google showed that GParted is tool to do that. I had to install all Desktop and X as Gparted is a GUI tool. Installed vncserver. Then, I found out that GParted can not resize the live guest. So, I downloaded GParted Live CD.
Now, the questions:
- If it was a physical machine I would boot from the CD. If I can boot
it from host CDROM but then how should I operate on a specific guest? What is the easiest way to access GUI of the guest if I boot from Live CD. 2. I am wondering if a simple LVM route at the beginning would be preferred. Changing size of the iscsi volume on my NAS is easy. I thought there was no need for more complication, so went with basic /boot / and swap partitions. Is resizing partitions for LVM easier than basic partitioning (without LVM)? 3. Is there a specific tool in KVM suit which performs resizing partition within the image? Or as I prefer command line tools, is there a way to achieve resizing without any graphical tool like GParted? With GParted I had to install all the X and Gnome files, vncserver which otherwise I don't need.
I would appreciate any information/hint/experience.
All the best.
Hi.
My view is:
a) Use LVM so you can manipulate size of partition(s). Resizing etx4 partitions is horrible job, long and dangerous.
b) You can mount ISO image file of any CD via Guests VirtualCD, no need to mess with physical CD/DVD drives. There is System Rescue CD, CentOS LiveCD (I have one 5.3 with mdadm raid support and bunch of tools,I will soon be making 6.1 version) or Hiren's Boot CD - Parted. Root partition needs offline resize since extX partitions can not be mounted at the time of the resizing.
c) All text-based resize tools require higher knowledge and/or experience, like alignment to sectors and similar mambo-jumbo. When you need to make it happen on production server without experimentation and you have done it only once 3 years ago it IS mambo-jumbo.
d) As far as I know, KVM can not mount virtual hard drives, so meesing with them is not an option, unless you use "raw" partition on the Host (still haven't tried it).
It is good to know at the very beginning that LVM is the way to go. So, I am reinstalling the server with LVM. It is good to know about it so early.
Just for learning, could you please provide some more info about booting up the LiveCD ISO image (uploaded to the host) to work on a guest? How is the command line?
Thank you for your kind help.
Vreme: 10/20/2011 10:22 AM, Müfit Eribol piše:
On 19.10.2011 21:07, Ljubomir Ljubojevic wrote:
Vreme: 10/19/2011 06:34 PM, Müfit Eribol piše:
Hi,
My host and guest are CentOS 6. The guest is going to be a web server in production. I am trying to resize (extend) of the base partition of my guest. But I can of course start the installation of CentOS 6 guest all over again with a larger image size. However, just for the sake of better understanding I an trying to solve things not to be end up in a dead end after some years.
- I created a guest CentOS 6 with 12G total disk (on a iscsi drive). No
Desktop, just for terminal use. No LVM, just a simple basic partitioning. 2. Later I wanted to increase the size of total image to 200G. 3. I managed to resize the image to 200G on my iscsi drive. So, there is 188G unallocated/unformatted volume within the guest image.
Now, the hardest part. I have to resize the partition. I have been trying to find a way to do that. A search on Google showed that GParted is tool to do that. I had to install all Desktop and X as Gparted is a GUI tool. Installed vncserver. Then, I found out that GParted can not resize the live guest. So, I downloaded GParted Live CD.
Now, the questions:
- If it was a physical machine I would boot from the CD. If I can boot
it from host CDROM but then how should I operate on a specific guest? What is the easiest way to access GUI of the guest if I boot from Live CD. 2. I am wondering if a simple LVM route at the beginning would be preferred. Changing size of the iscsi volume on my NAS is easy. I thought there was no need for more complication, so went with basic /boot / and swap partitions. Is resizing partitions for LVM easier than basic partitioning (without LVM)? 3. Is there a specific tool in KVM suit which performs resizing partition within the image? Or as I prefer command line tools, is there a way to achieve resizing without any graphical tool like GParted? With GParted I had to install all the X and Gnome files, vncserver which otherwise I don't need.
I would appreciate any information/hint/experience.
All the best.
Hi.
My view is:
a) Use LVM so you can manipulate size of partition(s). Resizing etx4 partitions is horrible job, long and dangerous.
b) You can mount ISO image file of any CD via Guests VirtualCD, no need to mess with physical CD/DVD drives. There is System Rescue CD, CentOS LiveCD (I have one 5.3 with mdadm raid support and bunch of tools,I will soon be making 6.1 version) or Hiren's Boot CD - Parted. Root partition needs offline resize since extX partitions can not be mounted at the time of the resizing.
c) All text-based resize tools require higher knowledge and/or experience, like alignment to sectors and similar mambo-jumbo. When you need to make it happen on production server without experimentation and you have done it only once 3 years ago it IS mambo-jumbo.
d) As far as I know, KVM can not mount virtual hard drives, so meesing with them is not an option, unless you use "raw" partition on the Host (still haven't tried it).
It is good to know at the very beginning that LVM is the way to go. So, I am reinstalling the server with LVM. It is good to know about it so early.
Just for learning, could you please provide some more info about booting up the LiveCD ISO image (uploaded to the host) to work on a guest? How is the command line?
Thank you for your kind help.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Sorry, I do not use command line for KVM. I use my Desktop to connect to Servers KVM Domain:
Virtual Machine Manager -> File -> Add New Connection -> Fill: Hipervisor: QEMU/KVM; Connect to remote host; Metod: SSHl username + password; Hostname: xxx
And you should have full access to your servers KVM domain.
But even if you need to use command line, I am sure you will be able to find it by googling for "kvm linux boot from cd command line".
Also check out CentOS-virt mailing list Archive (on this same mailing list server).
http://www.linux-kvm.org is official site for KVM.
On Thu, Oct 20, 2011 at 1:52 PM, Müfit Eribol hme@onart.com.tr wrote:
Just for learning, could you please provide some more info about booting up the LiveCD ISO image (uploaded to the host) to work on a guest? How is the command line?
Invoking kvm (qemu-kvm) from the CLI:
kvm \ -boot d \ -cdrom /path/name/to/liveCD/iso/file \ -drive file=${IMG_FILE},index=0,boot=off \ [other kvm command line options like networking]
where IMG_FILE=/path/to/VM/image/file
I use System Rescue CD for the CD ROM. It does have XFCE GUI support + GParted. A simple startx fires up a XFCE desktop and voila you can use the Graphical GParted utility on the VM "hard disk".
HTH -- Arun Khan
On 10/19/11 9:34 AM, Müfit Eribol wrote:
My host and guest are CentOS 6. The guest is going to be a web server in production. I am trying to resize (extend) of the base partition of my guest. But I can of course start the installation of CentOS 6 guest all over again with a larger image size. However, just for the sake of better understanding I an trying to solve things not to be end up in a dead end after some years.
rather than resizing the system 'drive', I woudl have simply created ANOTHER logical drive mapped to the guest, and create a new file system on it, moving the stuff thats filling up your base disk (/home ? /var/www ?) to it, then remounting it as the 'new' /home or /var/www or whatever....
On 10/19/2011 08:15 PM, John R Pierce wrote:
On 10/19/11 9:34 AM, Müfit Eribol wrote:
My host and guest are CentOS 6. The guest is going to be a web server in production. I am trying to resize (extend) of the base partition of my guest. But I can of course start the installation of CentOS 6 guest all over again with a larger image size. However, just for the sake of better understanding I an trying to solve things not to be end up in a dead end after some years.
rather than resizing the system 'drive', I woudl have simply created ANOTHER logical drive mapped to the guest, and create a new file system on it, moving the stuff thats filling up your base disk (/home ? /var/www ?) to it, then remounting it as the 'new' /home or /var/www or whatever....
Agree. But if your system disk is now bigger, you can also create a new partition (even while the system is live) and use this new partition. And I would still use LVM for this new partition. This does not really add much complexity. It does add a lot of flexibility. The steps are:
parted /dev/sda mkpart p ext2 <start> <stop>
pvcreate /dev/sda2 (your new second new partition?) vgcreate vg /dev/sda2 lvcreate vg -n test -L 10G mkfs.ext4 /dev/vg/test
The volume group does not need to be assigned completely and leaves some room to carve new partitions in the future. Also the snapshot feature allows to create consistent backups if needed.
I even think you can used parted to change you system partition. Simply delete the partition and recreate with the exact same starting sector. One mistake and you will loose a lot though, so why would you even try?
Theo
On 19.10.2011 23:12, Theo Band wrote:
On 10/19/2011 08:15 PM, John R Pierce wrote:
On 10/19/11 9:34 AM, Müfit Eribol wrote:
My host and guest are CentOS 6. The guest is going to be a web server in production. I am trying to resize (extend) of the base partition of my guest. But I can of course start the installation of CentOS 6 guest all over again with a larger image size. However, just for the sake of better understanding I an trying to solve things not to be end up in a dead end after some years.
rather than resizing the system 'drive', I woudl have simply created ANOTHER logical drive mapped to the guest, and create a new file system on it, moving the stuff thats filling up your base disk (/home ? /var/www ?) to it, then remounting it as the 'new' /home or /var/www or whatever....
Agree. But if your system disk is now bigger, you can also create a new partition (even while the system is live) and use this new partition. And I would still use LVM for this new partition. This does not really add much complexity. It does add a lot of flexibility. The steps are:
parted /dev/sda mkpart p ext2<start> <stop>
pvcreate /dev/sda2 (your new second new partition?) vgcreate vg /dev/sda2 lvcreate vg -n test -L 10G mkfs.ext4 /dev/vg/test
The volume group does not need to be assigned completely and leaves some room to carve new partitions in the future. Also the snapshot feature allows to create consistent backups if needed.
I even think you can used parted to change you system partition. Simply delete the partition and recreate with the exact same starting sector. One mistake and you will loose a lot though, so why would you even try?
Theo
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Thank you for your support.
I perfectly understand that LVM is the way to go.