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 ...
- 07-15-2008 #1Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,546
How to delete files/directories on Read-Only file system
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 /mnt/maindir
without result.
If run;
$ sudo mount -o remount,rw /dev/sdb1What filesystem I have to specify there?Code:mount: you must specify the filesystem type
I don't expect running;to erase the pendrive completely.Code:$ dd if=/dev/zero of=/dev/sdb1
Please shed me some light. TIA
B.R.
satimis
- 07-15-2008 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
What filesystem is on the drive? If it is FAT or FAT32 you can use
Code:sudo mount -o remount,rw -t vfat /dev/sdb1
- 07-15-2008 #3Linux Guru
- Join Date
- Sep 2004
- Posts
- 1,546
Hi bigtomrodney,
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;(I found /dev/sdb1 by runnint "fdisk -l")Code:$ sudo mount /dev/sdb1 /mnt
I can copy files on it. They can be deleted later.
If runningDirectory including files can be copied on the pendrive. But they can't be deleted later.Code:$ 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 -lThe partition table seems gone.Code: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
It took long time to run without finish. Therefore I manually exited it by pressing [Ctrl]+cCode:.... 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.
TIA
B.R.
satimis


Reply With Quote

