Setting grub on cd

Goh Lip g.lip at
Thu Mar 17 03:18:31 UTC 2011

On 03/17/2011 04:41 AM, uriah heep wrote:
> On Thu, Feb 3, 2011 at 11:57 AM, Goh Lip <g.lip at
> <mailto:g.lip at>> wrote:
>     On Thu, 03 Feb 2011 19:15:12 +0800, uriah heep <stan10x10 at
>     <mailto:stan10x10 at>> wrote:
>         I have to have a dual boot system because some programs I need
>         do not have
>         equivalent Linux programs or will not export in a format that
>         windows users
>         can use. But when ever windows screws up my Linux install is
>         also screwed.
>         Could some one kindly point me to simple documentation to
>         install grub to a
>         CD in a manner so I can keep the OSes from disabling each other?
>     Uriah, to make a simple cd grub boot, just
>     grub-mkrescue --output=anything.iso
>     where anything.siso can be any thing you name.
>     However if you want to include a grub.cfg file then
>     grub-mkrescue --output=grubo.iso /media/LABEL/boot/grub/grub.cfg
>     where /media/LABEL is the partition where you want the right
>     grub.cfg you want copied over.
>     But remember if you boot up from that cd, do a "configfile
>     /grub.cfg" so that the grub menu appears at the grub prompt.
>     Just got back from a short new year (my new year, not yours)
>     holidays, but if you need more info, please let us know.
>     Regards - Goh Lip
>     --
>     I used to have an open mind,
>     but my brains kept falling out.
>     --
> Just got back to this as I am setting up a laptop to be dual boot. with
> windows 7 installed and installing Kubuntu I would get an option of
> where to install grub. is this where I can do the above or do I use my
> desktop which has usual dual boot to go into Kubuntu and issue commands
> at command line and then how do I burn to cd?

Uriah, to have another option where to install grub, and after 
installation of OS is done, "dpkg-reconfigure grub-pc" and follow 
instructions. At installation of OS itself  -  when you manually select 
partition where to install OS to, there is an 'advanced' button - and 
you can select where grub is to be set.

Note however, if you select /dev/sdaX instead of just /dev/sda, you may 
be unable to boot up to Kubuntu OS unless you have other means, like a 
bootcd, or another boot process from another installed OS etc; so be 
very careful if you do this.

To burn to grub bootcd, as per my previous post,
grub-mkrescue --output=anything.iso
grub-mkrescue --output=grubo.iso /media/LABEL/boot/grub/grub.cfg

Considering what you're trying to do, suggest you just make a plain grub 
boot cd first from your desktop, just to boot up your new kubuntu 
installation at your laptop. Then when your laptop is installed (with 
grub set to /dev/sdaX), then boot to laptop Kubuntu and make another 
grub boot cd with grub.cfg from that new installation.

We can of course, just make one straight from the desktop, but I think 
it is preferable to have the grub.cfg include the uuid number as well as 
the windows of the laptop, and these will only be generated at the point 
of installation.

Regards - Goh Lip

grub-mkrescue --output=grubo.iso /media/LABEL/boot/grub/grub.cfg
can just be
grub-mkrescue --output=grubo.iso /boot/grub/grub.cfg
if the grub is at existing OS

If you like to do this, I'll provide a very simple grub.cfg and you can 
copy to your grub cd boot. of course amend the x's or delete the uuid 
part and replace with either label or /dev/sdax + (hd0,x) if you prefer.

###   SETUP   ###

set root=(hd0,x)
search --no-floppy --fs-uuid --set xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

set default=0
set timeout=10

set menu_color_normal=white/blue
set menu_color_highlight=yellow/blue

menuentry "only ONE linux installed " {
insmod ext2
search --set -f /boot/vmlinuz
linux /vmlinuz root=UUID=xxxxxxxxxxxxxxxx ro
initrd /initrd.img

menuentry "Windows - sda1" {
    insmod ntfs
    set root='(hd0,1)'
    drivemap -s (hd0) ${root}
    chainloader +1

########   END    ########

you can boot grub using usb drives too, but need to be more careful with 
/dev/sda reversing with /dev/sdb or (hd0,x) with (hd1,x)

Life is a sexually transmitted disease with a 100% mortality rate.

More information about the kubuntu-users mailing list