I think I have pre-maturely ejected USB during a write operation. Currently I'm trying to use this USB image to write another USB image to it, so whether all the data gets erased from it does not matter.
Whenever I try to dd
disk with zeroes, or do any other operation I get error similar to the following:
$ sudo dd if=/dev/zero of=/dev/sdb bs=4096
dd: failed to open '/dev/sdb': Read-only file system
So /dev/sdb
(USB) has some problems.
Furthermore, fstab displays remount-ro, indicating that there is some filesystem inconsistency on the drive.
UUID=xxxx / ext4 errors=remount-ro 0 1
And when I run fsck on /dev/sdb
,
$ sudo fsck -fn /dev/sdb1
fsck from util-linux 2.34
fsck.fat 4.1 (2017-01-24)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
Automatically removing dirty bit.
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
3:53/6d, 4:59/6b, 5:53/66, 6:4c/73, 7:49/2e, 8:4e/66, 9:55/61, 10:58/74
----- about 30 lines of diff emitted -----
Not automatically fixing this.
/sources/install.wim
File size is 1655058432 bytes, cluster chain length is > 1655062528 bytes.
Truncating file to 1655058432 bytes.
Free cluster summary wrong (1643786 vs. really 1642747)
Auto-correcting.
Leaving filesystem unchanged.
/dev/sdb1: 1086 files, 249673/1892420 clusters
I somewhat understand what the problem is, but I have no idea what to do to fix it. For starters I don't know why dd would care about filesystem problems on the device.
Update: dmesg
[91449.265958] scsi 5:0:0:0: Direct-Access ADATA USB Flash Drive 1100 PQ: 0 ANSI: 4
[91449.266247] sd 5:0:0:0: Attached scsi generic sg2 type 0
[91449.304557] sd 5:0:0:0: [sdb] Attached SCSI removable disk
[91449.304927] sd 5:0:0:0: [sdb] 30310400 512-byte logical blocks: (15.5 GB/14.5 GiB)
[91449.305336] sd 5:0:0:0: [sdb] Write Protect is on
[91449.305338] sd 5:0:0:0: [sdb] Mode Sense: 43 00 80 00
[91449.305768] sdb: detected capacity change from 0 to 30310400
[91449.306875] sdb: sdb1
[sdb] Write Protect is on
that pretty much indicates it's bricked. There might be a slim chance that you can unbrick it by using some utility that toggles the SCSI Write Protect bit, but I doubt you can succeed anyway.