?
Solved

Can't Unmount Logical volume

Posted on 2007-03-20
15
Medium Priority
?
2,653 Views
Last Modified: 2013-12-16
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?!?!?!
0
Comment
Question by:chuckbeats
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
  • +2
15 Comments
 
LVL 10

Expert Comment

by:Luxana
ID: 18760376
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
 
LVL 10

Expert Comment

by:Luxana
ID: 18760379
sorry ...

NOT fdisk but fuser...

# fuser -mk /var

my mistake..

0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 18767337
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
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 

Author Comment

by:chuckbeats
ID: 18790487
tried init1 - still no luck unmounting - I have not been down to the datacenter to try to remount as read only.
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 18790540
Could you post
lsof | grep -i /var
to see what daemon holding the /var partition.
Kill those process and umount /var again.
0
 

Author Comment

by:chuckbeats
ID: 18790599
tried everything mentioned above:

lsof command shows nothing, fuser shows nothing, device still busy ... making me crazy!!!
0
 
LVL 10

Expert Comment

by:Luxana
ID: 18790722
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
 

Author Comment

by:chuckbeats
ID: 18790732
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
 
LVL 10

Expert Comment

by:Luxana
ID: 18790755
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
 

Author Comment

by:chuckbeats
ID: 18790795
ext2resize /dev/mapper/VolGroup00-LogVol02

it won't let me do the above without unmounting
0
 
LVL 10

Expert Comment

by:Luxana
ID: 18790810
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
 

Author Comment

by:chuckbeats
ID: 18790855
yeah - i thought of those, trying to avoid if possible, looks like no options though.

thanks
0
 
LVL 10

Expert Comment

by:Luxana
ID: 18790892
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
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 21169882
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
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 21198253
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
I originally wrote this article to compare SARDU and YUMI, but have now added Easy2Boot, since that is the one I currently use and find the easiest to create and alter.
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

764 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