Solved

Can't Unmount Logical volume

Posted on 2007-03-20
15
2,638 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
  • 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
 

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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 Schröder
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A while back when OPSMGR 2012 was released we were very excited about getting it into our environment and upgrading our 2007 implementation,  we started our planning and we then proceeded with our implementation. All went as planned & our system …
I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now