# Unable to delete directory on a USB drive with vfat format

## storri

I cannot remove certain directories on a USB that was formated with vfat. If I attempt it as root or a regular user I am told certain directories are marked as "read-only". The permission on these directories tell me that I should be able to delete them. I can delete things from the top directory on the USB drive.

I attempted to use fsck.vfat to fix things but again it appears that the file system is read only. I believe this to be the case when it keeps trying to remove an orphaned file each time I repeat the utility.

Here is the output from dmesg

[/quote]

 *Quote:*   

> 
> 
> usb 1-5: new high speed USB device using ehci_hcd and address 7
> 
> usb 1-5: configuration #1 chosen from 1 choice
> ...

 

Any suggestions on what I can do to fix this problem?

----------

## Keruskerfuerst

What command are you using to delete the directories?

----------

## storri

I have used two different methods to delete the files. The first is using 'rm' via a terminal to delete them. The second method is using konqueror by moving the files to the trash and then emptying the trash.

----------

## Keruskerfuerst

And what error (message) do you get?

----------

## storri

The message I receive from konqueror is:

 *Quote:*   

> 
> 
> Could not delete file /media/LEXAR/src/libreverse/html/Base__Header_8hpp__dep__incl.map.
> 
> 

 

While the message I get from rm is:

 *Quote:*   

> 
> 
> storri@base /media/LEXAR/src/libreverse/html $ rm Base__Header_8hpp__dep__incl.map
> 
> rm: cannot remove `Base__Header_8hpp__dep__incl.map': Read-only file system
> ...

 

----------

## Keruskerfuerst

Please post /etc/fstab; the vfat filesystem is actually mounted read-only.

----------

## storri

When the drive is plugged in its automatically mounted via dbus and hal. This was howit was setup before when I could delete any file. I did not make any changes to /etc/fstab. Here is the contents of that file:

 *Quote:*   

> 
> 
> storri@base /media/LEXAR/src/libreverse/html $ cat /etc/fstab
> 
> # /etc/fstab: static file system information.
> ...

 

----------

## Keruskerfuerst

What command are you using to mount the drive?

----------

## storri

I am running the KDE desktop. I installed the kdebase-kioslaves and kdemultimedia-kioslaves for auto mounting CDROMs and USB drives. Its handling everything for me behind the scenes. I did not have to specify a command. Those packages work with dbus and hal to detect the drives and then mount them. So all I have to do is put the USB drive in a USB slot on the front of the computer and KDE takes care of the rest.

----------

## slide_rule

What does mount output once the drive is mounted?

----------

## storri

Since I do not personally call the utility 'mount' to mount the USB to the filesystem I do not know. When I called mount in a terminal, similar to the command below, I got no output.

 *Quote:*   

> 
> 
> sudo mount /dev/sdb1 /mnt/cdrom
> 
> 

 

I picked cdrom because it was a point already available and I don't have a CDROM in the drive.

----------

## Keruskerfuerst

You should add /dev/sdb1 to /etc/fstab

/dev/sdb1 /mnt/usb vfat noauto,owner,user,rw 0 0

----------

## storri

I added the /etc/fstab entry. The USB drive was automounted to /mnt/usb but the drive is still read-only. When the drive was mounted after making the /etc/fstab entry I tried to create a file via 'touch test'. I got back the error message that:

 *Quote:*   

> 
> 
> storri@base /mnt/usb $ touch test
> 
> touch: cannot touch `test': Read-only file system
> ...

 

Checking dmesg for output I found:

 *Quote:*   

> 
> 
> usb 1-5: new high speed USB device using ehci_hcd and address 4
> 
> usb 1-5: configuration #1 chosen from 1 choice
> ...

 

So there appears to be a file system issue.

----------

## theoakwise

 *storri wrote:*   

> Since I do not personally call the utility 'mount' to mount the USB to the filesystem I do not know. 

 

Right.  If you just issue "mount" you get a list of mounts with the options they were mounted with, if it was being mounted RO, it would most likely show there.  Try googling "invalid cluster chain"?  The info I found via google indicated that a bad write sometime in the past *might* be the cause, and reformat might be called for.

----------

## storri

I chose to reformat the USB drive since the data on it was old. I was trying to keep what I had but in the end it was easier to reformat. I used the mkfs.vfat tool to reformat it. Is there a recommended set of flags to use?

----------

