Create Bootable Ubuntu ISO – dd Command Issues and Solutions

arch linuxddlive-usbusb

I run dd to create bootable Ubuntu but it won't make it bootable. Instead it returns instantly without creating anything as I see. When I point partition, sda1 it writes data to it but the usb won't boot the system. Also sudo fdisk -l does not list the usb but lsblk does. How to make bootable usb with 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.

Update, 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 type: USB 3.1 Gen 1 port. It is Dell Latitude 5401.

Tried two USB flash drives. Both does not work.

Update 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

Best Answer

You've got a file as /dev/sda not a device, so when you write to /dev/sda you're overwriting the file. With your NVMe disk this explains why writing speed is so high.

Remove the file /dev/sda, unplug and replug the USB stick. Check that /dev/sda is now a block device (first character from ls -l is b) rather than a file (first character -), like this:

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

How did this happen? It's possible you first tried to write to the device before it had been plugged in, so the device node hadn't yet been created. Thereafter the presence of the file prevented the device from being created.

Related Question