我运行dd
创建可启动的 Ubuntu,但它不会使其可启动。相反,正如我所见,它会立即返回,而不会创建任何内容。当我指向分区时,sda1
它会向其中写入数据,但 USB 无法启动系统。也sudo fdisk -l
没有列出 USB,但lsblk
确实列出了。如何制作U盘启动盘dd
?
[I] ➜ uname --all
Linux artpc 5.3.7-arch1-1-ARCH #1 SMP PREEMPT Fri Oct 18 00:17:03 UTC 2019 x86_64 GNU/Linux
~
[I] ➜ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 14.7G 0 disk
└─sda1 8:1 1 14.7G 0 part
nvme0n1 259:0 0 477G 0 disk
├─nvme0n1p1 259:1 0 680M 0 part /boot
├─nvme0n1p2 259:2 0 475.3G 0 part
│ └─cryptroot 254:0 0 475.3G 0 crypt /
└─nvme0n1p4 259:3 0 990M 0 part
~
[I] ➜ sudo fdisk -l
[sudo] password for art:
Disk /dev/nvme0n1: 476.96 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: KXG60ZNV512G NVMe TOSHIBA 512GB
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: gpt
Disk identifier: 246817B2-7F93-4723-8F53-B499C07511A3
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1394687 1392640 680M EFI System
/dev/nvme0n1p2 1394688 998158335 996763648 475.3G Linux filesystem
/dev/nvme0n1p4 998158336 1000185855 2027520 990M Windows recovery environment
Disk /dev/mapper/cryptroot: 475.29 GiB, 510326210560 bytes, 996730880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
~ took 5s
~
[N] ➜ sudo dd if=/home/art/Downloads/TriblerDownloads/ubuntu-19.10-desktop-amd64.iso of=/dev/sda bs=4M status=progress
587+1 records in
587+1 records out
2463842304 bytes (2.5 GB, 2.3 GiB) copied, 0.728635 s, 3.4 GB/s
~
[I] ➜ pgrep dd -l
# No dd here.
更新,dmesg:
[167395.353737] usb 2-1: new SuperSpeed Gen 1 USB device number 8 using xhci_hcd
[167395.376079] usb 2-1: New USB device found, idVendor=8564, idProduct=1000, bcdDevice=11.00
[167395.376084] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[167395.376088] usb 2-1: Product: Mass Storage Device
[167395.376091] usb 2-1: Manufacturer: JetFlash
[167395.376094] usb 2-1: SerialNumber: 25KD7JEKLN6J409K
[167395.379692] usb-storage 2-1:1.0: USB Mass Storage device detected
[167395.380037] scsi host3: usb-storage 2-1:1.0
[167396.745065] scsi 3:0:0:0: Direct-Access JetFlash Transcend 16GB 1100 PQ: 0 ANSI: 6
[167396.746488] sd 3:0:0:0: [sda] 30851072 512-byte logical blocks: (15.8 GB/14.7 GiB)
[167396.747105] sd 3:0:0:0: [sda] Write Protect is off
[167396.747111] sd 3:0:0:0: [sda] Mode Sense: 43 00 00 00
[167396.747634] sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[167396.751767] sda: sda1
[167396.754816] sd 3:0:0:0: [sda] Attached SCSI removable disk
USB 类型:USB 3.1 Gen 1 端口。它是戴尔 Latitude 5401。
尝试了两个 USB 闪存驱动器。两者都不起作用。
更新2。
ls -l /dev/sda*
-rw-r--r-- 1 root root 2463842304 Nov 2 16:48 /dev/sda
brw-rw---- 1 root disk 8, 1 Nov 2 17:03 /dev/sda1
答案1
您拥有一个文件而/dev/sda
不是设备,因此当您写入时,/dev/sda
您将覆盖该文件。这解释了为什么 NVMe 磁盘的写入速度如此之高。
删除文件/dev/sda
,拔下并重新插入 USB 记忆棒。检查/dev/sda
现在是块设备(第一个字符ls -l
是b
)而不是文件(第一个字符-
),如下所示:
brw-rw---- 1 root disk 8, 0 Nov 2 17:03 /dev/sda
brw-rw---- 1 root disk 8, 1 Nov 2 17:03 /dev/sda1
这怎么发生的?您可能在插入设备之前首先尝试写入设备,因此设备节点尚未创建。此后,该文件的存在阻止了设备的创建。