Solved

Reduce LVM root partiton

Posted on 2010-09-03
5
409 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
ID: 33602380
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
ID: 33603556
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
ID: 33603965
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
ID: 33604278
0
 

Author Comment

by:maxihost
ID: 33615139
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

920 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

14 Experts available now in Live!

Get 1:1 Help Now