Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to shrink the size of Logical Volume

--- Logical volume ---
LV Name                /dev/vg_linuxph53/lv_home
VG Name                vg_linuxph53
LV UUID                bWrIb2-ek2G-2G3Y-a6kA-8nnB-8fM4-6OenbJ
LV Write Access        read/write
LV Status              available
# open                 1
LV Size                55.12 GiB
Current LE             1764
Segments               2
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           253:2

so I tried to unmount it first

[root@linxuph53 sites]# umount /home
umount: /home: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
[root@linxuph53 sites]# 

as outlined this article, http://www.cyberciti.biz/faq/how-reduce-or-shrink-logical-volume-on-linux/ but it didn't work. What should I do?

Also it seems that on FC14 I don't have e2fsadm utility installed.

thank you!

share|improve this question
    
serverfault.com/a/415927/50647 - But without the Rescue Mode bit. You should be able to login as root to avoid anything in use in /home. –  Aaron Copley Aug 17 '12 at 21:13

1 Answer 1

up vote 3 down vote accepted

It is almost certain that you have to umount the filesystem first; almost no filesystem allows online shrinking (perhaps only btrfs?).

To figure out what's using the mount, simply try "lsof /home" to list the processes keeping it open. Stop those processes and you should get a clean umount.

Next, you'll have to shrink the filesystem. Depending on the fs you use, this may or may not be doable. If you're using ext2/3/4, you can do it using the "resize2fs" tool (it will require a fsck first). This tool allows you to specify the desired size in a human friendly manner, such as "20G". I'd recommend you to size the fs a bit smaller than you want, so you can size it up after shrinking the volume. Read on.

After the file system is shrunk, you can finally size down the logical volume using "lvreduce". You'll have to do something like

# lvreduce -L20G /dev/vg_linuxph53/lv_home

You can also specify a relative size like "-10G" to shrink the volume by 10G.

If you've now sized the fs quite a bit smaller than the target size, so you're confident that the volume does not cut it off anywhere, then you can up the size of the fs again. Do this using resize2fs or another fs-specific tool. Check the man page of the tool for details. resize2fs will expand to the size of the volume if no size is specified.

share|improve this answer
    
Ntfs does support online shrinking. –  longneck Aug 17 '12 at 23:05

Your Answer

 
discard

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.