22
2
I have somehow managed to write an iso 9660 image onto my USB drive, which makes all my computer think that the device is actually a CD. I have tried various methods of removing this partition, but nothing seems to work. I have tried fdisk
, which says
$ fdisk -l /dev/sdb Cannot open /dev/sdbparted crashes when I try to use it on this device.
I have even tried
$ dd if=/dev/zero of=/dev/sdbbut it just hangs with no output (either on screen or on disk). However, when I plug the USB in, it does mount, and I can view (but not edit) the files on it.
edit: now the result is
$ dd if=/dev/zero of=/dev/sdb dd: opening `/dev/sdb': Read-only file system
I have also tried re-formatting it on Windows, but it gets to the end of the format process and then says "Couldn't format the drive".
How can I remove this partition and get my whole USB drive back to normal again?
EDIT 1: Trying a simple mkfs
doesn't work:
$ sudo mkfs -t vfat /dev/sdb mkfs.vfat 3.0.0 (28 Sep 2008) mkfs.vfat: Will not try to make filesystem on full-disk device '/dev/sdb' (use -I if wanted)I can't do
mkfs
on /dev/sdb1
because there is no such partition, as shown:$ ls /dev | grep sdb sdb
EDIT 2: This is the information posted by dmesg when I plug the device in:
$ dmesg . . (snip) . usb 2-1: New USB device found, idVendor=058f, idProduct=6387 usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 2-1: Product: Mass Storage usb 2-1: Manufacturer: Generic usb 2-1: SerialNumber: G0905000000000010885 usb-storage: device found at 4 usb-storage: waiting for device to settle before scanning usb-storage: device scan complete scsi 6:0:0:0: Direct-Access FLASH Drive AU_USB20 8.07 PQ: 0 ANSI: 2 sd 6:0:0:0: [sdb] 4069376 512-byte hardware sectors (2084 MB) sd 6:0:0:0: [sdb] Write Protect is off sd 6:0:0:0: [sdb] Mode Sense: 03 00 00 00 sd 6:0:0:0: [sdb] Assuming drive cache: write through sd 6:0:0:0: [sdb] 4069376 512-byte hardware sectors (2084 MB) sd 6:0:0:0: [sdb] Write Protect is off sd 6:0:0:0: [sdb] Mode Sense: 03 00 00 00 sd 6:0:0:0: [sdb] Assuming drive cache: write through sdb: unknown partition table sd 6:0:0:0: [sdb] Attached SCSI removable disk sd 6:0:0:0: Attached scsi generic sg2 type 0 ISO 9660 Extensions: Microsoft Joliet Level 3 ISO 9660 Extensions: RRIP_1991A SELinux: initialized (dev sdb, type iso9660), uses genfs_contexts CE: hpet increasing min_delta_ns to 15000 nsecThis shows that the device is formatted as ISO 9660 and that it is
/dev/sdb
.
EDIT 3: This is the message that I find at the bottom of dmesg
after running cfdisk
and writing a new partition table to the disk:
SELinux: initialized (dev sdb, type iso9660), uses genfs_contexts sd 17:0:0:0: [sdb] Device not ready: Sense Key : Not Ready [current] sd 17:0:0:0: [sdb] Device not ready: <> ASC=0xff ASCQ=0xffASC=0xff <> ASCQ=0xff end_request: I/O error, dev sdb, sector 0 Buffer I/O error on device sdb, logical block 0 lost page write due to I/O error on sdb
+1, interesting situation. i'm suspicious; i wonder if it's actually the device firmware borking things up or if the linux scsi driver is getting in the way somehow. but since the
dd
andfdisk
attempts all fail, you'd have to hack into scsi directly to know for sure. – quack quixote – 2010-02-27T07:16:29.813Dunno - but it doesn't seem to work with Windows either, so I'm guessing that it's the device itself that's stuffed – a_m0d – 2010-02-27T08:11:16.393
Are you sure it is always loading at /dev/sdb? If you look at the end of /var/log/messages after the device is installed you will see the log messages relating to its automount. – mas – 2009-07-29T06:20:28.467
Yeah, it definitely is - see edit to question. – a_m0d – 2009-07-29T06:28:08.700
How did you manage to write that image on it? I'll try to reproduce it on my old drive later, maybe I'll be able to find a way to fix it. – Kirill Strizhak – 2009-07-29T06:36:40.650
3Are you sure it isn't currently mounted with cdfs or the equivalent? – RBerteig – 2009-07-29T06:46:49.630
1@Slink84: I think I just went
sudo dd if=some.iso of=/dev/sdb
- I can't remember doing anything else that could do it – a_m0d – 2009-07-29T06:57:33.447@RBerteig: No, I made sure that it was unmounted / ejected before trying anything – a_m0d – 2009-07-29T06:58:13.617
I don't know, can't reproduce it :\ I've tried the same sudo dd with iso9600 file, but didn't get the same result. Any additional info on the device and image used? – Kirill Strizhak – 2009-07-29T22:15:01.080
1The image was an eeebuntu-3.0.0-standard image - don't know who makes the device, but I think that it is Toshiba – a_m0d – 2009-07-29T23:02:15.837
1
From the VID/PID pair, it is made by "Alcor Micro Corp.", and is a "Transcend JetFlash Flash Drive". I use the list at http://www.linux-usb.org/usb.ids to look these things up.
– RBerteig – 2009-07-30T07:22:23.607This is a nifty little problem you have here. I'd upvote your question more than once if I could... – RBerteig – 2009-07-30T07:49:45.237
Yes, it is very interesting, because Linux refuses to let me write anything to the device - it is adamant that the device is read-only! I have zero-ed the whole thing with dd and yet none of that got written to the device! – a_m0d – 2009-07-30T08:41:33.797