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:
http://www.experts-exchange.com/OS/Linux/Q_22416218.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?!?!?!
chuckbeatsAsked:
Who is Participating?
 
Computer101Connect With a Mentor Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0
 
LuxanaCommented:
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... :-))
0
 
LuxanaCommented:
sorry ...

NOT fdisk but fuser...

# fuser -mk /var

my mistake..

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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

lsof command shows nothing, fuser shows nothing, device still busy ... making me crazy!!!
0
 
LuxanaCommented:
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...
0
 
chuckbeatsAuthor Commented:
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
0
 
LuxanaCommented:
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 ?  :-)
0
 
chuckbeatsAuthor Commented:
ext2resize /dev/mapper/VolGroup00-LogVol02

it won't let me do the above without unmounting
0
 
LuxanaCommented:
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? :-) ?
0
 
chuckbeatsAuthor Commented:
yeah - i thought of those, trying to avoid if possible, looks like no options though.

thanks
0
 
LuxanaCommented:
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 :-))
0
 
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.