背景:我想要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
使用gparted
或dd
會產生相同的錯誤訊息。
編輯:我檢查了內核日誌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”列完全匹配LSBLK。 (b
當然,類型也需要是。)
如果您發現任何奇怪的東西,請將其刪除;重新連接驅動器後將建立正確的設備節點。