LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Creating a Grub2 boot-cd with a (grub.cfg) menu ..my solution (http://www.linuxquestions.org/questions/linux-general-1/creating-a-grub2-boot-cd-with-a-grub-cfg-menu-my-solution-754835/)

ssenuta 09-13-2009 11:02 AM

Creating a Grub2 boot-cd with a (grub.cfg) menu ..my solution
 
Here is how I created a Grub2 boot-cd with a (grub.cfg) menu:
mkdir /tmp/cdroot
mkdir /tmp/cdroot/boot
mkdir /tmp/cdroot/boot/grub

cp /boot/grub/grub.cfg /tmp/cdroot/boot/grub

cd /tmp

grub-mkrescue --modules="linux ext2 fshelp ls boot pc" --overlay=cdroot --image-type=cdrom grub2-boot.iso

Burn the grub2-boot.iso image with K3b or cdrecord

###################################################################
NOTE: The above proceedure assumes you already have a grub.cfg file.
If you don't, create one in the /tmp/cdroot/boot/grub directory

kerrylinux 10-01-2009 01:17 AM

Hello,

have a look at:

http://linuxcoaching.eu/linux_coachi...-cd-drive.html

This can be a natural solution for those, who need to boot (grub2) without a CD drive.

RON

ssenuta 10-04-2009 10:00 PM

Thank you for the Grub2 "loopback" reference. I tested the procedure outlined in the article & was able to successfully boot a rescue ramdrive from a (rescue.iso) image file. After my ramdrive is booted, I can remove the usp-stick & just work from ram.

#####################################################################
Here is what I did:

fdisk -l ..fdisk displays your drives
Plugin usb-stick
fdisk -l ..fdisk identifies your new (usb-stick) drive

fdisk /dev/sdc ..Create two primary linux type 83 partitions (sdc1=10M & sdc2=default)
on the usb stick & toggle (a) /dev/sdc1 to (*) bootable
mkfs.ext3 /dev/sdc1
mkfs.ext3 /dev/sdc2

mount -t ext3 /dev/sdc2 /mnt/misc
cp rescue.iso /mnt/misc
umount /mnt/misc

mount -t ext3 /dev/sdc1 /mnt/misc
grub-install --modules="linux boot pc ext2 fshelp ls loopback gzio" --root-directory=/mnt/misc /dev/sdc1

Edit /mnt/misc/boot/grub/device.map

(eg.) (fd0) /dev/fd0
(hd0) /dev/sdc ..usb-stick (/dev/sdc) will be 1st hard-drive to boot
(hd1) /dev/sdb
(hd2) /dev/sda
(hd3) /dev/hda

grub-install --modules="linux boot pc ext2 fshelp ls loopback gzio" --root-directory=/mnt/misc /dev/sdc1

Create /boot/grub/grub.cfg

(eg.) set default=0
set timeout=10
set menu_color_normal=white/cyan
set menu_color_highlight=yellow/blue

menuentry "Isolinux Rescue-2.6.30" {
loopback loop (hd0,2)/rescue.iso ..(hd0,2)=/dev/sdc2
set root=(loop)
linux /isolinux/bzImage root=/dev/ram0 vga=771 ..bzImage (kernel) is in isolinux directory of rescue.iso
initrd /isolinux/initrd.gz ..initrd.gz (rootfs) is in isolinux directory of rescue.iso
}

Umount /mnt/misc
#####################################################################

Note: Because this .iso image is for ramdrive rootfs, I added the kernel (bzImage) parameter "root-/dev/ram0"

aus9 02-04-2010 06:16 PM

ssenuta

thankyou for your info.

It appears there have been changes. I use to burn grub2 cds with genisoimage and an extracted eltorito image from grub-mkrescue....and keyword searching brought me here

thanks

FWIW your old command no longer works
grub-mkrescue --modules="linux ext2 fshelp ls boot pc" --overlay=cdroot --image-type=cdrom grub2-boot.iso

instead try this
Code:

grub-mkrescue --modules="linux ext2 fshelp ls boot pc" --output=grub2-boot.iso cdroot


All times are GMT -5. The time now is 01:36 AM.