1

In the context of:

sudo dd if=/storeM/os-dvd.iso of=/dev/sdb bs=8M
sudo dd if=/storeM/bootdisk.img of=/dev/sdc

from:

Linux: Copy DVD ISO to empty hard disk / partition and boot as if it is a DVD?

What is a specific dd command which will write the Ubuntu ISO to an external hard drive?

The external SATA hard drive is connected with a USB adapter.

Is just one dd command required, or are two command necessary in this context? Aside from r/w speed, is there a functional distinction between a USB thumb driver here, versus that the hdd is in fact SATA?

The goal being to boot from the external hdd and install Ubuntu on the internal hard drive. (This PC is running 16.x, so looking for a clean install.)


From:

dd command to create bootable iso image of hard disk

it looks like, perhaps, mkisofs must be used first on the SATA external hdd before writing the ISO -- but I'm not sure.

Before connecting the external hdd, output of lsblk:

NAME                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0                    11:0    1  1024M  0 rom  
sda                     8:0    0   149G  0 disk 
├─sda2                  8:2    0     1K  0 part 
├─sda5                  8:5    0 148.5G  0 part 
│ ├─ubuntu--vg-swap_1 253:1    0     8G  0 lvm  [SWAP]
│ └─ubuntu--vg-root   253:0    0 140.5G  0 lvm  /
└─sda1                  8:1    0   487M  0 part /boot

and after:

NAME                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdf                     8:80   0 335.4G  0 disk 
├─sdf5                  8:85   0     4G  0 part 
├─sdf1                  8:81   0 331.4G  0 part /media/nicholas/3e798148-4333-4add-ba6c-f4272c17263e
└─sdf2                  8:82   0     1K  0 part 
sr0                    11:0    1  1024M  0 rom  
sda                     8:0    0   149G  0 disk 
├─sda2                  8:2    0     1K  0 part 
├─sda5                  8:5    0 148.5G  0 part 
│ ├─ubuntu--vg-swap_1 253:1    0     8G  0 lvm  [SWAP]
│ └─ubuntu--vg-root   253:0    0 140.5G  0 lvm  /
└─sda1                  8:1    0   487M  0 part /boot

so that sdf should be used with dd? Or sdf1 perhaps?

And, should the drive be unmounted first? I saw mention of this, but that makes no sense, as there'd then be no way to write to the drive.


the commands I'm looking at are:

sudo umount /dev/sdf1

dd bs=4M if=/home/nicholas/Downloads/ubuntu-20.10-desktop-amd64.iso of=/dev/sdf1 status=progress

although the umount seems a bit odd.


After running the above commands, and I tried both hd<letter><num> and hd<letter>, not able to boot from the external hdd.

From the console, the external hdd:

$ 
$ ls /media/nicholas/Ubuntu\ 20.10\ amd64/
boot  boot.catalog  casper  dists  EFI  install  md5sum.txt  pics  pool  preseed  README.diskdefines  ubuntu
$ 
$ head /media/nicholas/Ubuntu\ 20.10\ amd64/md5sum.txt 
b465ba8b742fd78bbc4ebe723cfaa6f4  ./dists/groovy/main/binary-amd64/Release
2e5d62033421377dcb2139c3fe3747bf  ./dists/groovy/main/binary-amd64/Packages.gz
8ce3f65089cccda8e73740147e72f75e  ./dists/groovy/main/binary-i386/Release
316c3582e4e7e6c1f4849c6ec289eae5  ./dists/groovy/main/binary-i386/Packages.gz
5b4060ef05e943ae4e897cd3fc61f68c  ./dists/groovy/restricted/binary-amd64/Release
d1005d9afd8a9535834e19cc0e643b28  ./dists/groovy/restricted/binary-amd64/Packages.gz
653b1f1c47f3ac060482837c958f729d  ./dists/groovy/restricted/binary-i386/Release
25184f6e9eebacaadf48da80cbe3407a  ./dists/groovy/restricted/binary-i386/Packages.gz
222742d7b5141bab6293eee4b2d42308  ./dists/groovy/Release
46c924df68103249edd11811a272b50a  ./dists/groovy/Release.gpg
$ 
$ lsblk
NAME                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb                     8:16   0 335.4G  0 disk 
├─sdb2                  8:18   0   4.9M  0 part 
├─sdb3                  8:19   0   300K  0 part 
└─sdb1                  8:17   0   2.8G  0 part /media/nicholas/Ubuntu 20.10 amd64
sr0                    11:0    1  1024M  0 rom  
sda                     8:0    0   149G  0 disk 
├─sda2                  8:2    0     1K  0 part 
├─sda5                  8:5    0 148.5G  0 part 
│ ├─ubuntu--vg-swap_1 253:1    0     8G  0 lvm  [SWAP]
│ └─ubuntu--vg-root   253:0    0 140.5G  0 lvm  /
└─sda1                  8:1    0   487M  0 part /boot
$ 

so, certainly dd wrote something to the SATA drive. But perhaps mkisofs must be used before dd?

  • 1
    3 rd time today same question. writing the iso to the drive does not make the drive bootable. questions should be edited not repeated over and over. – David Apr 22 '21 at 07:50
  • There are many types of ISO files, some require specific ways to write them (in order for them to boot), but writing to a thumb-drive, hdd, ssd, even magnetic tape is the same as you write to a device... That does not ensure it'll boot though... you've missed certain requirements from your question. – guiverc Apr 22 '21 at 07:55
  • it seems quite different @24601 that this is a hdd and not a flash drive. So far as I can tell, at least. – Nicholas Saunders Apr 22 '21 at 09:18
  • 1
    same meat, different gravy. – graham Apr 22 '21 at 09:19
  • perhaps so @24601 -- I'm trying some of the options you linked to. – Nicholas Saunders Apr 22 '21 at 09:21
  • If you have access to a Linux computer, the easiest and safest way to use dd to clone a Linux ISO to USB is to let Gnome-Disks do it. Open disks click the three line icon upper right and select Restore Disk Image. Then select the Ubuntu ISO as your Disk Image. Disks uses dd to do it's cloning. – C.S.Cameron Apr 22 '21 at 09:22
  • 2
    The target should be the drive, not a partition. So, sdf instead of sdf1. This will, of course, DELETE everything in the target drive. But again, this is the 3rd time and a waste of time for you and others. The Ubuntu installation ISOs are designed to be "burned" into DVDs or USB flash stick, NOT external HDDs. All it takes is known good 4GB stick and a simple tool, some mentioned in other answers. Using dd is playing with fire, one wrong letter and it'll destroy all the data in the (wrong) target. – ChanganAuto Apr 22 '21 at 09:23
  • Fair points @ChanganAuto that it's mickey mouse. From the linked q/a it sortof kinda almost boots. It took me a bit to find the right boot options in the BIOS. I'm not sure that the ISO was written over correctly. – Nicholas Saunders Apr 22 '21 at 10:02
  • yes, answer here: https://askubuntu.com/a/1173836/847449 works. – Nicholas Saunders Apr 23 '21 at 17:14

1 Answers1

2

Clone Ubuntu ISO to USB using dd

The obvious answer to this question is:

sudo umount /dev/sdX

sudo dd if=/path/to/ubuntu.iso of=/dev/sdX bs=4M && sync

Many people have had unpleasant experiences with dd, (me included). Gnome-Disks uses dd to do it's cloning from within a GUI.

If you have access to a Linux computer, the easiest and safest way to use dd to clone a Linux ISO to USB is to let Gnome-Disks do it.

Open disks click the three line icon upper right and select Restore Disk Image.

enter image description here

Then select the Ubuntu ISO as your Disk Image and select the external drive as Destination.

This will overwrite the entire external drive with a 2.8GB read only ISO9660 Live partition. The unused space can be converted to a FAT32 or NTFS partition. There will be no persistent partition

C.S.Cameron
  • 19,519