Results 1 to 3 of 3
Hi folks, Ubuntu 7.10 I have some files and directories on an USB flash pendrive. I can't delele them because on read-only filesystem. I tried; $ sudo mount -o remount,rw ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-15-2008 #1
- Join Date
- Sep 2004
How to delete files/directories on Read-Only file system
I have some files and directories on an USB flash pendrive. I can't delele them because on read-only filesystem.
$ sudo mount -o remount,rw /mnt/maindir
$ sudo mount -o remount,rw /dev/sdb1Code:
mount: you must specify the filesystem type
I don't expect running;Code:
$ dd if=/dev/zero of=/dev/sdb1
Please shed me some light. TIA
- 07-15-2008 #2
- 07-15-2008 #3
- Join Date
- Sep 2004
Thanks for your advice.
Before reading your post I performed following test.
This USB pendrive looks quite strange to me. I got it in a conference as gift from a multi-nation software company. It has files on it introducing their products taking up 57M out of 1G.
After mount it with;Code:
$ sudo mount /dev/sdb1 /mnt
I can copy files on it. They can be deleted later.
$ cp -r /path/to/dir-A /mnt/
Then I ran
$ sudo mount -t vfat -o rw /dev/sdb1 /media/sdb1
Still I can't delete the directories including their files.
Later I found on running;
$ fdisk -lCode:
Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb: 1056 MB, 1056702464 bytes 33 heads, 62 sectors/track, 1008 cylinders Units = cylinders of 2046 * 512 = 1047552 bytes
Therefore I ran
# fdisk /dev/sdb
to repartition the drive and afterwards ran;
# mkfs.ext2 -c /dev/sdb1
it went though w/o complaint
But I can't mount the pendrive
$ sudo mount -t ext2 /dev/sdb1 /media/sdb1/Code:
mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so
Then I ranCode:
dmesg | tail
It asked me to run "e2fsck /dev/sdb1"
$ sudo e2fsck /dev/sdb1
.... Inode 421 has INDEX_FL flag set but is not a directory. Clear HTree index<y>? ......
I don't know how to proceed further. Nor I know what mistake I have committed. Please advise.