Native Linux
It is quote easy to copy an ISO file to a USB stick, and if the ISO is already 'bootable', so too will the USB. There are two tricks involved: one to find the device name of the USB, and the other is the copy command.
To find the device name, run the following command to watch what happens as the USB stick is inserted:
$ sudo tail -f /var/log/kern.log Nov 20 14:12:04 z800 kernel: [65065.953532] usb 7-5: new high-speed USB device number 3 using ehci-pci Nov 20 14:12:04 z800 kernel: [65066.185552] usb 7-5: New USB device found, idVendor=058f, idProduct=6387 Nov 20 14:12:04 z800 kernel: [65066.185556] usb 7-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Nov 20 14:12:04 z800 kernel: [65066.185558] usb 7-5: Product: Mass Storage Nov 20 14:12:04 z800 kernel: [65066.185559] usb 7-5: Manufacturer: Generic Nov 20 14:12:04 z800 kernel: [65066.185561] usb 7-5: SerialNumber: 026C5B24 Nov 20 14:12:04 z800 kernel: [65066.186095] usb-storage 7-5:1.0: USB Mass Storage device detected Nov 20 14:12:04 z800 kernel: [65066.186635] scsi host7: usb-storage 7-5:1.0 Nov 20 14:12:05 z800 kernel: [65067.212014] scsi 7:0:0:0: Direct-Access Generic Flash Disk 8.07 PQ: 0 ANSI: 2 Nov 20 14:12:05 z800 kernel: [65067.213013] sd 7:0:0:0: Attached scsi generic sg3 type 0 Nov 20 14:12:05 z800 kernel: [65067.214210] sd 7:0:0:0: [sdc] 4014080 512-byte logical blocks: (2.06 GB/1.91 GiB) Nov 20 14:12:05 z800 kernel: [65067.214955] sd 7:0:0:0: [sdc] Write Protect is off Nov 20 14:12:05 z800 kernel: [65067.214958] sd 7:0:0:0: [sdc] Mode Sense: 03 00 00 00 Nov 20 14:12:05 z800 kernel: [65067.215551] sd 7:0:0:0: [sdc] No Caching mode page found Nov 20 14:12:05 z800 kernel: [65067.215556] sd 7:0:0:0: [sdc] Assuming drive cache: write through Nov 20 14:12:05 z800 kernel: [65067.250236] sdc: sdc1 sdc2 Nov 20 14:12:05 z800 kernel: [65067.253546] sd 7:0:0:0: [sdc] Attached SCSI removable disk
The final lines show [sdc]. Use this in the next command. Be sure to use the correct device name, else you run the risk of over-writing something you really didn't want to. This uses the iso file as the input, and writes to the device as output with a 4MB block size.
$ sudo dd if=~/Downloads/iso/debian-testing-amd64-netinst.20161105.iso of=/dev/sdc bs=4M 71+1 records in 71+1 records out 300941312 bytes (301 MB, 287 MiB) copied, 38.0829 s, 7.9 MB/s
To confirm that the data is present, mount the physical device and check it out:
$ mkdir cd $ sudo mount /dev/sdc cd mount: /dev/sdc is write-protected, mounting read-only $ ls cd autorun.inf css dists efi g2ldr install isolinux pics README.html README.mirrors.txt README.txt tools boot debian doc firmware g2ldr.mbr install.amd md5sum.txt pool README.mirrors.html README.source setup.exe win32-loader.ini $ sudo umount cd $ rmdir cd
Cygwin
Cygwin needs to be started as an administrator.
Then run the following to determine partitions:
$ cat /proc/partitions major minor #blocks name win-mounts 8 0 125034840 sda 8 1 102400 sda1 8 2 124930048 sda2 C:\ 8 16 976762584 sdb 8 17 976759808 sdb1 D:\ 8 32 254336 sdc 8 33 253312 sdc1 E:\
Ensure you double confirm which drive you are sending this to, as it could overwrite your operating system or data!! A regular dd should then do the trick (here I have a too small usb key):
$ dd if=/cygdrive/d/Data/ISO/debian-9.2.1-amd64-netinst.iso of=/dev/sdc bs=4M dd: error writing '/dev/sdc': No space left on device 63+0 records in 62+0 records out 260440064 bytes (260 MB, 248 MiB) copied, 33.5776 s, 7.8 MB/s
The ArchLinux Wiki was used as a source of information for this.