LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2018, 11:16 PM   #1
bt101
Member
 
Registered: Mar 2008
Posts: 47

Rep: Reputation: 17
How do you make a bootable ISO from a bootable USB stick?


[Log in to get rid of this advertisement]
I've searched the internets on how to do this and from what I can see everyone says to simply use dd to copy the stick image to a file.
Code:
dd if=/dev/sdb of=usb.iso
I do this but this file when attached to a Virtualbox VM will not boot.

First.. I find it kinda hard to believe that just copying the image of a USB stick makes an ISO file, but there are tons of pages that say so.

Second... the method seems kinda absurd because it makes a gigantic file when the contents of the USB stick can be rather small.

Anyway, lets assume the above two points mean nothing. The problem is the resulting file won't boot.

I can't even mount this ISO using loop:
Code:
computer # mount -o loop usb.iso mnt
mount: you must specify the filesystem type

computer # mount -t vfat -o loop usb.iso mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
If I fdisk list the contents of the file, it looks pretty much exactly the same as the USB device /dev/sdb:
Code:
computer # fdisk -l usb.iso

Disk usb.iso: 512 MB, 512753664 bytes
255 heads, 63 sectors/track, 62 cylinders, total 1001472 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
Disk identifier: 0x000cb549

  Device Boot      Start         End      Blocks   Id  System
usb.iso1   *          63      996029      497983+   c  W95 FAT32 (LBA)
This dd method of making an ISO seems like a dead end. Does anyone know a method that works?

Edit - pls I do not want the method to make a vbox vmdk link (I know that one). I need an ISO. Thanks

Thanks

Last edited by bt101; 07-27-2018 at 11:33 PM.
 
Old 07-28-2018, 06:28 AM   #2
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,203

Rep: Reputation: Disabled
You probably just need to run isohybrid on your .iso file.

To create your .iso file, copy everything from the USB drive into a folder on your hard drive, & then make your .iso file from the contents of that folder.

https://unix.stackexchange.com/quest...minal-commands

Last edited by fatmac; 07-28-2018 at 06:34 AM.
 
Old 07-28-2018, 08:39 AM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005
Are you sure the USB flash drive will boot? Try booting it with VB. I'm not positive what's going on, but dd is the way to do the job. And, not just any bootable USB will work to make an .iso file. It has to be a USB that was created by writing an .iso to the drive.

Isohybrid will take a bootable iso and make it so it will boot off a USB drive. Iso is typically used for CD/DVD media, which have a different boot specification than a regular drive.

Last edited by AwesomeMachine; 07-28-2018 at 08:45 AM.
 
Old 07-28-2018, 11:35 AM   #4
bt101
Member
 
Registered: Mar 2008
Posts: 47

Original Poster
Rep: Reputation: 17
Thanks for the answers.

Yes I'm sure the key will boot.
It boots on a physical machine.
I am also able to make it boot in a Vbox VM (there is a command which makes a small fake vmdk link to the USB key).

I did a little more research and it matches what you are saying about ISO and USB disks having different booting specs.
I think that must be the problem.

Funny thing is that 99 out of 100 internet hits about "how to convert a bootable USB to a bootable ISO" say to use dd (when it seems it can't work!!!).

If there is a way to make it work, I'd like to know.
I want to make an ISO and test that it boots in Virtualbox.

I need the ISO because I want to make a multiboot USB key. The software that makes the multiboot key needs an ISO. For most software (clonezilla, systemrescuecd, etc) you can get an ISO. For this USB key, all I have is the key.
 
Old 07-28-2018, 12:55 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,215

Rep: Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993
Your correct, hard drives including USBs use a different boot code then CDs/DVDs. While dd creates a byte for byte image file of the flash drive it isn't an ISO i.e CD ISO9660 filesystem.

If whats installed on the flash drive is from a live distribution then it might be easier to just download that ISO file and use that for your multiboot USB setup. Can you post what is currently running on your flash drive? That would help us determine on how or if it is possible to convert it to a live CD.
 
Old 07-28-2018, 03:58 PM   #6
bt101
Member
 
Registered: Mar 2008
Posts: 47

Original Poster
Rep: Reputation: 17
Thanks - they key contains the USB bootable Macrium Reflect.

I do know that Macrium is also on the Hiren's bootable ISO. However I did want to still find out how to convert the USB to bootable ISO for these reasons:
  • I'm not sure if the version I have is the same or compatible with the Hiren's version (just want to be safe)
  • the Hiren's is kinda big and has a lot I don't need
  • I will likely come across other bootable USBs where I want to do the same (would be nice to know)
But it looks like it is confirmed that going from bootable USB to bootable ISO is a no-go.
 
Old 07-28-2018, 10:01 PM   #7
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,578

Rep: Reputation: 322Reputation: 322Reputation: 322Reputation: 322
Since you probably downloaded the ISO file to your PC in order to create a bootable USB, why not just keep the downloaded ISO for use in VM's etc.
 
Old 07-29-2018, 06:12 AM   #8
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,203

Rep: Reputation: Disabled
Yes, you can do it.

As I said earlier, copy all the USB files to a directory on your HDD, & make your bootable CD/DVD from that.
 
Old 07-29-2018, 01:10 PM   #9
bt101
Member
 
Registered: Mar 2008
Posts: 47

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by JeremyBoden View Post
Since you probably downloaded the ISO file to your PC in order to create a bootable USB, why not just keep the downloaded ISO for use in VM's etc.
Thanks but there is no downloadable ISO. The USB is made from a piece of software.
 
Old 07-29-2018, 01:20 PM   #10
bt101
Member
 
Registered: Mar 2008
Posts: 47

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by fatmac View Post
Yes, you can do it.

As I said earlier, copy all the USB files to a directory on your HDD, & make your bootable CD/DVD from that.
Thanks I tried that and all of the other methods in the link. None of them work. I thought AwesomeMachine and michaelk confirmed they will never work as USB and ISO boot differently?
 
Old 07-29-2018, 05:11 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,215

Rep: Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993Reputation: 2993
Macrium Reflect is a windows program and I assume that you created a bootable flash drive using a Windows utility.

While genisoimage as posted in the link creates an ISO file that can be burned to disc it will not be bootable. There are several ways to make a disc bootable. One way is via isolinux.

https://www.syslinux.org/wiki/index.php?title=ISOLINUX

Some old documentation.
http://www.tldp.org/HOWTO/Bootdisk-HOWTO/cd-roms.html

GRUB can create a bootable CD.
https://www.gnu.org/software/grub/ma...ble-CD_002dROM
https://www.gnu.org/software/xorriso/
 
Old 07-30-2018, 06:33 AM   #12
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,203

Rep: Reputation: Disabled
I don't make iso files any more, but these are what I used to use.

Code:
mkisofs -b boot/cdboot -no-emul-boot -J -R -ldots -l -L -o my.iso directorycontents
Code:
mkisofs -o my.iso -b /isolinux/isolinux.bin -c /isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table directorycontents
Code:
genisoimage -o my.iso -R -J -l -v -V "mycd" -hide-rr-moved -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -pad directorycontents
To make it usable from a pendrive, use isohybrid.
Code:
isohybrid my.iso
Then use dd to put it onto your pendrive.
 
1 members found this post helpful.
Old 08-01-2018, 07:53 PM   #13
bt101
Member
 
Registered: Mar 2008
Posts: 47

Original Poster
Rep: Reputation: 17
Thanks everyone for your help.

I stumbled upon a solution...

I had played with a few different solutions for multibooting a USB. Even with standard ISOs, most of these multiboot solutions had problems. For example, for one solution, if you put more than one PE ISO on the key, only the last one would boot. So, nothing but problems, plus I don;t run Windows so that limits the choice of multiboot solutions.

Then I tried easy2boot. It can be configured on linux. The linux instructions seem a bit complex, but after you read it a few times and play, it turns out to be simple to setup (BTW there is a Windows interface which I would imagine is easier to use). Anyway, it had no problem booting any standard ISO that I threw at it.

It worked so well that I though, what the heck, I'll throw the dd disk image at it. That is, the dd image that I made from the original bootable USB, saved as a .img file. Well, that didn't boot. That image had been made with dd and the source was the whole USB disk (ie /dev/sdb). Then I tried making a dd image of just the partition (/dev/sdb1). I threw it on the multiboot USB and... I'll be darned... it booted! So it turns out I didn't need to convert to ISO (I over complicated it).

Last edited by bt101; 08-01-2018 at 07:56 PM.
 
Old 09-26-2018, 12:47 AM   #14
bscho
Member
 
Registered: Nov 2012
Location: London
Distribution: Mint 19.1
Posts: 599

Rep: Reputation: 12
I tried the isohybrid and got this
~/Documents$ isohybrid wingparted.iso
isohybrid: wingparted.iso: could not find boot record

Can someone say where to find the boot record?

Then tried to download easy2boot and found it seems only to work for USB's

I have a working USB and made an iso from it and it is this I cannot make to have a bootable iso

Any help would be appreciated been trying this for 2 weeks now, so need help.
 
Old 09-26-2018, 05:36 AM   #15
bscho
Member
 
Registered: Nov 2012
Location: London
Distribution: Mint 19.1
Posts: 599

Rep: Reputation: 12
[QUOTE=michaelk;5885308]Macrium Reflect is a windows program and I assume that you created a bootable flash drive using a Windows utility.

While genisoimage as posted in the link creates an ISO file that can be burned to disc it will not be bootable. There are several ways to make a disc bootable. One way is via isolinux.

https://www.syslinux.org/wiki/index.php?title=ISOLINUX

This seems good followed it until it wants more, but I am now stuck as I =it says:

Copy "[bios/]core/isolinux.bin" from the Syslinux archive
For version 5.00 or newer, also copy "[bios/]com32/elflink/ldlinux/ldlinux.c32" from the Syslinux archive

I just cannot find the Syslinux archive

Help will appreciated working two weeks so far to crack copying a bootable iso.
 

 


 

  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do some bootable ISO's work from a USB stick and others don't? Steven_G General 6 01-27-2017 08:37 AM
Mounting a bootable USB stick makes the stick non-bootable PeterSteele Red Hat 6 03-15-2013 02:44 PM
What the hell is a bootable ISO and a bootable USB-stick? duplex Linux - Software 15 11-23-2012 09:00 PM
Making a USB Stick Bootable RHEL5 from iso divyashree Linux - Newbie 6 09-08-2010 01:23 AM
Making a USB stick bootable from a bootable cdrom cwwilson721 Slackware 2 10-23-2009 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration