LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-13-2009, 11:02 AM   #1
ssenuta
Member
 
Registered: Mar 2006
Location: NYS
Distribution: Mandriva-2006
Posts: 123

Rep: Reputation: 16
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
 
Old 10-01-2009, 01:17 AM   #2
kerrylinux
LQ Newbie
 
Registered: May 2009
Location: Co. Kerry, Ireland
Distribution: CentOS, Fedora, RedHat, Ubuntu Enterprise Cloud
Posts: 12

Rep: Reputation: Disabled
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
 
Old 10-04-2009, 10:00 PM   #3
ssenuta
Member
 
Registered: Mar 2006
Location: NYS
Distribution: Mandriva-2006
Posts: 123

Original Poster
Rep: Reputation: 16
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"

Last edited by ssenuta; 10-04-2009 at 10:02 PM.
 
Old 02-04-2010, 06:16 PM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
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

Last edited by aus9; 02-04-2010 at 06:22 PM. Reason: turn off the caps key
 
  


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
Grub2 and isolinux.cfg niravshah Linux - Newbie 10 07-23-2009 06:15 PM
Why /boot/grub/grub.conf is symlinked to /boot/grub/menu.lst raj_hcl1986@rediffma Linux - Newbie 2 10-19-2008 02:19 AM
Error 18 when trying to boot with GRUB or GRUB2 DaneM Linux - Software 6 09-20-2005 02:45 PM
need to access /boot/grub/menu.lst and /boot/grub/device.map neouto Linux - Newbie 8 09-04-2005 11:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:49 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