Solved

Reduce LVM root partiton

Posted on 2010-09-03
5
396 Views
Last Modified: 2013-02-07
Hello,

I have the following LVM partition,

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      480G  164G  291G  37% /
/dev/sda1              99M   31M   64M  33% /boot
tmpfs                 4.0G     0  4.0G   0% /dev/shm
/usr/tmpDSK           485M   71M  389M  16% /tmp

As you can see it has 480G size and its used 164GB. I would like to resize that root partition to 200GB. How can I do so ?

Thanks.

Guilherme
0
Comment
Question by:maxihost
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:l4ncel0t
Comment Utility
You can't shrink online filesystem.
Make a backup,
boot on a rescue CD
use resize2fs to reduce you filesystem to 190GB
use lvreduce to reduce you volume to 200GB
then resize2fs to extend your filesystem to 200GB (It could be dangerous to try to align the 2 size by hand so doing this you are safe.)


reboot
0
 

Author Comment

by:maxihost
Comment Utility
Hello,

Thank you very much. Could you please send me the full syntax for resize2fs and lvreduce based on my partition ?

Guilherme
0
 
LVL 4

Accepted Solution

by:
l4ncel0t earned 500 total points
Comment Utility
resize2fs /dev/VolGroup00/LogVol00 190G
lvreduce -L200G /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00  (this last command will extend filesystem to 200GB)
0
 
LVL 4

Expert Comment

by:atech1
Comment Utility
0
 

Author Comment

by:maxihost
Comment Utility
Hello l4nce0t,

Booting with a Rescue CD and answering not to mount the root filesystem it wouldnt find the Volume Group to resize.

If I boot and answer to mount the file system it doesnt let met run the resize2fs. If I try to umount the filesystem it give invalid argument.

Any ideas ?
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now