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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
07-16-2012, 11:38 AM
|
#16
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
07-16-2012, 11:52 AM
|
#17
|
Member
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65
Rep:
|
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.
|
07-16-2012, 11:56 AM
|
#18
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
|
|
07-16-2012, 01:36 PM
|
#19
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
Quote:
Originally Posted by Kustom42
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"
|
|
|
07-16-2012, 01:43 PM
|
#20
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
Quote:
Originally Posted by Kustom42
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
|
|
|
07-16-2012, 01:46 PM
|
#21
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
Quote:
Originally Posted by whizzit
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.
|
|
|
07-16-2012, 02:00 PM
|
#22
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
07-16-2012, 02:23 PM
|
#23
|
Member
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65
Rep:
|
Quote:
Originally Posted by jbennett
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.
|
07-16-2012, 02:23 PM
|
#24
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
Quote:
Originally Posted by Kustom42
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.
|
|
|
07-16-2012, 03:35 PM
|
#25
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
Well, this is interesting...
That should allow you to remove it, add the -f option to the remove command.
dmsetup remove -f VolGroup00-LogVol01
|
|
|
07-16-2012, 03:53 PM
|
#26
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
result as follows:
Code:
device-mapper: remove ioctl failed: Device or resource busy
Command Failed
|
|
|
07-16-2012, 03:59 PM
|
#27
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
|
|
07-16-2012, 04:03 PM
|
#28
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
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:
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 04:06 PM.
|
|
|
07-16-2012, 06:51 PM
|
#29
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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
|
|
|
07-17-2012, 07:57 AM
|
#30
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 01:55 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|