LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 07-07-2014, 07:02 PM   #1
donatom
Member
 
Registered: Feb 2012
Location: Southern California
Distribution: Archlinux, Debian, Fedora
Posts: 44
Blog Entries: 4

Rep: Reputation: Disabled
Creating a usb drive with 7 utility isos -- including Knoppix that boot under uefi


I wrote a similar post about setting up a usb drive that can boot Linux isos under UEFI. I am writing another because I have been able to boot most of the isos that can be used to fix a broken system (including Windows) and help in trouble-shooting.

I have set up a drive that boots Knoppix, System Rescue, Gparted, Parted Magic, Tails, Fedora 20 and Mintlinux 17 (both of which can also help in remedying PC problems; they both contain dd, and Mintlinux has gparted and other utilities).

Before I was able -- with the help of Google -- to set up a usb drive that could boot a few, very modern Linux live isos under UEFI. I then found an extremely helpful website that explained how to set up a usb drive that could boot practically all live isos, even those that were not meant to boot under EFI: https://www.nixaid.com/creating-uefi...distributions/

If you follow the very precise, well laid out instructions found on the nixaid website, you too will be able to boot many live isos.

I had to deviate from nexaid's instructions when it came to booting Parted Magic and Fedora. To get Fedora to boot I emptied the contents of the iso into a directory named Fedora20 (using Archive Manager or by mounting the iso, i.e., "mount -o loop /path/to/iso /mnt"). I also had to resort to adding the option "root=live:LABEL=boot" in the "linux" line of the menuentry. Since there was no iso, I could not use loopback, etc. to boot it as a loop.

Parted Magic was booted in a similar fashion (no loop), but instead of pouring the contents of its iso into a directory, I had to copy the contents onto the root of the drive.

To get the Knoppix iso to boot, I could not resort to the option "fromiso= . . . with the uuid of the second partition of the drive -- where I stored the isos". I had to utilize the option "bootfrom=/dev/sdb2/isos/KNOPPIX_V7.2.0DVD-2013-06-16-EN.iso" instead (generally "fromiso=/uuid#/path/to/the-iso" works for isos that derive from Debian, but Knoppix is an exception). I got insight into this by perusing the Knoppix Distro Website.

As Nexaid stated, you can easily find the information to append to the "linux" line of the menuentry by opening the isolinux.cfg or (less often) the menu.cfg file found in the iso that you are trying to boot (Use Archive Manager to find them).

Here is a copy of my grub.cfg (as you can see, the label for my drive is "boot" and I placed the isos into a directory that I created named "isos"):

Code:
set timeout=15
set default=0

# (U)EFI Graphic Protocol
insmod efi_gop
insmod efi_uga
insmod font
insmod ext4

if loadfont ${prefix}/unicode.pf2
then
    insmod gfxterm
    set gfxmode=auto
    set gfxpayload=keep
    terminal_output gfxterm
fi

insmod tga 
background_image /grub/LinuxGreen.tga 

#######################################################


search --no-floppy --set=root -l 'boot'

menuentry "Parted Magic 2013_5_1" {
	gfxpayload=1024x768
	
	linux /pmagic/bzImage64 initrd=/pmagic/initrd.img boot=live edd=off load_ramdisk=1 prompt_ramdisk=0 rw vga=normal loglevel=9 max_loop=256 vmalloc=384MiB
	initrd /pmagic/initrd.img
}

menuentry "Fedora 20"  {
		
	linux /isos/Fedora20/isolinux/vmlinuz0 initrd=initrd0.img root=live:LABEL=boot rd.live.dir=/isos/Fedora20/LiveOS rootfstype=auto  live-config.timezone=America/Los_Angeles ro rd.live.image quiet rhgb rd.luks=0 rd.md=0 rd.dm=0 
 initrd /isos/Fedora20/isolinux/initrd0.img 
}

menuentry "SystemRescue CD 4.2 32 bit" {
	loopback loop /isos/systemrescuecd-4.2.0.iso
        linux (loop)/isolinux/altker64 isoloop=/isos/systemrescuecd-4.2.0.iso 
        initrd (loop)/isolinux/initram.igz
}

menuentry "gparted-live-0.19.0-2-i486 " {
	loopback loop /isos/gparted-0.19.0.1.iso
	linux (loop)/live/vmlinuz fromiso=/dev/disk/by-uuid/3375fa85-5ab9-48ee-8955-989ecfa4b092/isos/gparted-0.19.0.1.iso initrd=/live/initrd.img iso raw boot=live username=user config quiet noswap noeject  ip=  nosplash 
	initrd (loop)/live/initrd.img
}

menuentry "AVG Rescue CD" { 
  loopback loop /isos/avg_antivirus.iso 
  linux (loop)/isolinux/vmlinuz max_loop=255 vga=791 init=linuxrc iso-scan/filename=/isos/avg_antivirus.iso 
  initrd (loop)/isolinux/initrd.lzm 
}




menuentry "mint17 32 bit" { 
 loopback loop /isos/linuxmint-17-32bit.iso 
 linux (loop)/casper/vmlinuz file=/cdrom/preseed/linuxmint.seed initrd=/casper/initrd.lz boot=casper iso-scan/filename=/isos/linuxmint-17-32bit.iso  ro noeject noprompt splash -- 
 initrd (loop)/casper/initrd.lz 
} 



menuentry "tails 1.01 i386" {
	loopback loop /isos/tails-i386-1.0.1.iso
	linux (loop)/live/vmlinuz fromiso=/dev/disk/by-uuid/3375fa85-5ab9-48ee-8955-989ecfa4b092/isos/tails-i386-1.0.1.iso initrd=/live/initrd.img boot=live config live-media=removable nopersistent noprompt timezone=Etc/UTC block.events_dfl_poll_msecs=1000 splash noautologin module=Tails  noapic noapm nodma nomce nolapic nomodeset nosmp vga=normal
	initrd (loop)/live/initrd.img
}

menuentry "Knoppix 7.2 DVD" {
	loopback loop /isos/KNOPPIX_V7.2.0DVD-2013-06-16-EN.iso
	linux (loop)/boot/isolinux/linux bootfrom=/dev/sdb2/isos/KNOPPIX_V7.2.0DVD-2013-06-16-EN.iso lang=en apm=power-off video=640x480 initrd=minirt.gz nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1 adriane
	initrd (loop)/boot/isolinux/minirt.gz
}
As you can see I placed a splash file called "LinuxGreen.tga" in the grub directory (I added the two lines "insmod tga" and "background_image /grub/LinuxGreen.tga" on the 15th and 16th lines of the grub.cfg as well). You can use any tga or jpeg file to make the grub menu look nicer when you are booting the isos.
 
Old 08-03-2014, 11:09 PM   #2
donatom
Member
 
Registered: Feb 2012
Location: Southern California
Distribution: Archlinux, Debian, Fedora
Posts: 44

Original Poster
Blog Entries: 4

Rep: Reputation: Disabled
I noticed that www.nixaid.com is not always accessible (and I am afraid that one day the site may no longer be available) so I am adding a condensed version of their instructions:

Taken from www.nixaid.com:

Clean the beginning of USB drive to prevent possible problems:
Code:
 
dd if=/dev/zero of=/dev/sdb bs=2M count=2 (make sure your usb device is sdb!)
sync ; echo 1 | tee /proc/sys/vm/drop_caches
Start with offset of 2MB (you should check your drive to see what the optimal offset is)
Create a new disklabel of GPT type using parted: (use extreme caution; parted could destroy your linux installation if you are careless)


Code:
parted -a optimal /dev/sdb (make sure drive you are working on is sdb)
mklabel gpt
unit MB
mkpart bootefi fat32 0% 200M   (creates the EFI partition which is 200M in size)
set 1 boot on
mkpart bootiso ext4 200M 20G  (creates a second partition of 20 GB)
mkpart private ext4 20G 100%  (creates a third partition which will take up the rest of the drive)
unit MB  
print
print free
align-check optimal 1
align-check optimal 2
align-check optimal 3
quit
The EFI System Partition must be mounted at /boot/efi to properly load via the GNU GRUB2 bootloader.
/dev/sdb1 will be mounted as: /target/boot/efi
/dev/sdb2 will be mounted as: /target/boot
/dev/sdb3 can be used as storage when you boot an iso on this efi drive

Now you must create filesystems:
Code:
mkfs.vfat -F32 -n EFIBOOT /dev/sdb1
mkfs.ext4 -L bootiso /dev/sdb2
Mount these partitions in the following order:

Code:
mkdir -p /target/boot

mount /dev/sdb2 /target/boot
mkdir /target/boot/efi

mount /dev/sdb1 /target/boot/efi
Now install grub2:

Code:
grub-install --removable --no-uefi-secure-boot --target=x86_64-efi --efi-directory=/target/boot/efi --boot-directory=/target/boot --bootloader-id=grub --recheck /dev/sdb
For the third partition (sdb3) I use the fat system because it can be used with Windows machines as well as Linux and Macintosh boxes:

Code:
mkfs.vfat -F32 -n shared -v /dev/sdb3
Now copy my grub.cfg file which I included in my first post using vim or gedit (and name the file “grub.cfg”) and place it in the "grub" directory.

Next you will have to copy “unicode.pf2” from your linux system and place it in the grub directory of the usb drive:

Code:
cp /usr/share/grub/unicode.pf2 /target/boot/grub
Now you just have to create the directory (where you will put your Linux distros) on your /dev/sdb2 device that is mounted as /target/boot and copy your Linux distros there as follows (your iso files will probably be different, so change commands accordingly):

Code:
mkdir /target/boot/isos
cp ~/Downloads/linuxmint-17-mate-dvd-64bit.iso /target/boot/isos/
cp ~/Downloads/systemrescuecd-x86-4.2.0.iso /target/boot/isos/
cp ~/Downloads/tails-i386-1.0.iso /target/boot/isos/
cp ~/Downloads/kali-linux-1.0.6-i386.iso /target/boot/isos/
And finally you must safely unmount the usb device:

Code:
umount /dev/sdb1
umount /dev/sdb2
umount /dev/sdb3

sync ; echo 1 | tee /proc/sys/vm/drop_caches

udisks --detach /dev/sdb

Last edited by donatom; 08-03-2014 at 11:18 PM. Reason: making code tags more readable
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Creating UEFI A MENU For My Bootable (BIOS/UEFI) CDROM ssenuta Linux - Hardware 0 08-27-2012 09:11 PM
Knoppix USB boot - problem with internal SATA drive dong99 Linux - Newbie 4 12-13-2008 06:42 AM
best way to copy a drive including boot sector? berrance Linux - Software 21 09-07-2008 08:13 PM
accessing USB drive in Redhat 9 and then creating USB boot disk Fond_of_Opensource Linux - Hardware 1 04-15-2007 07:43 AM
Unable to boot Knoppix on usb drive. andrew_cz Linux - Hardware 0 06-21-2006 10:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 04:21 PM.

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
Open Source Consulting | Domain Registration