Page 1 of 2
Creating Bootable USB from ISO
Posted: Sat Jul 30, 2016 12:20 pm
by Octacone
Hey everyone. I need a quick tip.
How do I create a bootable USB from my bootable ISO file that contains GRUB.
I tried dd, nothing, tried rufus nothing, tried just iso file nothing. Can't get my bootable ISO file to boot on real hardware.
I just want to insert my USB with iso image of my OS on it and press enter to select my menuenetery and boot my OS.
Re: Creating Bootable USB from ISO
Posted: Sat Jul 30, 2016 1:05 pm
by SpyderTL
Blocks are typically larger on a CD than they are on any other device, so just simply copying bytes from one to another probably won't work. You'll need to adjust your grub configuration and build a new disk image with a different file system to be able to boot from a USB drive.
You may, however, be able to mount both file systems and copy the files from your CD image to your USB drive.
Re: Creating Bootable USB from ISO
Posted: Sat Jul 30, 2016 1:07 pm
by Octacone
SpyderTL wrote:Blocks are typically larger on a CD than they are on any other device, so just simply copying bytes from one to another probably won't work. You'll need to adjust your grub configuration and build a new disk image with a different file system to be able to boot from a USB drive.
Right now I don't have any file system implementations. I am using RAW as my format. When I build my OS grub outputs single .iso file that contains my os and grub2 bootloader, I can boot that with qemu and bochs but can't boot it off my USB (aka real hardware).
Re: Creating Bootable USB from ISO
Posted: Sat Jul 30, 2016 2:09 pm
by SpyderTL
GRUB probably expects a partition table if you are booting from a hard drive, so copying a CD image will probably never work.
You can either configure GRUB to build you a disk image (instead of an ISO file), or you can copy your ISO file to your formatted USB drive, and install GRUB on it, as well, and have GRUB mount your ISO file at boot time, and run the other GRUB boot loader.
I'm not a GRUB expert, though. Maybe someone else can be more helpful.
Re: Creating Bootable USB from ISO
Posted: Sat Jul 30, 2016 2:57 pm
by Octocontrabass
If you're creating the ISO with grub-mkrescue, it should be a hybrid ISO image and "just work" when you copy it to your flash drive with dd.
Does the ISO contain a MBR? If not, it isn't a hybrid ISO and can't be used on a flash drive. Verify using a hex editor or xxd or something.
Are you copying it to the correct device with dd? If you send it to /dev/sdb1 instead of /dev/sdb, it won't work.
Is your hardware capable of booting from USB? Try booting some other hybrid ISO to see if there might be some compatibility issues. (This is pretty unlikely to be the problem; isohybrid is very good at what it does.)
Re: Creating Bootable USB from ISO
Posted: Sat Jul 30, 2016 3:28 pm
by Octacone
SpyderTL wrote:GRUB probably expects a partition table if you are booting from a hard drive, so copying a CD image will probably never work.
You can either configure GRUB to build you a disk image (instead of an ISO file), or you can copy your ISO file to your formatted USB drive, and install GRUB on it, as well, and have GRUB mount your ISO file at boot time, and run the other GRUB boot loader.
I'm not a GRUB expert, though. Maybe someone else can be more helpful.
Hmm, to create a disk image.
I can try that and then just use "dd".
Great idea.
Re: Creating Bootable USB from ISO
Posted: Sat Jul 30, 2016 3:32 pm
by Octacone
Octocontrabass wrote:If you're creating the ISO with grub-mkrescue, it should be a hybrid ISO image and "just work" when you copy it to your flash drive with dd.
Does the ISO contain a MBR? If not, it isn't a hybrid ISO and can't be used on a flash drive. Verify using a hex editor or xxd or something.
Are you copying it to the correct device with dd? If you send it to /dev/sdb1 instead of /dev/sdb, it won't work.
Is your hardware capable of booting from USB? Try booting some other hybrid ISO to see if there might be some compatibility issues. (This is pretty unlikely to be the problem; isohybrid is very good at what it does.)
MBR (Master Boot Record), I don't see MBR anywhere around, I only have: BasicOS.bin, boot and boot.catalog files on my USB.
Yeah, I am sure about my USB location (verified w/ GParted).
Both my PC and laptop can boot operating systems off an USB drive, not a compatibility issue, USB booting is enabled inside BIOS.
Re: Creating Bootable USB from ISO
Posted: Sat Jul 30, 2016 4:12 pm
by Octocontrabass
The MBR is not a file in the ISO, it's the first 512 bytes of the ISO.
Re: Creating Bootable USB from ISO
Posted: Sat Jul 30, 2016 5:15 pm
by Octacone
Octocontrabass wrote:The MBR is not a file in the ISO, it's the first 512 bytes of the ISO.
This makes me feel noobish. I thought you were talking about MBR bootloader that Windows uses. *Insert facepalm here*
I guess I will have to use xxd and see what does my iso look like.
Re: Creating Bootable USB from ISO
Posted: Mon Aug 01, 2016 2:18 am
by max
Re: Creating Bootable USB from ISO
Posted: Tue Aug 02, 2016 8:49 am
by Octacone
Thank you max, definitely going to try that one out.
Re: Creating Bootable USB from ISO
Posted: Wed Aug 03, 2016 9:22 am
by Ch4ozz
Rufus works perfectly fine for me.
Maybe check your grub version?
Re: Creating Bootable USB from ISO
Posted: Thu Aug 04, 2016 9:21 am
by Octacone
@max
I don't own a Mac. I can not use those commands with Linux.
Re: Creating Bootable USB from ISO
Posted: Thu Aug 04, 2016 9:21 am
by Octacone
Ch4ozz wrote:Rufus works perfectly fine for me.
Maybe check your grub version?
GRUB2, what settings do you use?
Re: Creating Bootable USB from ISO
Posted: Thu Aug 04, 2016 10:08 am
by Ch4ozz
octacone wrote:Ch4ozz wrote:Rufus works perfectly fine for me.
Maybe check your grub version?
GRUB2, what settings do you use?
I used standard settings.
Did you change the boot order in bios?
Booting from USB is usually the last option, before it is HDD, DVD/CD