You are not logged in.

#1 2008-12-29 00:25:53

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

How do I migrate to grub2? [SOLVED]

I want to try out grub2, and I was wondering how to migrate. This is the relevant part of the old menu.lst file:

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26.img

Does this mean that grub.cfg should be:

# (0) Arch Linux
menuentry "Arch Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26.img
}

If so, what command(s) do I need to run to get this working properly?

Offline

#2 2008-12-29 07:57:04

FrozenFox
Member
From: College Station, TX
Registered: 2008-03-23
Posts: 422
Website

Re: How do I migrate to grub2? [SOLVED]

http://bbs.archlinux.org/viewtopic.php?id=56576

This post I made may be of help to you. It's a spinoff of grub2, so some instructions should be directly comparable.

Offline

#3 2008-12-29 10:49:53

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: How do I migrate to grub2? [SOLVED]

skottish wrote:

I want to try out grub2, and I was wondering how to migrate. This is the relevant part of the old menu.lst file:

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26.img

Does this mean that grub.cfg should be:

# (0) Arch Linux
menuentry "Arch Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26.img
}

If so, what command(s) do I need to run to get this working properly?

yes looks good if you don't use ext4 on /boot (I'll add instructions for that to the wiki shortly).
Just replace grub with grub2, modify your grub.cfg to your needs and install it with 'grub-install /dev/sda'.

Most should be covered in the grub2 wiki page.

Offline

#4 2008-12-29 16:26:46

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: How do I migrate to grub2? [SOLVED]

pressh wrote:
skottish wrote:

I want to try out grub2, and I was wondering how to migrate. This is the relevant part of the old menu.lst file:

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26.img

Does this mean that grub.cfg should be:

# (0) Arch Linux
menuentry "Arch Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26.img
}

If so, what command(s) do I need to run to get this working properly?

yes looks good if you don't use ext4 on /boot (I'll add instructions for that to the wiki shortly).
Just replace grub with grub2, modify your grub.cfg to your needs and install it with 'grub-install /dev/sda'.

Most should be covered in the grub2 wiki page.

Thanks, it worked.

I'm going to start to migrate to ext4 soon enough. I don't have plans to touch /boot until I'm very clear about the procedure.

Offline

#5 2009-01-26 07:56:57

Tiberius
Member
Registered: 2008-06-08
Posts: 25

Re: How do I migrate to grub2? [SOLVED]

I must be missing a step somewhere. My setup is exactly the same as Skottish and i've two failed attempts to upgrade to GRUB2 both ending in "kernel panic ,cant sync and cant find init"
- i'm getting quite good at recovering from this crap now though lol

followed the wiki:
http://wiki.archlinux.org/index.php/GRUB2
and I left the grub.cfg created by GRUB2 un-touched.

menu.lst - working

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/3b3d47a9-ee38-46a5-870a-79161cd7d2da ro
initrd /kernel26.img

grub.cfg - fails

# (0) Arch Linux
menuentry "Arch Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda1 ro
initrd /kernel26.img
}

edit: never mind ,think I have to create a new kernel image?? i'll open a new thread.

Last edited by Tiberius (2009-01-26 09:51:26)

Offline

#6 2009-01-27 21:43:21

Tiberius
Member
Registered: 2008-06-08
Posts: 25

Re: How do I migrate to grub2? [SOLVED]

"edit: never mind ,think I have to create a new kernel image?? i'll open a new thread."

I'm still not sure if I need to do the above and a gap in my knowledge is preventing me from getting this to work...
<snip>

bash-3.2# cat /etc/mkinitcpio.conf
MODULES="pata_acpi pata_via ata_generic scsi_mod sata_via"
BINARIES=""
FILES=""
HOOKS="base udev autodetect pata scsi sata usbinput keymap filesystems"
bash-3.2# fdisk -l
Disk /dev/sda: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb95b67cd

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      514048+  83  Linux
/dev/sda2              65        1339    10241437+  83  Linux
/dev/sda3            1340        2614    10241437+  83  Linux
/dev/sda4            2615       19929   139082737+   5  Extended
/dev/sda5            2615        3889    10241406   83  Linux
/dev/sda6            3890       16637   102398278+  83  Linux
/dev/sda7           16638       19865    25928878+  83  Linux
/dev/sda8           19866       19929      514048+  82  Linux swap / Solaris

sda1 /boot ext2
sda2 /root ext3

Last edited by Tiberius (2009-01-27 21:48:43)

Offline

#7 2009-01-27 21:52:12

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: How do I migrate to grub2? [SOLVED]

You have your grub2 config pointing to your /boot partition and not your root partition. This is yours of course:

# (0) Arch Linux
menuentry "Arch Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda1 ro
initrd /kernel26.img
}

/dev/sda1 is your boot partition, right? On my system /boot is also /dev/sda1, but my root file system is /dev/sda3. That's what grub2 is looking for. This is mine:

# (0) Arch Linux
menuentry "Arch Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26.img
}

Well, this is my entire grub.cfg:

#
# Timeout for menu
set timeout=5

# Set default boot entry as Entry 0
set default=0

# (0) Arch Linux
menuentry "Arch Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda3 ro 
initrd /kernel26.img
}

# (1) Arch Linux
menuentry "Fallback" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26-fallback.img
}

Offline

#8 2009-01-27 22:34:57

Tiberius
Member
Registered: 2008-06-08
Posts: 25

Re: How do I migrate to grub2? [SOLVED]

Ok I think the penny has dropped ;-) cheers Skottish

Last edited by Tiberius (2009-01-27 22:36:00)

Offline

#9 2009-01-27 22:55:57

Tiberius
Member
Registered: 2008-06-08
Posts: 25

Re: How do I migrate to grub2? [SOLVED]

At least I'm clear in my mind why it doesn't work now ,I overlooked a small detail - the UUID !

menu.lst - working
# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/3b3d47a9-ee38-46a5-870a-79161cd7d2da ro
initrd /kernel26.img

bash-3.2# blkid
/dev/sda2: LABEL="archroot" UUID="3b3d47a9-ee38-46a5-870a-79161cd7d2da" SEC_TYPE="ext2" TYPE="ext3"

/root= sda2 doh! - cant believe I checked everything else and didnt spot that one ,so here's how it works for me.

# (0) Arch Linux
menuentry "Arch Linux" {
set root=(hd0,1)
linux /vmlinuz26 root=/dev/sda2 ro
initrd /kernel26.img
}

Last edited by Tiberius (2009-01-28 05:49:46)

Offline

Board footer

Powered by FluxBB