Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reduce LVM root partiton

Posted on 2010-09-03
5
Medium Priority
?
456 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…
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.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month6 days, 22 hours left to enroll

782 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