Its been really long since I blogged. Before going ahead, want to tell you that will be posting my endeavours on running virtual machines soon.
This, however, is my experience/guide for creating a super pen drive (a.k.a. a usb disk that if booted from presents a grub menu with options – GParted, Fedora, .. and any other linux distro hopefully, and has Fedora persistence, and has a spare partition too for you to use it as a normal pen drive).
It wasn’t as straight forward as I thought (like… all other things).
- Decide the partitioning layout and partition the pen drive.
- Install grub on one partition
- Install GParted on another
- Install Fedora on another
- Install grub again on the partition in step 2 :P, and setup grub.conf
- Sit back, and enjoy (may need to crouch forward in some cases.. )
A super neat trick:
To check at any time how you pen drive would behave if you boot from it, use the command : qemu -hda /dev/sdb -m 256 -vga std
This command reduced my research time to one third.
1) Decide the partitioning layout
I used GParted on my Fedora installation (on my harddisk) to set up the partition of the pen drive.
2) Install grub on one partition
Make sure you manually mount the grub partition. The /media/something folder in which it gets mounted automatically gave me some trouble. So unmounted it from there, and mounted /dev/sdb5 to /mnt/usbgrub
grub-install –no-floppy –root-directory=/mnt/usbgrub/ /dev/sdb
3) Install GParted on another
Use UNetbootin for GParted
4) Install Fedora on another
Need to make sure that usb disk is ext3 before doing this. When I did this on a vfat disk, I got an “error 22″ when trying to boot from the usb disk.
Use liveusb-creator or live-iso-to-disk for Fedora.
Persistence is buggy according to http://forums.fedoraforum.org/archive/index.php/t-219250.html so instead, a better solution is to directly install fedora on the pen drive on a separate partition, like in http://linuxsoftwareblog.com/blog/?p=156
5) Install grub again on the partition in step 2 :P, and setup grub.conf
mount /dev/sdb5 /mnt/usbgrub/
grub-install –no-floppy –root-directory=usbgrub/ /dev/sdb
Now, to setup the grub menu:
cp /boot/grub/grub.conf .
cp /boot/grub/splash.xpm.gz .
# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/mapper/VGSahil-LVRoot
# initrd /initrd-version.img
title Fedora (18.104.22.168-64.fc11.i686.PAE)
kernel /vmlinuz-22.214.171.124-64.fc11.i686.PAE ro root=/dev/mapper/VGSahil-LVRoot rhgb quiet
title GParted Live
kernel /live/vmlinuz1 boot=live union=aufs noswap noprompt acpi=off irqpoll noapic noapm nodma nomce nolapic nosmp ip=frommedia vga=normal
title Omega 11 Live
kernel /syslinux/vmlinuz0 root=/dev/sdb7 rw liveimg quiet rhgb