Link to home
Start Free TrialLog in
Avatar of chuckbeats
chuckbeats

asked on

Can't Unmount Logical volume

I am trying to extend a Logical Volume and have four volumes under a group. see below:

df -h:
 df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       15G  2.2G   12G  16% /
/dev/sda1              99M   19M   75M  21% /boot
none                 1014M     0 1014M   0% /dev/shm
/dev/mapper/VolGroup00-LogVol04
                      136G   96G   34G  75% /home
/dev/mapper/VolGroup00-LogVol02
                      9.7G  8.7G  479M  95% /var

as you can see I need to extend the /var LogVol02 because our /var/log directory is huge due to increased site traffic. I got great help in making sure I don't lose any data...from here:
https://www.experts-exchange.com/questions/22416218/LVM-LVEXTEND-LVREDUCE.html 

however, I can unmount everything but the /var directory. Anything I have tried has failed:

ie lsof shows nothing, fuser shows nothing, i'm not on that mount point, fuser -k variants tell me to use umount, switching down runlevels doesn't help. Any clues? i'm going nuts here. It always shows the statement below:

[root@bender ~]# fuser -k /var
/var:
No automatic removal. Please use  umount /var
 
AND

umount: /var: device is busy
umount: /var: device is busy

I have also done the above commands by referencing /dev/Vol........

Any help would be greatly appreciated.

Also, online resizing is not allowed. I can't get it to unmount. I also can't edit the fstab file (maybe due to fstab-sync) but it won't let me save it  - even as root it is read only. I;m out of ideas?!?!?!
Avatar of Luxana
Luxana
Flag of Australia image

Hi,

I'm sure that this is not your case but make sure that you are not in /var in your terminal.

There is one command wich will kill all processes using your var = #fdisk -mk /var  however this should be used only if you are really at the end with your thoughts.

can you try to at least remount it to read only?



# mount -o remount,ro /var
than you can try
# fdisk -mk /var

also doing this in single mode and backup will not hurt... :-))
sorry ...

NOT fdisk but fuser...

# fuser -mk /var

my mistake..

I would recommend that you boot your machine into single user mode by typing (as root)
# init 1

Then extend your LVM volume in single user mode.
Avatar of chuckbeats
chuckbeats

ASKER

tried init1 - still no luck unmounting - I have not been down to the datacenter to try to remount as read only.
Could you post
lsof | grep -i /var
to see what daemon holding the /var partition.
Kill those process and umount /var again.
tried everything mentioned above:

lsof command shows nothing, fuser shows nothing, device still busy ... making me crazy!!!
fuser -m is same as lsof | grep -i /var only difference is that you see only pid numbers. However fuser -mk also kill those processes.

what kernel do you have..? Are you sure that it is nessesary to unmount this partition. With new kernels you can do it on fly.

just do lvextend and then resize you partition. The tool you uses depends on filesystem you have...
i tried to do it on the fly...not logged in now, but kernel is fairly new (CentOS 3)

Don't I need to resize before doing lvextend - (actually more importantly, don't I need to resize before doing LVReduce on the volume I'm taking space from)

kernel does not allow on the fly resize2fs
1)
check free space in virtual group : "vgdisplay"
2)
this will extend it to 15GB
# lvextend -L15G /dev/mapper/VolGroup00-LogVol02
3)
in case of ext partition:
# ext2resize /dev/mapper/VolGroup00-LogVol02

do you have a backup of tmp ?  :-)
ext2resize /dev/mapper/VolGroup00-LogVol02

it won't let me do the above without unmounting
can you use some live cd to resize the partiton?

or

can you clone /var to some other partition, than change fstab to mount it on different place/partition reboot to single mode do resize that think change fstab back? :-) ?
yeah - i thought of those, trying to avoid if possible, looks like no options though.

thanks
i'm not sure about the live cd but the other should work... take it positively by cloning /var you also create backup of /var :-))
Avatar of Hanno P.S.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup Zone:
PAQ - Refund Points

Any objections should be posted here in the next 4 days. After that time, the question will be closed.
JustUNIX, Experts Exchange Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial