Odd problem with terminal

Karl Larsen klarsen1 at gmail.com
Sat Sep 4 21:12:48 UTC 2010


On 09/04/2010 02:50 PM, Steven Susbauer wrote:
> 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.
>
>    
         I tried your idea without the sudo. Here is what it did:
karl at Lucid:~$ cd /media
karl at Lucid:/media$ ls
4083-B092
karl at Lucid:/media$ rm -rf 4083-B092/*
karl at Lucid:/media$ ls
4083-B092
karl at Lucid:/media$ rm -rf 4083-B092/*
karl at Lucid:/media$ ls
4083-B092
karl at Lucid:/media$
karl at Lucid:/media$ ls
4083-B092
karl at Lucid:/media$ sudo rm -rf 4083-B092/*
[sudo] password for karl:
karl at Lucid:/media$ ls
4083-B092
karl at Lucid:/media$

         So neither work for reasons unknown, I will now try to format 
the stick as ext4 and see what happens.


73 Karl




-- 

	Karl F. Larsen, AKA K5DI
	Linux User
	#450462   http://counter.li.org.
         Key ID = 3951B48D






More information about the ubuntu-users mailing list