Live USB sticks using grub2●

A low level approach●Paul Elliott●pelliott@blackpatchpanel.com

Usb disk to be used for rescue●

Must contain:●

Super Grub Disk for Grub1●

Super Grub Disk for Grub2●

System rescue CD●

Gparted Live CD●

A Ubuntu Live CD/Installer

Partitons needed●

Partition for super grub disk for grub1●

Partition for Grub2 to boot everything.

●

Partition for loopback iso!

Partition the Usb stick!

Don't fuck with the wrong
Drive!

Overwriting yourLinux Hard Drive
can ruin your whole day.

Choose the device that is theUSB stick.

Completely modify the USB stickby creating new partition Table

Use an extended partitons
Otherwise you are limited=4

9 meg for Super Grub disk (1)5 meg to install grub2.

Remainder to store ISO,other stuff.

Which gives this layout.

Mount the SGD CD and grub1
partitions

Open SGD cdrom grub1
partitons.

Run dolphin as root

Open CD, grub1

Reboot●

Boot super grub disk live CD. (version 1)●

Determine which is the partition with label=grub1●

Boot & Tools●Show partitions●Device will be in form (hdX,Y)●●X and Y will be numbers“c” to get to grub command line

In Grubroot (hdx,y)setup (hdx,y)●After setup test with●chainloader +1

●

boot●

●

Will boot super grub disk!

Return to GNU/LINUX withgrub version 2, like ubuntu●●

Install grub2!
●

cd /media●

mkdir grub2●

mount ­L grub2 grub2●

grub­install –root­directory=/media/grub2 /dev/sdX

What is X?
●

Same device as shown by●ls ­l /dev/disk/by­label/grub2

My version of grub.cfg
http://www.free.blackpatchpanel.com/pme/linux/grub.cfg

Only remains to createboot/grub/grub.cfg
menuentry "Super Grub Disk" {insmod part_msdos
insmod ext2
insmod chain
set root='(hd0,msdos11)'
Echo “wont work until uuid adjusted”
search ­­no­floppy ­­fs­uuid ­­set=root 259d247c­
3b98­4491­a985­dcf2dbc74ed5
chainloader +1}

UUIC initial U stands forunique.
●

UUIC is created when partition is made.

●Must determine UUIC for menu entry.

Where did the UUIC comefrom?
grub1

But this may be toocomplicated. So boot by label
menuentry "Super Grub Disk by label" {insmod part_msdos
insmod ext2
insmod chain
set root='(hd0,msdos11)'
echo "super grub disk partition must be labeled grub1"
search ­­no­floppy ­­label ­­set=root grub1
chainloader +1}

How to convert menu entries!

Isolinux subdirectory *.cfg●Isolinux subdirectory contains .cfg files with menu
items.

Fields of isolinux file andcoresponding in grub.cfg

Filename

Distro dependantMenu.cfg

Exceptions●

Sometimes “linux” is “linux16”●

Sometimes “initrd” is “initrd16”

Kernal loopback paramter●Different Live CDs use different kernal parameterto indicate file which holds the “CDROM”
device.

●Isoloop= System Rescue CD●

Findiso= Gparted Live CD●

iso­scan/filename= Ubuntu Live CDs!

●Linux Standard Base should recommend a standardname!

Put the ISOs in big storage
partition

We can now refer to these
ISOs via loopback.
menuentry "SystemRescueCd std­32bit" {insmod part_msdos
insmod ext2
set root='(hd0,msdos11)'
search ­­no­floppy ­­file ­­set=root $sysresisofile
loopback loop $sysresisofile
set root=(loop)
linux /isolinux/rescuecd isoloop=$sysresisofile
initrd /isolinux/initram.igz}

So our USB stick can do thefollowing●

Boot/restore grub1 and windows partitions withsuper grub disk●

Boot older grub distros like fedora that use grub1●

Boot Windows●

Restore master boot record●

System Rescue CD●

Gparted Live CD●

Ubuntu Live CD

So our USB stick can do thefollowing●●

Boot/restore grub1 and windows partitions withsuper grub disk
System Rescue CD●

32 64 bit versions●MemTest+●

NT Password Editor●GAG●

Gparted Live CD●

Ubuntu Live CD

So our USB stick can do thefollowing●●

Boot/restore grub1 and windows partitions withsuper grub disk
System Rescue CD
●MHDD

●

Hardware Detection Tool

●

Aida

●

Ranish Partition Manager●

Gparted Live CD●

Ubuntu Live CD

So our USB stick can do thefollowing●●

Boot/restore grub1 and windows partitions withsuper grub disk
System Rescue CD●

FreeDOS●Super Grub Disk 2 to boot ubuntu!

●

Gparted Live CD●

Ubuntu Live CD

So our USB stick can do thefollowing●

Boot/restore grub1 and windows partitions withsuper grub disk●

System Rescue CD●

Gparted Live CD●

Ubuntu Live CD●

Try out ubuntu●

Install ubuntu

So our USB stick can do thefollowing●

Boot/restore grub1 and windows partitions withsuper grub disk●

System Rescue CD●

Gparted Live CD●●

Repartition Whole drives, move resize partitions.

Ubuntu Live CD