LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2012, 12:38 PM   #16
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414

If you don't see any open file locks run the following:

Code:
dmsetup info -c VolGroup00-LogVol01
If it shows a number "1" for the open status run the following:

Code:
dmsetup remove VolGroup00-LogVol01
You should then be able to execute the lvremove.
 
1 members found this post helpful.
Old 07-16-2012, 12:52 PM   #17
whizzit
Member
 
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65

Rep: Reputation: 24
Is LogVol01 mounted by any chance?

Code:
# lvcreate -L100M -n test /dev/vg0
  Logical volume "test" created
# mkfs -t ext3 /dev/vg0/test
mke2fs 1.42 (29-Nov-2011)
...
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 

# lvs -a /dev/vg0/test
  LV   VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  test vg0  -wi-a- 100.00m                                      
# mount /dev/vg0/test /mnt/
# lvs -a /dev/vg0/test
  LV   VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  test vg0  -wi-ao 100.00m                                      

# lvremove /dev/vg0/test
  Can't remove open logical volume "test"
# umount /dev/vg0/test
# lvremove /dev/vg0/test
Do you really want to remove active logical volume test? [y/n]: y
  Logical volume "test" successfully removed
# lvs -a /dev/vg0/test
  One or more specified logical volume(s) not found.
 
1 members found this post helpful.
Old 07-16-2012, 12:56 PM   #18
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
It shouldnt be mounted, from the discussion we had this new lv got created. Unless it got mounted, which I can't see it from the steps the issue here is likely a file lock or the dmsetup.
 
Old 07-16-2012, 02:36 PM   #19
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Kustom42 View Post
Try doing:

Code:
lsof | grep -i LogVol01
Code:
bash: lsof : command not found
Quote:
See if there are any processes that have a lock on it. You don't have it mounted, so it shouldn't be giving you this error. Did you see anything in the verbose output in regards to the cause of the error? I know the -vvvv gives you alot of output but it should tell us at what point it errors.
I do see the following:

Code:
Can't remove open logical volume "LogVol01"
 
Old 07-16-2012, 02:43 PM   #20
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Kustom42 View Post
If you don't see any open file locks run the following:
I'm not sure how to check if I have any open file locks, but in the output of the previous command, I do see the following:

Code:
#mm/memlock.c:389                 Unlock : Memlock counters: locked:0 critical:0 daemon:0 suspended:0
#locking/file_locking.c:74        Unlocking /var/lock/lvm/V_VolGroup00
#locking/file_locking.c:51        _undo_flock /var/lock/lvm/V_VolGroup00
#device/dev-io.c:588              Closed /dev/sda2
#device/dev-io.c:588              Closed /dev/sda3
 
Old 07-16-2012, 02:46 PM   #21
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by whizzit View Post
Is LogVol01 mounted by any chance?
Sorry if this might seem dense, is the code you inserted to be followed? It seems that you're creating a 'test' logical volume and mounting it to /mnt then removing it. I'm not sure I understand the purpose (just trying to learn).

When I run df -h, I don't have LogVol01, I only have LogVol00, along with some other partitions. LogVol00 is still at 9.5G in size and is at 100% use.

Also, /dev/loop0 is at 100% of 130M in use. I'm not sure if that matters?

Thank you again for all of the help.
 
Old 07-16-2012, 03:00 PM   #22
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
Did you run the dmsetup commands I provided? What was the output of those? I think that is the issue here preventing the LV from being removed.
 
1 members found this post helpful.
Old 07-16-2012, 03:23 PM   #23
whizzit
Member
 
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65

Rep: Reputation: 24
Quote:
Originally Posted by jbennett View Post
Sorry if this might seem dense, is the code you inserted to be followed? It seems that you're creating a 'test' logical volume and mounting it to /mnt then removing it. I'm not sure I understand the purpose (just trying to learn).
I apologise for the confusion - the commands were not meant to be run (but is good that you questioned it rather than blindly running commands). It was merely to demonstrate that trying to lvremove a volume whilst it was mounted produced the same error you were/are having.

I'll take a step back and allow the thread to continue with Kustom42.

Regards
 
1 members found this post helpful.
Old 07-16-2012, 03:23 PM   #24
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Kustom42 View Post
If you don't see any open file locks run the following:

Code:
dmsetup info -c VolGroup00-LogVol01
Code:
Name                Maj Min Stat Open Targ Event UUID
VolGroup00-LogVol01 253 1   L--w 1    2    0     LVM-.....
Quote:
If it shows a number "1" for the open status run the following:

Code:
dmsetup remove VolGroup00-LogVol01
Code:
device-mapper: remove ioctl failed: Device or resource busy 
Command failed
Now, I suppose I need to know how to check for locked files. I found a few references to 'lsof' and 'lslk', however, being that I'm running on a LiveCD, I cannot install these.
 
Old 07-16-2012, 04:35 PM   #25
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
Well, this is interesting...

That should allow you to remove it, add the -f option to the remove command.

dmsetup remove -f VolGroup00-LogVol01
 
Old 07-16-2012, 04:53 PM   #26
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
result as follows:

Code:
device-mapper: remove ioctl failed: Device or resource busy
Command Failed
 
Old 07-16-2012, 04:59 PM   #27
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
Ok, well since you don't have access to lsof try this:

Code:
ps auxww | grep -i LogVol01
Let us know what the output of that is, something is locking this device and in all honesty it shouldnt unless you mounted it or started a process within that directory. This may be something related to the multipath daemon or udev but I'm not sure at this point. The ps command should show us whats happening.
 
Old 07-16-2012, 05:03 PM   #28
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Code:
root 1618 0.0 0.1 4328 784 tty1 S+ 21:02 0:00 grep -i LogVol01
I'm guessing this means that there is something locking it as root, but I'm not sure how to figure out what? is it pid 1618?

if I do the following:

Code:
ps ax | grep 1618
I get the following:

Code:
1624 tty1 S+ 0:00 grep 1618
Which I'm assuming is saying essentially the same as the previous output, that tty1 is using it?

When I do 'df -H', I don't see LogVol01 listed, only LogVol00??

Last edited by jbennett; 07-16-2012 at 05:06 PM.
 
Old 07-16-2012, 07:51 PM   #29
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
The ps output you are getting is for the grep process you are running. This is very odd, there are no processes with a file open so you should have no issue removing the logical volume.

I have seen this is in wierd situation before where the device was suspended, not sure if thats the case but its something to try.

Code:
dmsetup resume VolGroup00-LogVol01
dmsetup remove VolGroup00-LogVol01
 
Old 07-17-2012, 08:57 AM   #30
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
result as follows:

Code:
device-mapper: remove ioctl failed: Device or resource busy
Command Failed
If I understood more about what was happening I would attempt to research, but I'm not even sure what's causing this at this point.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to expand disk in Linux JALITE Linux - Newbie 6 04-15-2014 05:19 PM
[SOLVED] Expand WinXP Disk Size tronayne Linux - Virtualization and Cloud 4 12-15-2011 08:38 AM
I created my VM machine with to little disk space HOW DO YOU EXPAND bigcape Linux - Virtualization and Cloud 1 03-16-2011 12:30 AM
How to expand disk space cghcgh Linux - Newbie 7 07-08-2008 10:09 AM
expand root partition to occupy whole disk JohnGalt007 Linux - Software 4 01-09-2007 07:03 PM


All times are GMT -5. The time now is 10:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration