I began to rip a CD using KAudioCreator. Halfway through, I realized that I'd put in the wrong filename format, and cancelled the job. Then I went into the directory where it had been writing files to, and tried to delete one of the created MP3's. I got the following error message:
richard@seamus: ~/music/Howard Shore $ rm -rf THELO~1H/ rm: cannot remove `THELO~1H//Concerning Hobbits.mp3': Text file busy
running ls gives:
richard@seamus: ~/music/Howard Shore/THELO~1H $ ls -laF total 8 drwxrwxrwx 1 richard 504 4096 Jan 30 11:52 ./ drwxrwxrwx 1 richard 504 4096 Jan 30 11:47 ../ -rwxrwxrwx 1 richard 504 0 Jan 30 11:48 Concerning Hobbits.mp3*
I've shut down KAudioCreator and used ps to see if there is still a KAudioCreator process running, but I can't find one.
How could the file be busy? I'm not looking at it in any other program. I've tried to delete it in several ways, even su'ing to root to do so.
Any thoughts? What could be causing this, and how can I fix it?
On Sunday 30 Jan 2005 19:59, Richard S. Crawford wrote:
richard@seamus: ~/music/Howard Shore $ rm -rf THELO~1H/ rm: cannot remove `THELO~1H//Concerning Hobbits.mp3': Text file busy
running ls gives:
richard@seamus: ~/music/Howard Shore/THELO~1H $ ls -laF total 8 drwxrwxrwx 1 richard 504 4096 Jan 30 11:52 ./ drwxrwxrwx 1 richard 504 4096 Jan 30 11:47 ../ -rwxrwxrwx 1 richard 504 0 Jan 30 11:48 Concerning Hobbits.mp3*
I've shut down KAudioCreator and used ps to see if there is still a KAudioCreator process running, but I can't find one.
How could the file be busy? I'm not looking at it in any other program. I've tried to delete it in several ways, even su'ing to root to do so.
Any thoughts? What could be causing this, and how can I fix it?
Well, in the extreme a reboot should fix it, but you don't really want to do that. The /sbin/fuser command (part of the psmisc package) will tell you what process is holding the file open. You can then kill the process in question (most likely a KDE ioslave), and you should be able to remove the file.
On Sunday 30 January 2005 12:11 pm, Tim Smith flailed at a keyboard and produced this:
Well, in the extreme a reboot should fix it, but you don't really want to do that. The /sbin/fuser command (part of the psmisc package) will tell you what process is holding the file open. You can then kill the process in question (most likely a KDE ioslave), and you should be able to remove the file.
Hm. Running:
# /sbin/fuser Concerning\ Hobbits.mp3
yields nothing.
Still can't delete it.
Something I forgot to mention: the directory ~/music is actually a symlink to a Samba share on a RH8 computer in my house which has all of our MP3 files.
On Sunday 30 Jan 2005 20:18, Richard S. Crawford wrote:
On Sunday 30 January 2005 12:11 pm, Tim Smith flailed at a keyboard and
produced this:
Well, in the extreme a reboot should fix it, but you don't really want to do that. The /sbin/fuser command (part of the psmisc package) will tell you what process is holding the file open. You can then kill the process in question (most likely a KDE ioslave), and you should be able to remove the file.
Hm. Running:
# /sbin/fuser Concerning\ Hobbits.mp3
yields nothing.
Still can't delete it.
Something I forgot to mention: the directory ~/music is actually a symlink to a Samba share on a RH8 computer in my house which has all of our MP3 files.
In which case you probably need to restart the Samba service. Or stop it, remove the file, and start it again. Try the fuser command on the RH8 box; possibly the samba server has it open on behalf of some other client. Can you shell into the RH8 server and remove it?
I also vaguely recall that there was a samba bug regarding file locking some while back, possibly RH8 is old enough.
On Sunday 30 January 2005 13:59, Richard S. Crawford wrote:
How could the file be busy? I'm not looking at it in any other program. I've tried to delete it in several ways, even su'ing to root to do so.
Any thoughts? What could be causing this, and how can I fix it?
As root, does "lsof <filename>" show any processes associated with the file?
Regards, Mike Klinke
On Sunday 30 January 2005 12:11 pm, Mike Klinke flailed at a keyboard and produced this:
On Sunday 30 January 2005 13:59, Richard S. Crawford wrote:
How could the file be busy? I'm not looking at it in any other program. I've tried to delete it in several ways, even su'ing to root to do so.
Any thoughts? What could be causing this, and how can I fix it?
As root, does "lsof <filename>" show any processes associated with the file?
# lsof Concerning\ Hobbits.mp3
yields nothing. Bah.
Something I forgot to mention: the directory ~/music is actually a symlink to a Samba share on a RH8 computer in my house which has all of our MP3 files.
On Sun, Jan 30, 2005 at 12:19:44PM -0800, Richard S. Crawford wrote:
On Sunday 30 January 2005 12:11 pm, Mike Klinke flailed at a keyboard and produced this:
On Sunday 30 January 2005 13:59, Richard S. Crawford wrote:
How could the file be busy? I'm not looking at it in any other program. I've tried to delete it in several ways, even su'ing to root to do so.
Any thoughts? What could be causing this, and how can I fix it?
As root, does "lsof <filename>" show any processes associated with the file?
# lsof Concerning\ Hobbits.mp3
yields nothing. Bah.
[snip]
Try (as root) lsof | grep "Concerning Hobbits.mp3"
That ought to tell you what PID has the file open
On Sunday 30 January 2005 12:44 pm, Gunnar Kramm flailed at a keyboard and produced this:
[snip]
Try (as root) lsof | grep "Concerning Hobbits.mp3"
That ought to tell you what PID has the file open
Thanks.
After bashing myself over the head and remembering that the file was actually on another computer, I simply ssh'ed into that other computer and rm'ed the file there. No problem.
I'll be sure to remember lsof, though. Thanks.
Richard S. Crawford wrote:
richard@seamus: ~/music/Howard Shore $ rm -rf THELO~1H/ rm: cannot remove `THELO~1H//Concerning Hobbits.mp3': Text file busy
Turns out that this is on a Samba drive.
For what it's worth, I believe that this is significant. Unix natively is quite happy to let you unlink (= remove from the file tree) an open file: a number of programs explicitly use this to ensure that their temporary files go away when they finish. [1]
SMB / CIFS, coming from the DOS / OS/2 / Windows world, doesn't have this concept. When a file is open, it's kept busy, and you can't delete it.
It looks like Linux and rm understand this concept for SMB shares. It's the approach that causes the fewest problems, but it is still not pure Unix.
James.
[1] Create a temporary file, immediately unlink it, and then keep using it. Doesn't matter whether the program crashes or the power is pulled: when the program finishes, the file is gone.
On Mon, 2005-01-31 at 18:59 +0000, James Wilkinson wrote:
Richard S. Crawford wrote:
richard@seamus: ~/music/Howard Shore $ rm -rf THELO~1H/ rm: cannot remove `THELO~1H//Concerning Hobbits.mp3': Text file busy
Turns out that this is on a Samba drive.
For what it's worth, I believe that this is significant. Unix natively is quite happy to let you unlink (= remove from the file tree) an open file: a number of programs explicitly use this to ensure that their temporary files go away when they finish. [1]
SMB / CIFS, coming from the DOS / OS/2 / Windows world, doesn't have this concept. When a file is open, it's kept busy, and you can't delete it.
It looks like Linux and rm understand this concept for SMB shares. It's the approach that causes the fewest problems, but it is still not pure Unix.
James.
Hi
Could I ask why you're using samba to a RH8 system, rather than nfs?
Laurence