Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Apache can use only 50GB, so if my websites go over this amount the server crashes. THis VM has 200GB allocated to it. But I did not set up the volumes correctly. How can I allocate some of the space from lv_home over to lv_root?

# df -h
                       50G  5.0G   42G  11% /
tmpfs                 2.9G     0  2.9G   0% /dev/shm
/dev/sda1             485M  109M  352M  24% /boot
                  142G  188M  135G   1% /home
share|improve this question
up vote 6 down vote accepted

You need to unmount a filesystem to shrink it. So, for /home you'll want to be log in as root and umount /home. If it's 'busy'. You may need to stop any processes using files here.

Then, shrink the file system to just below your targeted logical volume size.

resize2fs /dev/mapper/vg_nastgweblls01-lv_home 99G

Shrink the logical volume to the targeted size.

lvreduce -L 100G /dev/mapper/vg_nastgweblls01-lv_home

Grow the filesystem to the logical volume's capacity.

resize2fs /dev/mapper/vg_nastgweblls01-lv_home

The reason I do it this so I don't have to do any math and keep the filesystem the size of the container. A bit lazy, but it works great.

Now, you have free space to grow root.

lvextend -L 75G /dev/mapper/vg_nastgweblls01-lv_root
resize2fs /dev/mapper/vg_nastgweblls01-lv_root

Don't hesitate to leave some unallocated space since it's easier to grow as needed later.

share|improve this answer
Thank you very much Aaron. I will do this today and report back here. Since my VM is a Dev server, I can stop all services anytime. Paul – paulcap1 Jan 24 '13 at 15:33
Thanks Aaron, it worked great. When I first tried to run: resize2fs /dev/mapper/vg_nastgweblls01-lv_root 99G it said to "Please run 'e2fsck -f /dev/mapper/vg_nastgweblls01-lv_root' first". So I did and then I ran: resize2fs /dev/mapper/vg_nastgweblls01-lv_home 99G I finished the rest of your instructions. And remembered that I need to mount the home drive, so I ran: mount /home then ran: df -h and all the new drives sizes were correct! Thanks – paulcap1 Jan 28 '13 at 17:28
I have a hard time trying to get code formatted and indented in grey using this editor – paulcap1 Jan 28 '13 at 17:29
Glad to help. Get more markdown help here. Note that comments are subject to restrictions including line-breaks and indents. – Aaron Copley Jan 28 '13 at 18:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.