Unable to delete files on usb


Forum: Other Help Topics
Topic: Unable to delete files on usb
started by: JohnJS

Posted by JohnJS on Feb. 15 2008,21:24
Been using a Kingston 512mb usb stick to transfer files between two computers.
For some reason today am unable to delete the files on the stick..  Get "read only file system" message.
Tried to change permissions but with no success.
Any suggestions?

Edit:
Tried cfdisk on sda but did not fix the problem. Files still there.

Posted by ^thehatsrule^ on Feb. 16 2008,00:02
- how did you mount it?
- what user are you when you try to delete it? (root privileges?)
- check for a read-only switch on the stick?

Posted by lucky13 on Feb. 16 2008,00:56
Quote
Tried cfdisk on sda but did not fix the problem. Files still there.

That doesn't erase anything, it just rewrites the partition table. Along with what hats asked and it's not related to permissions, look at your /etc/mtab to see how it's mounted (ro is read-only, rw is read-write). Then if needed you can adjust it in /etc/fstab (change the sda1 line from ro to rw). Unmount, mount.

Posted by curaga on Feb. 16 2008,07:16
If you're sure it's mounted rw and you have permissions, the flash wear-out can have that effect, I've bumped into it once. What I did was just re-format the stick, the format should see a bad block and mark it as such.
Posted by JohnJS on Feb. 16 2008,17:05
/etc/mtab reads: /dev/sda1 /mnt/sda1 vfat rw,nosuid,nodev,umask=000,uid=1001,gid=50 0 0

Ran cfdisk as Aterm sudo su.

Mounted using rightclick on dfm icon.

What command do I use to format in Linux other than cfdisk? (newbie question).

Edit: Solved it:
Used mke2fs and then cfdisk, wiped the stick clean. Many thanks for assistance.

Posted by ^thehatsrule^ on Feb. 16 2008,17:24
cfdisk does not do any formatting, it only partitions your disk.

You can use the mk* set of tools for formatting.  See < http://damnsmalllinux.org/wiki....h_Drive > for example.

Posted by curaga on Feb. 16 2008,17:25
DSL doesn't include dosfstools, only ext2 & 3. So if you want to format into ext2, you would use
mkfs.ext2 -m 0 /dev/sda1

The binary dosfstools release works fine on DSL though, so if you want fat16/32, it's at: < ftp://ftp.uni-erlangen.de/pub.....tar.gz >

Posted by JohnJS on Feb. 16 2008,17:33
Many thanks all.

Did mke2fs and then cfdisk and the stick is now clean.

Posted by lucky13 on Feb. 16 2008,22:23
Quote
Did mke2fs and then cfdisk and the stick is now clean.

Why on earth would you partition after formatting?

Posted by JohnJS on Feb. 17 2008,00:14
Then mke2fs -m 0 /dev/sda1 would be sufficient to "format".
Still learning Linux.

Posted by ^thehatsrule^ on Feb. 17 2008,00:39
side note: DSL includes mkdosfs, which is used for usb pendrive installs.
Posted by curaga on Feb. 17 2008,08:48
Ah. I only remembered the lack of dosfsck, also in the package..
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.