LinuxQuestions.org
Help answer threads with 0 replies.
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 02-16-2006, 01:41 PM   #1
phyx
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Rep: Reputation: 0
losetup -d /dev/loop3: ioctl: LOOP_CLR_FD: Device or resource busy?


Hi, I'm trying to delete a loop device, but I keep getting the setting "ioctl: LOOP_CLR_FD: Device or resource busy". I thought it might be because it's still mounted, but it's not mounted.

# losetup -d /dev/loop3
ioctl: LOOP_CLR_FD: Device or resource busy

# mount
/dev/sda4 on / type ext3 (rw,noatime,errors=remount-ro)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
tmpfs on /lib/modules/2.6.12-9-amd64-generic/volatile type tmpfs (rw,mode=0755)
/dev/sda2 on /boot type ext2 (rw,noatime)
tmpfs on /dev type tmpfs (rw,size=10M,mode=0755)

# losetup -d /dev/loop3
ioctl: LOOP_CLR_FD: Device or resource busy



A call to ps ax | grep loop3 gives me the following:

# ps ax | grep loop3
31319 ? S< 0:00 [loop3]
2465 pts/8 R+ 0:00 grep loop3


So I think ps 31319 is a zombie. I tried to kill -9 that 31319 process, but nothing. Is it time for a reboot?

OS: Ubuntu 5.10
 
Old 02-16-2006, 06:34 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Using the mount command obviously doesn't show what /dev/loop3 is attached to. Try using losetup -a. That will show the loop devices and their targets. If the problem and its resolution doesn't become immediately clear to you then post the results of the losetup -a command.
 
Old 02-17-2006, 10:27 AM   #3
phyx
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
# losetup --a
losetup: unrecognized option --a
usage:
losetup loop_device # give info
losetup -d loop_device # delete
losetup -f # find unused
losetup [ options ] {-f|loop_device} file # setup
where options include
--offset <num>, -o <num>
start at offset <num> into file.
--pass-fd <num>, -p <num>
read passphrase from file descriptor <num>
instead of the terminal.
--encryption <cipher>, -e <cipher>
encrypt with <cipher>.
Check /proc/crypto or /proc/crypto/cipher for available ciphers.
--nohashpass, -N
Don't hash the password given. (previous versions hash, non-debian doesn't.
--keybits <num>, -k <num>
specify number of bits in the hashed key given
to the cipher. Some ciphers support several key
sizes and might be more efficient with a smaller
key size. Key sizes < 128 are generally not
recommended
 
Old 02-17-2006, 11:42 AM   #4
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Not two dashes; one dash.

losetup -a
 
Old 06-03-2011, 05:26 AM   #5
ashwini.engr07@gmail.com
LQ Newbie
 
Registered: Jun 2011
Posts: 3

Rep: Reputation: Disabled
Smile

Hi, I am facing the exact problem as above. and here is the output of losetup -a:


# losetup -a
/dev/loop0: [fe00]:48674 (/mnt/my_dir/full_02_1002.iso)
/dev/loop1: [fe00]:48674 (/mnt/my_dir/half_02_1002.iso)
/dev/loop2: [fe00]:48674 (/mnt/my_dir/full_06_1002.iso)
#

Please enlighten me about this! I'm a newbie
 
0 members found this post helpful.
Old 06-03-2011, 10:44 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,324

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by ashwini.engr07@gmail.com View Post
Hi, I am facing the exact problem as above. and here is the output of losetup -a:


# losetup -a
/dev/loop0: [fe00]:48674 (/mnt/my_dir/full_02_1002.iso)
/dev/loop1: [fe00]:48674 (/mnt/my_dir/half_02_1002.iso)
/dev/loop2: [fe00]:48674 (/mnt/my_dir/full_06_1002.iso)
#

Please enlighten me about this! I'm a newbie
Did you read the posting rules?? You reopened a FIVE YEAR OLD thread. Open your own thread for your own question.

Did you read the previous posts, too?? The losetup -a will SHOW YOU what's there. Read the man page, and pay attention to the -d (hint: the DELETE option)
 
1 members found this post helpful.
Old 06-03-2011, 12:31 PM   #7
ashwini.engr07@gmail.com
LQ Newbie
 
Registered: Jun 2011
Posts: 3

Rep: Reputation: Disabled
Yes I read it. It says duplicate discussions might be frustrating for readers

And I do not know how five years matter

And ya I know losetup -a just "shows me". I just showed you what it showed me

losetup -d loop_device -> this must have detached the device. But it still gives the same device busy error. It still shows up in losetup -a.

And reboot caused a bit havoc.

man page:

"-d Detach the file or device associated with the specified loop device"

Well. I'll get back with the solution and the reason soon.
Thanks TBOne
 
Old 06-03-2011, 12:59 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,324

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by ashwini.engr07@gmail.com View Post
Yes I read it. It says duplicate discussions might be frustrating for readers
And there are also things about reopening dead threads, and posting your own question in someone elses.
Quote:
And I do not know how five years matter
You don't???? Did it not occur to you that the software may have CHANGED in five years??
Quote:
And ya I know losetup -a just "shows me". I just showed you what it showed me

losetup -d loop_device -> this must have detached the device. But it still gives the same device busy error. It still shows up in losetup -a.

And reboot caused a bit havoc.

man page:
"-d Detach the file or device associated with the specified loop device"

Well. I'll get back with the solution and the reason soon.
Thanks TBOne
You never bothered posting what you did with the "-d", or mention anything about getting a device busy error before now. Again, read the posting rules and guidelines. Providing ALL details about a question will get you answers....not providing them won't. You are still not telling us version/distro of Linux you're using, what the EXACT message(s) are when you type in the command, or what the exact command you're typing in IS. From what you've told us:
  • You're getting a device busy error ("same as" what, we don't know)
  • You're using Linux (version/distro we don't know)
  • You're trying to detach a loop device (you provided a list, but didn't say which one you're having problems with)
  • You rebooted, and have "a bit havoc" (you don't say WHAT happened after the reboot.
Unless you provide details and ask a clear question, no one can help you.
 
Old 06-03-2011, 01:21 PM   #9
ashwini.engr07@gmail.com
LQ Newbie
 
Registered: Jun 2011
Posts: 3

Rep: Reputation: Disabled
As it is in my very 1st post,
Quote:
Hi, I am facing the exact problem as above.
from "above", I meant same as what phyx faced, And the fact that I'm still facing the same issue after 5years, tells me that nothing much has changed.

Here is my story(sorry as it might seem the duplicate of phyx's):
There are 3 loop devices being used by 3 iso files.
losetup -a shows:
Code:
# losetup -a
/dev/loop0: [fe00]:48674 (/mnt/my_dir/full_02_1002.iso)
/dev/loop1: [fe00]:48674 (/mnt/my_dir/half_02_1002.iso)
/dev/loop2: [fe00]:48674 (/mnt/my_dir/full_06_1002.iso)
#

and I'm trying to do
Code:
#losetup -d /dev/[loop0/1]
which is giving me:
ioctl: LOOP_CLR_FD: Device or resource busy

Note that /dev/loop2 got detached without complaints.
Reboot caused "full_02_1002.iso" to get deleted!!!

Linux distro: RHEL-5
 
0 members found this post helpful.
Old 06-03-2011, 02:04 PM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,324

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by ashwini.engr07@gmail.com View Post
As it is in my very 1st post,
from "above", I meant same as what phyx faced, And the fact that I'm still facing the same issue after 5years, tells me that nothing much has changed.
Was RHEL5 available 5 years ago? How about the version of losetup...that unchanged after five years?? Do not reopen old threads, period....open your own.
Quote:
Here is my story(sorry as it might seem the duplicate of phyx's):
There are 3 loop devices being used by 3 iso files.
losetup -a shows:
Code:
# losetup -a
/dev/loop0: [fe00]:48674 (/mnt/my_dir/full_02_1002.iso)
/dev/loop1: [fe00]:48674 (/mnt/my_dir/half_02_1002.iso)
/dev/loop2: [fe00]:48674 (/mnt/my_dir/full_06_1002.iso)
#

and I'm trying to do
Code:
#losetup -d /dev/[loop0/1]
which is giving me:
ioctl: LOOP_CLR_FD: Device or resource busy

Note that /dev/loop2 got detached without complaints. Reboot caused "full_02_1002.iso" to get deleted!!!
Linux distro: RHEL-5
Ok. Have you tried doing an a losetup -d on the specific device, like "/dev/loop0" and "/dev/loop1"? Have you checked the permissions on the ISO images, and the mount point they point to? Also, have you just tried mounting the ISO's with the mount command instead?
Code:
mount -o loop /path/to/ISO/filename.iso
then use the standard umount command on it? Does dmesg have anything to say about the /dev/loopxx devices?

Since you've told us you're using RHEL, have you contacted RHEL support, since you're paying for it with your RHEL subscription?? From their knowledgebase, there was a bug reported (and fixed) in RHEL5, regarding this very issue. If you're paying for patches/updates, it should be easy to fix. If you're not....then you can either pay and get the patches, or reload CentOS instead.
 
  


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
/dev/dsp device or resource busy Daem0hn Linux - General 4 12-11-2005 01:22 PM
Device or Resource Busy ..by what xrado Linux - General 1 04-23-2005 07:05 AM
Device or resource busy mikedurant Linux - Newbie 4 03-29-2005 08:52 PM
"/dev/dsp: Device or resource busy" Cdzin Linux - Hardware 4 02-25-2004 07:39 AM
open /dev/[sound/]dsp: Device or resource busy tearinox Linux - Newbie 1 10-24-2003 07:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:27 AM.

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