0

I am stuck in pretty weird situation. I hope somebody here will help me.

I have one centOS server with XEN installed on it. XEN has 3-4 virtual machiens running on it. As required by XEN, this server has LVM implemented. The structure of Disk System is as following ( Kindly click on this image link) :

http://yfrog.com/72sh01nov191726j

This server has two disks of 750 GB each, and RAID implemented. MD2 partition is / (root) filesystem. It has only 10 GB of space. Now i have to increase the space of / filesystem. It is running short on space. Some more information about server is following:

  1. It has 1 volume group named xen in its LVM and its size is 682 GB.
  2. Their is a physical volume named md3 in volume group xen and its size is 682 GB.
  3. This physical volume has 5 logical volumes which are used for XEN virtual machines.

This volume group has 400 GB of free disk space. So i want to extract some space (200 GB)from it and use this space for / (root) partition.

This is a live server and i can not take risk of testing some test methods on it. I have searched for 4-5 hours for this issue but i was not able to get the proper and authentic answer. So i thought i should post my question here so that i can get a authentic answer.

This is very urgent, my client is shouting on me. .

one more thing i have no physical access this server as it is located in another country.

Kindly help me to solve this.

3
  • Your question is not very clear: Are you trying to increase the size of the root partition of a guest domain, or are you trying to increase the size of the root partition of Dom0? What is the output of pvdisplay, lvdisplay and mount?
    – pehrs
    Nov 19, 2010 at 12:48
  • Thanks for your reply. I am trying to resize the size of system root partition ( '/' ) Sorry, but i do not know abt Dom0 but according to me it is the boot partition and is holding all the system files of CentOS. The output of pvdisplay is : PV Name /dev/md3 VG Name xen PV Size 682.62 GB / not usable 4.00 MB Allocatable yes PE Size (KByte) 4096 Total PE 174749 Free PE 125353 Allocated PE 49396 PV UUID 1O4Lcs-Z7uj-qp8P-0Hid-HQCW-GMlm-JvwChn Nov 19, 2010 at 15:58
  • Sorry, the text garbelled in the previous comment. i m uploading images on following links. kindly check : Output of pvdisplay is img29.imageshack.us/i/sh02nov192131.jpg ...... output (shortened, its big list)lvdisplay is: img831.imageshack.us/i/sh03nov192132.jpg ..... output of mount is : img269.imageshack.us/i/sh04nov192132.jpg Nov 19, 2010 at 16:06

2 Answers 2

1

The general strategy for increasing the size of a file system hosted in LVM:

lvextend -L12G /dev/myvg/myvol

increases the size to 12G. You can use -L+12G to increase the size by 12G instead.

Make sure you have e2fsprogs installed from your favourite package manager. Then:

resize2fs /dev/myvg/myvol

Note: You typically do not want to do this on a mounted file system! There are kernel patches to allow it, but I would recommend taking the server offline first.

In case you are trying to increase the size of a filesystem inside a VM:

As the VM has its own disk layout you will need to modify it. For this you can use parted. What you want to do is something like:

parted /dev/myvg/myvol

And then use parted to erase move/erase volumes untill you can grow your root partition to the size you want. You can find more documentation for parted at http://www.gnu.org/software/parted/manual/html_chapter/parted_2.html

4
  • i guess i can not use any of this, as my server is hosted at some remote data center. So i can not run any command whichh might render it to useless Nov 19, 2010 at 16:52
  • Well, if you want to change the size of the root partition you will have to take the server offline and boot up on a separate disk. It's hard to get around that in a safe manner. But if you use live cd I would consider the procedure reasonably safe. Most data centers have remote KVM or similar to allow you to do exactly this kind of stuff.
    – pehrs
    Nov 19, 2010 at 21:22
  • Thanks for this suggestion, meanwhile i have some more info to discuss. I have webmin installed n this server along with hyperVM. In webmin i can see LVM and partitions. There is one option in which we can add any logical volume to any Raid device partition. Doyou think that will an good idea and risk free. Kindly look at the attachd screenshot yfrog.com/jysh05nov201208j Nov 20, 2010 at 6:42
  • That is better asked as a separate question.
    – pehrs
    Jun 19, 2011 at 9:22
0

you can squeeze a bit (4%) of space out of the filesystem by running:

tune2fs -m 1 /dev/mdX (if you are using ext2 or ext3)

tune4fs -m 1 /dev/mdX (if you are using ext4)

This will change the reserved space on the filesystem from 5% to 1%. This can be a lot of space if you are dealing with TB sized luns.

1
  • it will not solve my purpose. Nov 19, 2010 at 16:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .