LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   dd command to make bootable USB (https://www.linuxquestions.org/questions/linux-software-2/dd-command-to-make-bootable-usb-4175625440/)

pablo27 03-12-2018 08:24 PM

dd command to make bootable USB
 
I am using Linux Mint 17.2, and 18.3(different Machine) and am trying to use the dd command to burn iso to USB. I have tried formatting the USB first, and not formatting the usb, I made a hybrid iso and tried that and when I look at the USB in Dolphin there is nothing there or it doesn't show up at all, or I get about 10 lines of errors about mounting the usb. Here are the things I have tried:

sudo fdisk -l
1038 cd Downloads
1039 sudo dd if=linux-lite-3.8-32bit.iso of=/dev/sdg bs=4M
1040 kdesudo dolphin
1041 history
1042 sudo fdisk -l
1043 kdesudo dolphin
1044 umount /dev/sdg
1045 sudo fdisk -l
1046 sudo dd if=linux-lite-3.8-32bit.iso of=/dev/sdg bs=4M


1081 sudo fdisk -l
1082 sudo dd if=/Downloads/linux-lite-3.8-32bit.iso of=/dev/sdg
1083 pwd
1084 sudo dd if=/home/pablo/Downloads/linux-lite-3.8-32bit.iso of=/dev/sdg
1085 sudo fdisk -l
1086 sudo dd if=/home/pablo/Downloads/linux-lite-3.8-32bit.iso of=/dev/sdg
1087 sudo apt-get install syslinux
1088 cd Downloads
1089 isohybrid linux-lite-3.8-32bit.iso
1090 cd
1091 pwd
1092 sudo fdisk -l
1093 sudo dd if=/home/pablo/Downloads/linux-lite-3.8-32bit.iso of=/dev/sdg
1094 kdesudo dolphin
1095 history
1096 pw
1097 history
1098 sudo fdisk -l
1099 sudo dd if=/home/pablo/Downloads/linux-lite-3.8-32bit-Hybrid.iso of=/dev/sdg


I realize there are other ways(?) to do this but I am working on learning Linux and I want to learn to do this this way.
Thank you in advance for any and all help and for your time.

Paul

BW-userx 03-12-2018 08:38 PM

what is /dev/sdg, you got that many usb ports? if it is correct then go with it.

Code:

lsblk // to get your usb port with your usb stick plugged in.
//being inside of the same directory the iso is at.

sudo dd if=mint.iso of=/dev/sdx && sync

that's always worked for me, and the 'x' indicates the letter a,b,c etc.

make sure the usb stick is NOT mounted. Just plug it in and do not use a file manager or anything to read it first. get its address using lsblk and then issue the commands to dd to it. reboot and do your thing to select it on boot to boot into it to see if that worked. you do not have to go through the install process, ( said for that just in case )

rtmistler 03-13-2018 08:08 AM

bw-userx is correct, but also to note that you were correct with the form of the command you entered a few times as shown in your history. Perhaps you did get the path to your USB stick incorrectly, perhaps the ISO file you have is not a boot capable one, or perhaps the ISO file you downloaded is flawed or has some other problem. Most Linux distributions provide an MD5 sum to check the ISO file and verify you have downloaded it all, and downloaded it correctly.

My only guess is that you did perform the sudo dd if=<filename>.iso /dev/sd<drive-letter> and it did not result in a bootable USB?

ondoho 03-13-2018 02:02 PM

your commands used look ok.
and yes, the usb should NOT be mounted when you do that.

Quote:

Originally Posted by pablo27 (Post 5830282)
when I look at the USB in Dolphin there is nothing there or it doesn't show up at all

this is correct; the usb does not contain a conventional filesystem, it is supposed to be booted.

pablo27 03-13-2018 02:17 PM

Thank you all so much for the rapid replies. I am not totally new to linux, I have been using it for a long time. I always check the midsum on my downloads. Don't know why it came up with /dev/sdg, since fdisk gave me that I just went with it. I think the problem was in formating it then checking it with dolphin or Kde partition manager, hence it was mounted. I tried unmounting before running dd and it worked. The other thing is it never showed up in dolphin even though it was a working USB??? Thank you all again, I wanted a bootable USB so I could copy some files off a windows laptop that wouldn't boot.

Paul

jefro 03-13-2018 04:55 PM

"I made a hybrid iso " What exactly do you mean here?

AwesomeMachine 03-13-2018 06:28 PM

I'm pretty sure most distro install isos are hybrid. That just means the iso will boot off an optical disk or a USB flash drive.

jefro 03-13-2018 07:28 PM

To the OP.
Did you take some iso and modify it to make the statement "I made a hybrid iso "?

pablo27 03-14-2018 12:25 AM

Quote:

Originally Posted by jefro (Post 5830686)
"I made a hybrid iso " What exactly do you mean here?

After looking at the iso in ARK I could only see where the iso was meant to be a CD. After some research I found out about Hybrid iso's that are able to be burned to CD or USB (see 1087-1089) of my terminal post. I am not sure if I had unmounted the USB first the original iso may have worked. I will try and post the results. If I just plug in the USB and use fdisk will it be mounted, even if I don't use dolphin or KDE partition manager?

Paul

BW-userx 03-14-2018 08:46 AM

  1. get an iso
  2. open a terminal then change directories to where your iso is at
  3. plug in your usb stick
  4. lsblk to get which port it is in, or (sudo) blkid
  5. dd if=linux.iso of=/dev/sdXx && sync
  6. press Enter
when that is done reboot, then tell your BIOS/System to boot the USB Stick and cross your fingers and hope it worked.

rtmistler 03-14-2018 10:37 AM

I believe this is solved and the problem appears to be that the USB was mounted when you first attempted it.

If so, please mark the thread as solved for future seekers of a similar problem.

Best Regards

jefro 03-14-2018 02:21 PM

Many disto's used to proclaim they had hybrid iso images or usb/optical images available. They don't all seem to report it as such anymore.

From the lite page "If you are writing the ISO to a USB on Windows, Mac or Linux, please use Etcher - https://etcher.io/

Linux or Mac command line: sudo dd if=linux-lite-3.8-32bit.iso of=/dev/sdx bs=4M"

however they didn't mention the usb did need to be unmounted.

ondoho 03-15-2018 01:48 AM

everyone please go back and read post #1.
the commands look ok to me.

i'll say it again, it is totally normal that the resulting usb medium won't show up in the filemanager or can't be browsed with it.
if you need to get some data off it, you can mount it first.
i just tried with any old iso, the command:
Code:

mkdir mnt; sudo mount Anyold.iso mnt
should be sufficient.

BW-userx 03-15-2018 08:50 AM

yes, the other line of thought,
Quote:

Originally Posted by pablo27
made a hybrid iso and tried that and when I look at the USB in Dolphin

if he made it himself then it 'has' to be a bad build. But the ultimate test would be trying to boot it. if it fails then ask why.

DavidMcCann 03-15-2018 12:38 PM

Just to clarify a bit, if you use dd to put an iso image on to usb, then the usb now has the filing system appropriate to an optical disk. As far as Linux is concerned, it looks like an optical drive run off a usb port. Naturally, it won't be treated as a random-access memory device any more.

Incidentally, if ever you need to turn it back into a conventional memory device, a partition editor probably won't do it. It will see the device has the iso9660 filing system and assume you're trying to partition a DVD! The secret is to destroy the filing system ID before using the partition editor, with
dd if=/dev/zero bs=1M count=10 of=/dev/sdx


All times are GMT -5. The time now is 07:22 AM.