lsblk 列出了 USB 闪存驱动器,但 fdisk/gparted 无法打开

lsblk 列出了 USB 闪存驱动器,但 fdisk/gparted 无法打开

背景:我想要将dd.iso 复制到该设备然后从它启动。

USB 闪存驱动器似乎已损坏。以下是我目前所知道的信息:输出dmesg | grep -i usb包含以下内容:

[ 7487.597557] usb 2-1.2: Product: Mass Storage Device
[ 7487.597560] usb 2-1.2: Manufacturer: JetFlash
[ 7487.597564] usb 2-1.2: SerialNumber: 09021000000000000890585749
[ 7487.597980] usb-storage 2-1.2:1.0: USB Mass Storage device detected
[ 7487.600249] scsi host15: usb-storage 2-1.2:1.0
[ 7579.925290] usb 2-1.2: reset high-speed USB device number 8 using ehci-pci

因此我假设该驱动器已被内核正确识别。同时还lsusb列出了该设备:

Bus 002 Device 008: ID 8564:1000 Transcend Information, Inc. JetFlash

还有lsblk

sdg      8:96   1  14.7G  0 disk 
└─sdg1   8:97   1  14.7G  0 part /media/pc/D89D-344C

该设备已自动挂载。为了使用 fdisk 打开它,我使用以下命令将其卸载umount /media/pc/D89D-344C

但是当我尝试使用 fdisk 对设备重新分区时sudo fdisk /dev/sdg出现错误:

fdisk: cannot open /dev/sdg: No such device or address

使用gparteddd会导致相同的错误消息。

编辑:我检查了内核日志dmesg -f kern -wH

连接设备时出现的日志。

[15677.249968] usb 2-1.2: new high-speed USB device number 11 using ehci-pci
[15677.347877] usb 2-1.2: New USB device found, idVendor=8564, idProduct=1000
[15677.347883] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[15677.347887] usb 2-1.2: Product: Mass Storage Device
[15677.347891] usb 2-1.2: Manufacturer: JetFlash
[15677.347894] usb 2-1.2: SerialNumber: 09021000000000000890585749
[15677.348361] usb-storage 2-1.2:1.0: USB Mass Storage device detected
[15677.350849] scsi host18: usb-storage 2-1.2:1.0
[15678.351408] scsi 18:0:0:0: Direct-Access     JetFlash Transcend 16GB   1.00 PQ: 0 ANSI: 5
[15678.352272] sd 18:0:0:0: Attached scsi generic sg6 type 0
[15678.353107] sd 18:0:0:0: [sdg] 30883840 512-byte logical blocks: (15.8 GB/14.7 GiB)
[15678.353772] sd 18:0:0:0: [sdg] Write Protect is off
[15678.353778] sd 18:0:0:0: [sdg] Mode Sense: 03 00 00 00
[15678.355509] sd 18:0:0:0: [sdg] No Caching mode page found
[15678.355517] sd 18:0:0:0: [sdg] Assuming drive cache: write through
[15678.361642]  sdg: sdg1
[15678.364016] sd 18:0:0:0: [sdg] Attached SCSI removable disk
[15678.575133] FAT-fs (sdg1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

然后执行umount会导致以下内核日志:

[15769.457966] usb 2-1.2: reset high-speed USB device number 11 using ehci-pci
[15800.488587] usb 2-1.2: reset high-speed USB device number 11 using ehci-pci
[15810.652140] usb 2-1.2: reset high-speed USB device number 11 using ehci-pci
[15826.815308] usb 2-1.2: reset high-speed USB device number 11 using ehci-pci
[15826.983416] usb 2-1.2: reset high-speed USB device number 11 using ehci-pci
[15837.146944] usb 2-1.2: reset high-speed USB device number 11 using ehci-pci
[15837.240453] sd 18:0:0:0: Device offlined - not ready after error recovery
[15837.240468] sd 18:0:0:0: [sdg] tag#0 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[15837.240475] sd 18:0:0:0: [sdg] tag#0 CDB: Write(10) 2a 00 00 00 08 01 00 00 01 00
[15837.240479] blk_update_request: I/O error, dev sdg, sector 2049
[15837.240485] Buffer I/O error on dev sdg1, logical block 1, lost async page write
[15837.240501] sd 18:0:0:0: rejecting I/O to offline device
[15837.240506] sd 18:0:0:0: killing request

希望这个问题可以解决。这是我的最后一个USB闪存盘。

感谢您的任何提示和想法。

答案1

确保/dev/sdg它是一个实际的设备节点。如果在连接磁盘之前意外创建了垃圾文件或链接,内核不会覆盖它。(而且您不会注意到,因为整个磁盘节点不用于挂载;只需要分区节点。)

运行ls -l /dev/sdg*并确保报告的“主要、次要”数字与“MAJ:MIN”列完全匹配lsblkb。(当然类型也需要。)

如果发现任何异常,只需将其删除;重新连接驱动器后将创建正确的设备节点。

相关内容