我使用 Xubuntu iso 创建了一个可启动 USB(实际上是在 Mac 上使用 BalenEtcher 制作的),但我从未替换过我的 Ubuntu,所以现在我想让 USB 不再可启动。
我按照标准步骤,找到磁盘fdisk -l
Disk /dev/sdb: 7,24 GiB, 7763656704 bytes, 15163392 sectors
Disk model:
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5dbde0fb
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 64 2988159 2988096 1,4G 17 Hidden HPFS/NTFS
使用 卸载它umount /dev/sdb
,即使它看起来已经被卸载
umount: /dev/sdb: not mounted.
然后尝试使用格式化mkfs.vfat -n "name" -I /dev/sdb
,获得
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mkfs.vfat: unable to open /dev/sdb: Device or resource busy
我在网上看到很多类似的问题,如何格式化只读 iso9660 USB 驱动器,添加 ISO 后,USB 磁盘卡在只读状态,无法以读写方式打开 /dev/sdb(只读文件系统),但没有一个能为我的问题提供答案/解决方案。我尝试使用 gparted,但无法删除分区,因为命令显示为灰色,尝试格式化时,我再次收到消息“只读...”
磁盘不再带来好运
我听到有人说 USB 因为这种“只读模式”而“丢失”、“损坏”,但我不明白制作 OS 可启动 USB 的过程怎么会毁掉 U 盘,即使是在 Mac 上(我不会再犯同样的错误)。有人有想法吗?
编辑@Matigo 解决方案:
按照@Matigo 的解决方案,在我的案例中会出现以下错误
编辑@Stormlord 解决方案:
即使按照这些步骤操作,我仍然遇到问题,因为 Xubuntu 仍然存在。我执行了以下代码:su -
:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 9,1M 1 loop /snap/canonical-livepatch/95
loop1 7:1 0 219M 1 loop /snap/gnome-3-34-1804/66
loop2 7:2 0 55,4M 1 loop /snap/core18/1944
loop3 7:3 0 62,1M 1 loop /snap/gtk-common-themes/1506
loop4 7:4 0 55M 1 loop /snap/core18/1754
loop6 7:6 0 217,9M 1 loop /snap/gnome-3-34-1804/60
loop7 7:7 0 64,8M 1 loop /snap/gtk-common-themes/1514
loop9 7:9 0 49,8M 1 loop /snap/snap-store/467
loop10 7:10 0 31,1M 1 loop /snap/snapd/10492
loop11 7:11 0 97,9M 1 loop /snap/core/10577
loop12 7:12 0 51M 1 loop /snap/snap-store/518
loop13 7:13 0 31,1M 1 loop /snap/snapd/10707
loop14 7:14 0 97,9M 1 loop /snap/core/10583
sda 8:0 0 465,8G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 465,3G 0 part /
sdb 8:16 1 7,2G 0 disk
└─sdb1 8:17 1 1,4G 0 part /media/opisthofulax/Xubuntu 18.04.4 LTS i386
:~# umount /dev/sdb1
:~# sudo dd if=/dev/zero of=/dev/sdb1 bs=4M count=1
1+0 records in
1+0 records out
4194304 bytes (4,2 MB, 4,0 MiB) copied, 0,5299 s, 7,9 MB/s
:~# umount /dev/sdb1
:~# sudo dd if=/dev/zero of=/dev/sdb1 bs=4M count=1
1+0 records in
1+0 records out
4194304 bytes (4,2 MB, 4,0 MiB) copied, 0,522972 s, 8,0 MB/s
:~#
然后继续使用 gparted,但没有结果
编辑 dmesg 输出:
我将发布一小部分(因为基本上它是在重复相同的消息)输出dmesg
,谁知道它是否有用......
[ 1450.196085] usb 1-1: USB disconnect, device number 5
[ 1461.321884] usb 1-1: new high-speed USB device number 6 using xhci_hcd
[ 1461.476270] usb 1-1: New USB device found, idVendor=058f, idProduct=6387, bcdDevice= 1.02
[ 1461.476275] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1461.476278] usb 1-1: SerialNumber: 11121959030800
[ 1461.480766] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 1461.481361] scsi host2: usb-storage 1-1:1.0
[ 1462.515384] scsi 2:0:0:0: Direct-Access 8.07 PQ: 0 ANSI: 2
[ 1462.520476] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 1462.520955] sd 2:0:0:0: [sdb] 15163392 512-byte logical blocks: (7.76 GB/7.23 GiB)
[ 1462.521104] sd 2:0:0:0: [sdb] Write Protect is off
[ 1462.521108] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 1462.521424] sd 2:0:0:0: [sdb] No Caching mode page found
[ 1462.521431] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 1462.550861] sdb: sdb1
[ 1462.553046] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 1587.022776] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 1587.022781] sd 2:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[ 1587.022786] sd 2:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[ 1587.022790] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 00 00 00 00 00 08 00
[ 1587.022794] blk_update_request: I/O error, dev sdb, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 0
...
[ 9919.920261] print_req_error: 1 callbacks suppressed
[ 9919.920264] blk_update_request: critical target error, dev sdb, sector 0 op 0x1:(WRITE) flags 0x4800 phys_seg 30 prio class 0
[ 9919.920269] buffer_io_error: 247 callbacks suppressed
[ 9919.920271] Buffer I/O error on dev sdb, logical block 0, lost async page write
[ 9919.920279] Buffer I/O error on dev sdb, logical block 1, lost async page write
[ 9919.920283] Buffer I/O error on dev sdb, logical block 2, lost async page write
[ 9919.920286] Buffer I/O error on dev sdb, logical block 3, lost async page write
[ 9919.920289] Buffer I/O error on dev sdb, logical block 4, lost async page write
[ 9919.920293] Buffer I/O error on dev sdb, logical block 5, lost async page write
[ 9919.920296] Buffer I/O error on dev sdb, logical block 6, lost async page write
[ 9919.920299] Buffer I/O error on dev sdb, logical block 7, lost async page write
[ 9919.920302] Buffer I/O error on dev sdb, logical block 8, lost async page write
[ 9919.920306] Buffer I/O error on dev sdb, logical block 9, lost async page write
[ 9919.922267] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9919.922272] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9919.922276] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9919.922280] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 00 00 f0 00 00 f0 00
[ 9919.922284] blk_update_request: critical target error, dev sdb, sector 240 op 0x1:(WRITE) flags 0x4800 phys_seg 30 prio class 0
[ 9919.924093] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9919.924098] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9919.924101] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9919.924105] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 00 01 e0 00 00 f0 00
[ 9919.924109] blk_update_request: critical target error, dev sdb, sector 480 op 0x1:(WRITE) flags 0x4800 phys_seg 30 prio class 0
[ 9919.925905] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9919.925910] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9919.925913] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9919.925918] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 00 02 d0 00 00 f0 00
[ 9919.925922] blk_update_request: critical target error, dev sdb, sector 720 op 0x1:(WRITE) flags 0x4800 phys_seg 30 prio class 0
[ 9919.926359] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9919.926362] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9919.926365] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9919.926368] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 00 03 c0 00 00 40 00
[ 9919.926371] blk_update_request: critical target error, dev sdb, sector 960 op 0x1:(WRITE) flags 0x800 phys_seg 8 prio class 0
[ 9919.926792] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9919.926795] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9919.926798] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9919.926801] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 02 00 00 00 00 08 00
[ 9919.926804] blk_update_request: critical target error, dev sdb, sector 131072 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 0
[ 9919.927234] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9919.927238] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9919.927241] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9919.927244] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 e7 5c 00 00 00 f0 00
[ 9919.927247] blk_update_request: critical target error, dev sdb, sector 15162368 op 0x1:(WRITE) flags 0x4800 phys_seg 30 prio class 0
[ 9919.927701] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9919.927705] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9919.927709] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9919.927714] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 e7 5c f0 00 00 f0 00
[ 9919.927718] blk_update_request: critical target error, dev sdb, sector 15162608 op 0x1:(WRITE) flags 0x4800 phys_seg 30 prio class 0
[ 9919.928214] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9919.928218] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9919.928222] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9919.928227] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 e7 5d e0 00 00 f0 00
[ 9919.928230] blk_update_request: critical target error, dev sdb, sector 15162848 op 0x1:(WRITE) flags 0x4800 phys_seg 30 prio class 0
[ 9919.929055] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9919.929062] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9919.929066] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9919.929071] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 e7 5e d0 00 00 f0 00
[ 9919.929075] blk_update_request: critical target error, dev sdb, sector 15163088 op 0x1:(WRITE) flags 0x4800 phys_seg 30 prio class 0
[ 9947.621089] scsi_io_completion_action: 4 callbacks suppressed
[ 9947.621097] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 9947.621101] sd 2:0:0:0: [sdb] tag#0 Sense Key : Data Protect [current]
[ 9947.621105] sd 2:0:0:0: [sdb] tag#0 Add. Sense: Write protected
[ 9947.621109] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 00 00 00 00 00 f0 00
...
11255.601271] blk_update_request: critical target error, dev sdb, sector 2224 op 0x1:(WRITE) flags 0x4800 phys_seg 30 prio class 0
[11262.748255] sd 2:0:0:0: [sdb] Write Protect is on
[11262.748260] sd 2:0:0:0: [sdb] Mode Sense: 03 00 80 00
[11262.754520] sdb: sdb1 sdb2
[11417.161801] sdb: sdb1 sdb2
[11647.372486] usb 1-2.2: USB disconnect, device number 27
[11654.197528] usb 1-2.2: new high-speed USB device number 28 using xhci_hcd
[11654.304292] usb 1-2.2: New USB device found, idVendor=058f, idProduct=6387, bcdDevice= 1.02
[11654.304307] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11654.304317] usb 1-2.2: SerialNumber: 11121959030800
[11654.310561] usb-storage 1-2.2:1.0: USB Mass Storage device detected
[11654.311453] scsi host2: usb-storage 1-2.2:1.0
[11655.327639] scsi 2:0:0:0: Direct-Access 8.07 PQ: 0 ANSI: 2
[11655.334753] sd 2:0:0:0: Attached scsi generic sg1 type 0
[11655.336948] sd 2:0:0:0: [sdb] 15163392 512-byte logical blocks: (7.76 GB/7.23 GiB)
[11655.337096] sd 2:0:0:0: [sdb] Write Protect is off
[11655.337100] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
[11655.337255] sd 2:0:0:0: [sdb] No Caching mode page found
[11655.337261] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[11655.362527] sdb: sdb1
[11655.363859] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[11656.089711] ISO 9660 Extensions: Microsoft Joliet Level 3
[11656.091320] ISO 9660 Extensions: Microsoft Joliet Level 3
[11656.092591] ISO 9660 Extensions: RRIP_1991A
[11682.343675] sdb: sdb1
[11694.117274] scsi_io_completion_action: 25 callbacks suppressed
[11694.117301] sd 2:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[11694.117320] sd 2:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[11694.117344] sd 2:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[11694.117361] sd 2:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 00 00 00 00 00 00 08 00
[11694.117369] print_req_error: 25 callbacks suppressed
[11694.117381] blk_update_request: I/O error, dev sdb, sector 0 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[11694.117401] buffer_io_error: 1014 callbacks suppressed
[11694.117407] Buffer I/O error on dev sdb, logical block 0, lost async page write
[11694.133024] sd 2:0:0:0: [sdb] Write Protect is on
[11694.133029] sd 2:0:0:0: [sdb] Mode Sense: 03 00 80 00
[11694.142200] sdb: sdb1 sdb2
[11694.158028] sdb: sdb1 sdb2
[12260.204498] ISO 9660 Extensions: Microsoft Joliet Level 3
[12260.206286] ISO 9660 Extensions: RRIP_1991A
[12359.052413] usb 1-2.2: USB disconnect, device number 28
[12415.388939] usb 1-2.2: new high-speed USB device number 29 using xhci_hcd
[12415.496543] usb 1-2.2: New USB device found, idVendor=058f, idProduct=6387, bcdDevice= 1.02
[12415.496555] usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[12415.496563] usb 1-2.2: SerialNumber: 11121959030800
[12415.501755] usb-storage 1-2.2:1.0: USB Mass Storage device detected
[12415.504050] scsi host3: usb-storage 1-2.2:1.0
[12416.527481] scsi 3:0:0:0: Direct-Access 8.07 PQ: 0 ANSI: 2
[12416.531663] sd 3:0:0:0: Attached scsi generic sg1 type 0
[12416.532908] sd 3:0:0:0: [sdc] 15163392 512-byte logical blocks: (7.76 GB/7.23 GiB)
[12416.533165] sd 3:0:0:0: [sdc] Write Protect is off
[12416.533176] sd 3:0:0:0: [sdc] Mode Sense: 03 00 00 00
[12416.533414] sd 3:0:0:0: [sdc] No Caching mode page found
[12416.533431] sd 3:0:0:0: [sdc] Assuming drive cache: write through
答案1
当存储设备被锁定在只读模式时,通常是因为出现了硬件故障。设置为只读模式可以降低在重要数据恢复之前造成更多损害的风险。也就是说,除非您使用的是较旧的三星或金士顿 USB 记忆棒(通常是这种情况),否则只读模式可能是误报。
让我们尝试解锁驱动器:
打开终端(如果尚未打开)
类型:
sudo hdparm -r0 /dev/sdb
这应该会解锁设备,允许对其进行写入。现在让我们转到磁盘。
在磁盘中:
- 选择要格式化的设备(
/dev/sdb
在本例中) - 按Ctrl+F调出“格式”对话框
- 点击“格式化”
格式化完成后,您的设备将显示为完全未分配的空间。现在您可以按 [+] 按钮创建一个分区,然后根据需要对其进行格式化。
希望这能解决问题。
答案2
以下步骤应该可以解决问题。
- 确保 USB 存储设备未安装。
- 打开终端并输入:
sudo dd if=/dev/zero of=/dev/sdX bs=4M count=1
。替换X替换为实际的驱动器号。确保它是正确的,因为如果不正确,您将不可逆转地删除另一个驱动器。 - 完成此操作后,您应该会得到一个完全空的 USB 盘。运行
gparted
并创建新的mbr/ms-dos或者通用运输磁盘使用设备菜单。 - 在 USB 上创建您需要的分区。