Solved

Can't Unmount Logical volume

Posted on 2007-03-20
15
2,651 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

688 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