Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 02-28-2008, 04:08 PM   #1
Registered: Jun 2006
Posts: 132

Rep: Reputation: 15
Shrinking a Logical Volume With LVM

I have a centOS 5 server with LVM,
[root@p3 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
17G 3.7G 13G 23% /
/dev/hda1 99M 25M 70M 26% /boot
tmpfs 256M 0 256M 0% /dev/shm
[root@p3 ~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw,size=256m)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

since the "/" take all the space, I want to shrink it, but how can I umount it?

[root@p3 ~]# umount /
umount: /: device is busy
umount: /: device is busy

thanks in advance!
Old 02-28-2008, 04:45 PM   #2
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
I'm not sure this is something you can do while running on the root volume.

The easiest route (or the route I'd take) will probably be to boot to rescue media, activate the VolumeGroup, force fsck /dev/VolGroup00/LogVol00, resize2fs to the reduced size you want, lvreduce the LogicalVolume.

Keep in mind that if you reduce it too much (smaller than you have data consumption) you'll run into problems. also, you don't want to reduce the LV smaller than the filesystem. I usually fudge an extent or two just to be safe.

May not be a bad idea to have a backup of anything you want to keep ahead of time... just in case.

If all goes well, then you reboot successfully and use the reclaimed extents for whatever other Logical Volume(s) you want.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Resize Root LVM Logical Volume??? jdupre Fedora 17 10-02-2010 07:21 AM
LVM: The Impact of Reducing a Logical Volume Size? muff Linux - General 0 07-27-2007 02:18 AM
LVM - Extending logical volume - Insufficient free space deim Linux - Newbie 0 04-07-2007 09:47 PM
a doubt on shrinking logical volume nirmaltom Linux - General 6 02-14-2007 12:46 AM
LVM: How to create logical (physical) volume with extent sie 32 Mb consistgd Linux - Software 4 11-14-2006 05:03 PM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration