Odd problem with terminal

Steven Susbauer steven at too1337.com
Sat Sep 4 20:50:39 UTC 2010


On 9/4/2010 3:05 PM, Karl Larsen wrote:
>
>       I have several USB memory sticks with some just junk on them. I use
> the proper bash calls to remove the junk but get this error message
> every time:
>
> karl at Lucid:/media$ ls
> 4083-B092
> karl at Lucid:/media$ sudo rm -Rf 4083-B092/
> rm: cannot remove directory `4083-B092': Device or resource busy
> karl at Lucid:/media$
>
> I can't find out what the Device or resource busy error is, or where it
> is coming from. I also have a hard drive which plugs into a USB port and
> it too gives the same error message.
>
> What can I be doing wrong?

Assuming you are trying to remove all files from the USB stick, you need 
to tell it to remove the files on the stick rather than removing the 
stick itself (what you are doing at the moment is similar to attempting 
to drag C: to the trash on a Windows system). 4083-B092 is the mount 
point, not just a directory.

The proper way to delete all files on the stick would be

  sudo rm -rf 4083-B092/*

Of course, you could always just reformat the stick as well.




More information about the ubuntu-users mailing list