You are not logged in.

#1 2017-05-02 23:45:17

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Getting that ISO to a USB stick

Or as earlybird says:

... we have options.  Obviously I jumped the gun.

Getting that ISO to a USB stick
- - Gleefully swiped from the old #! Wiki .. with some updates.

STEP 1
- CHECK THE md5sum or sha256sum before doing anything else once the ISO is downloaded.

One of the two, md5sum or sha265sum numbers should be available from the place you downloaded the file OR where you saw the link.

Either cd to the directory where you downloaded the .ISO file or use the full directory inthe command:

In this example johnraff gave us everything we need:

https://drive.google.com/file/d/0B7BNzoZbSUayODNJWGNkd3VRaU0/view?usp=sharing
live-image-i386-CD14.hybrid.iso
sha256sum: 7c755485a9d2f67b4a08ae05c23afa7e911ccb3e7f3118816a6b8606315f0d3b

So we're off to the races with:

 13 Apr 17 @ 14:20:44 ~
  $ sha256sum /media/10/BL_ISOs/live-image-i386-CD14.hybrid.iso
7c755485a9d2f67b4a08ae05c23afa7e911ccb3e7f3118816a6b8606315f0d3b  /media/10/BL_ISOs/live-image-i386-CD14.hybrid.iso

 13 Apr 17 @ 14:26:35 ~
  $

STEP 2
- Check where the USB stick is mounted after plugging it in:
COMMAND:

$ sudo ls -l /dev/disk/by-id/*usb*

WARNING: If <device> is /dev/sdb1, /dev/sdc1, /dev/sdd1, etc
DO NOT USE THE " NUMBER ":  use only the letter: /dev/sdb or /dev/sdc etc

Example:

  $ sudo ls -l /dev/disk/by-id/*usb*
lrwxrwxrwx 1 root root  9 Apr 13 12:27 /dev/disk/by-id/usb-Kingston_DataTraveler_2.0_001CC07CE9A2F96021550244-0:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 Apr 13 12:27 /dev/disk/by-id/usb-Kingston_DataTraveler_2.0_001CC07CE9A2F96021550244-0:0-part1 -> ../../sdb1

so I'll be using /dev/sdb in the following:

STEP 3a - USING  dd
COMMAND:

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

EXAMPLE:

sudo dd if=/media/10/BL_ISOs/live-image-i386-CD14.hybrid.iso of=/dev/sdb bs=4M;sync

STEP 3B - USING:  cat
- - Edited as per HoaS' post below - Thank you HoaS!
- - SEE STEP 2 for /dev/sdX

COMMAND:

sudo sh -c 'cat /path/to/file.iso > /dev/sdX; sync'

EXAMPLE:

sudo sh -c 'cat /media/10/BL_ISOs/live-image-i386-CD14.hybrid.iso > /dev/sdb; sync'

Also from HoaS: (Ref 3B) But it's a bit cumbersome compared to the alternatives
Obviously where I found this there were errors (I always use "dd")

STEP 3C - USING:  cp
- - SEE STEP 2 for /dev/sdX

COMMAND:

sudo cp /path/to/file.iso /dev/sdX;sync

EXAMPLE:

sudo cp /media/10/BL_ISOs/live-image-i386-CD14.hybrid.iso /dev/sdb;sync

NOTE: Be Careful  the DD command has the nickname "Disk Destroyer" for a reason!

Last edited by Sector11 (2017-05-03 16:27:12)


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#2 2017-05-03 06:24:36

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,068
Website

Re: Getting that ISO to a USB stick

Sector11 wrote:

STEP 3B - USING:  cat
- - SEE STEP 1 for /dev/sdX

COMMAND:

sudo cat /path/to/file.iso /dev/sdX; sync

EXAMPLE:

sudo cat /media/10/BL_ISOs/live-image-i386-CD14.hybrid.iso /dev/sdb; sync

This is not correct, you forgot to include the redirection.

Also, it's a bit tricky for `cat` because the elevated permissions conferred by the `sudo` command do not apply on the "other side" of the redirection.

This can be used:

sudo sh -c 'cat /media/10/BL_ISOs/live-image-i386-CD14.hybrid.iso > /dev/sdb; sync'

But it's a bit cumbersome compared to the alternatives hmm

I prefer `cp image.iso /dev/sdb;sync` (as root) smile

Last edited by Head_on_a_Stick (2017-05-03 06:26:13)

Offline

#3 2017-05-03 08:09:16

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: Getting that ISO to a USB stick

Good tips there.

I like to blow away the partition table using gdisk (x for expert mode then z) and add msdos partition table back in gparted then dd this way. No matter what usb this method gets it booting everytime for me.

sudo dd bs=4M if=/path/to/.iso of=/dev/sdx status=progress && sync

Last edited by Steve (2017-05-03 08:11:54)

Offline

#4 2017-05-03 16:15:44

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Getting that ISO to a USB stick

Head_on_a_Stick wrote:

But it's a bit cumbersome compared to the alternatives hmm

I prefer `cp image.iso /dev/sdb;sync` (as root) smile

Noted and OP edited to reflect changes.  Thank you.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#5 2017-05-03 16:23:42

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Getting that ISO to a USB stick

Oh dear ... missed that!  sad

Just that I have had this HowTo as a 'file' here forever!


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#6 2017-05-03 17:05:40

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,068
Website

Re: Getting that ISO to a USB stick

Steve wrote:

I like to blow away the partition table using gdisk (x for expert mode then z)

This is excellent advice smile

If the USB stick has been formatted with a GUID partition table then simply placing an ISO image on the device will leave the backup table intact and the USB stick will not boot.

@S11 encountered this issue here:

https://forums.bunsenlabs.org/viewtopic.php?id=3658

The gdisk program comes with a scripting tool that can be used to wipe all GPT traces in one command:

sudo sgdisk --zap-all /dev/sdX
Steve wrote:

add msdos partition table back in gparted

That step is absolutely unnecessary — an msdos partition table is contained entirely within the first 512 sectors of the disk and so will always be wiped over when copying an ISO image to the USB stick.

Offline

#7 2017-05-03 17:29:49

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Getting that ISO to a USB stick

I have to revist my thread, because while I have Bunsen on a USB stick and my BIOS (seems to be set up right) I cannot boot from the USB stick. If I enter the BIOS with the stick plugged in I find it under HDD directly after my WD500 entry.
- - wish I could grab a screenie.

Crazy thing is I've gone distro hopping with this desktop and never had a problem booting from USB sticks.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#8 2017-05-03 17:30:35

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,068
Website

Re: Getting that ISO to a USB stick

Sector11 wrote:

I cannot boot from the USB stick.

Then why is the thread marked [SOLVED]?

The USB stick is probably defective.

Offline

#9 2017-05-03 17:36:10

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Getting that ISO to a USB stick

Head_on_a_Stick wrote:

Then why is the thread marked [SOLVED]?

The USB stick is probably defective.

Because of the other problem that we cleared up with the USB entry showing up with no stick in place.

Does not matter what USB stick I use, none boot, but if I reformat and put videos or music on them - no problem - no the sticks are fine.  Even my oldest 2GB stick works fine, and you can't buy those today.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#10 2017-05-03 19:03:09

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,648

Re: Getting that ISO to a USB stick

^ and what is to be done with the old method after switching on the computer F8 or F12 (depending on the computer), in order to select and boot the stick in the appearing menu?

Offline

#11 2017-05-03 22:30:27

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Getting that ISO to a USB stick

First I've heard of it.  Might have to go that way ... time will tell.
But this machine used to boot USB Sticks just fine.  Trying to find out why not now.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#12 2017-05-03 22:31:28

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Getting that ISO to a USB stick

unklar wrote:

^ and what is to be done with the old method after switching on the computer F8 or F12 (depending on the computer), in order to select and boot the stick in the appearing menu?

Have tried F12 - doesn't work, will try F8.

EDIT: Neither F8 nor F12 work, computer still boots directly to GRUB.  sad

Last edited by Sector11 (2017-05-03 22:36:25)


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#13 2017-05-04 00:28:29

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: Getting that ISO to a USB stick

OFF TOPIC
------------
Not all is lost, I have some DVD's (R/W) here that I just tried:
inxi -d told me: /dev/sr0 is my CD/DVD Drive
BTW: Plug in a USB stick and it will tell you where that is as well.

 03 May 17 @ 20:53:44 ~
  $ growisofs  -dvd-compat -Z  /dev/sr0=/media/10/BL_ISOs/live-image-amd64-170411.hybrid.iso
WARNING: /dev/sr0 already carries isofs!
About to execute 'builtin_dd if=/media/10/BL_ISOs/live-image-amd64-170411.hybrid.iso of=/dev/sr0 obs=32k seek=0'
/dev/sr0: restarting DVD+RW format...
/dev/sr0: "Current Write Speed" is 4.1x1352KBps.
   16744448/895483904 ( 1.9%) @3.4x, remaining 2:37 RBU 100.0% UBU   2.9%
   35258368/895483904 ( 3.9%) @4.0x, remaining 2:50 RBU 100.0% UBU 100.0%
   53739520/895483904 ( 6.0%) @4.0x, remaining 2:36 RBU 100.0% UBU 100.0%
   72253440/895483904 ( 8.1%) @4.0x, remaining 2:28 RBU 100.0% UBU 100.0%
   90734592/895483904 (10.1%) @4.0x, remaining 2:30 RBU 100.0% UBU 100.0%
  109248512/895483904 (12.2%) @4.0x, remaining 2:23 RBU 100.0% UBU 100.0%
  127762432/895483904 (14.3%) @4.0x, remaining 2:18 RBU  99.9% UBU 100.0%
  146243584/895483904 (16.3%) @4.0x, remaining 2:18 RBU 100.0% UBU 100.0%
  164757504/895483904 (18.4%) @4.0x, remaining 2:13 RBU 100.0% UBU 100.0%
  183271424/895483904 (20.5%) @4.0x, remaining 2:08 RBU  99.9% UBU 100.0%
  201752576/895483904 (22.5%) @4.0x, remaining 2:07 RBU 100.0% UBU 100.0%
  220266496/895483904 (24.6%) @4.0x, remaining 2:02 RBU 100.0% UBU 100.0%
  238780416/895483904 (26.7%) @4.0x, remaining 1:58 RBU 100.0% UBU 100.0%
  257261568/895483904 (28.7%) @4.0x, remaining 1:56 RBU 100.0% UBU 100.0%
  275775488/895483904 (30.8%) @4.0x, remaining 1:52 RBU 100.0% UBU 100.0%
  294289408/895483904 (32.9%) @4.0x, remaining 1:48 RBU 100.0% UBU 100.0%
  312770560/895483904 (34.9%) @4.0x, remaining 1:46 RBU 100.0% UBU 100.0%
  331284480/895483904 (37.0%) @4.0x, remaining 1:42 RBU 100.0% UBU 100.0%
  349798400/895483904 (39.1%) @4.0x, remaining 1:38 RBU 100.0% UBU 100.0%
  368312320/895483904 (41.1%) @4.0x, remaining 1:35 RBU 100.0% UBU 100.0%
  386793472/895483904 (43.2%) @4.0x, remaining 1:32 RBU 100.0% UBU 100.0%
  405307392/895483904 (45.3%) @4.0x, remaining 1:28 RBU 100.0% UBU 100.0%
  423821312/895483904 (47.3%) @4.0x, remaining 1:25 RBU  99.9% UBU 100.0%
  442302464/895483904 (49.4%) @4.0x, remaining 1:21 RBU 100.0% UBU 100.0%
  460816384/895483904 (51.5%) @4.0x, remaining 1:18 RBU 100.0% UBU 100.0%
  479330304/895483904 (53.5%) @4.0x, remaining 1:15 RBU 100.0% UBU 100.0%
  497811456/895483904 (55.6%) @4.0x, remaining 1:11 RBU 100.0% UBU 100.0%
  516325376/895483904 (57.7%) @4.0x, remaining 1:08 RBU 100.0% UBU 100.0%
  534839296/895483904 (59.7%) @4.0x, remaining 1:05 RBU 100.0% UBU 100.0%
  553353216/895483904 (61.8%) @4.0x, remaining 1:01 RBU  99.7% UBU 100.0%
  571867136/895483904 (63.9%) @4.0x, remaining 0:58 RBU 100.0% UBU 100.0%
  590381056/895483904 (65.9%) @4.0x, remaining 0:55 RBU 100.0% UBU 100.0%
  608862208/895483904 (68.0%) @4.0x, remaining 0:51 RBU 100.0% UBU 100.0%
  627376128/895483904 (70.1%) @4.0x, remaining 0:48 RBU 100.0% UBU 100.0%
  645890048/895483904 (72.1%) @4.0x, remaining 0:45 RBU 100.0% UBU 100.0%
  664403968/895483904 (74.2%) @4.0x, remaining 0:41 RBU 100.0% UBU 100.0%
  682917888/895483904 (76.3%) @4.0x, remaining 0:38 RBU 100.0% UBU 100.0%
  701431808/895483904 (78.3%) @4.0x, remaining 0:35 RBU 100.0% UBU 100.0%
  719945728/895483904 (80.4%) @4.0x, remaining 0:31 RBU  99.9% UBU 100.0%
  738426880/895483904 (82.5%) @4.0x, remaining 0:28 RBU 100.0% UBU 100.0%
  756940800/895483904 (84.5%) @4.0x, remaining 0:25 RBU 100.0% UBU 100.0%
  775454720/895483904 (86.6%) @4.0x, remaining 0:21 RBU 100.0% UBU 100.0%
  793935872/895483904 (88.7%) @4.0x, remaining 0:18 RBU 100.0% UBU 100.0%
  812449792/895483904 (90.7%) @4.0x, remaining 0:15 RBU 100.0% UBU 100.0%
  830963712/895483904 (92.8%) @4.0x, remaining 0:11 RBU 100.0% UBU 100.0%
  849477632/895483904 (94.9%) @4.0x, remaining 0:08 RBU 100.0% UBU 100.0%
  867991552/895483904 (96.9%) @4.0x, remaining 0:04 RBU  81.9% UBU 100.0%
  886505472/895483904 (99.0%) @4.0x, remaining 0:01 RBU  26.8% UBU 100.0%
builtin_dd: 437248*2KB out @ average 4.0x1352KBps
/dev/sr0: flushing cache
/dev/sr0: writing lead-out
/dev/sr0: reloading tray

 03 May 17 @ 20:58:12 ~
  $

Time to reboot and: 2017-05-04-00-13-01_scrot.th.png
OK, Live session works.  Tomorrow I put it to metal.

Still not booting USB though.  sad
-----------
ON TOPIC


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#14 2017-05-04 08:02:49

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: Getting that ISO to a USB stick

Head_on_a_Stick wrote:
Steve wrote:

add msdos partition table back in gparted

That step is absolutely unnecessary — an msdos partition table is contained entirely within the first 512 sectors of the disk and so will always be wiped over when copying an ISO image to the USB stick.

I had a feeling that maybe the case, i got this info from someone on the manjaro forums, maybe it was just an additional and had nothing to do with booting with the usb.

Didnt know about the zap all command, putting all this in my notes, thanks once again Hoas.

Last edited by Steve (2017-05-04 08:07:15)

Offline

Board footer

Powered by FluxBB