Booting Fedora 11 from ext4 filesystem using Grub2
Chinese title: 使用Grub2从ext4分区上启动Fedora 11
By beta-song, 2009-10-09
Although ext4 becomes the default filesystem, Fedora 11 still refuses to use ext4 format as "boot" partition. When you install Fedora 11, you will have to create a separate ext3 partition for "boot" directory. That limitation originates from the OS loader - Grub, not from the OS itself.
This tutorial describes how you can boot your Fedora 11 from ext4 filesystem using Grub2 (the next generation of GRUB). I don't issue any guarantee that this will work for you.
1 Preliminary note
I will install Fedora 11 on the Thinkpad T61 laptop, and the Grub2 I use is version 1.97~beta3.
2 Installing Fedora 11 on two partitions
Boot the laptop from Fedora 11 DVD, and install it to the following partitions:
/dev/sda1 --(ext4)--> /
/dev/sda2 --(ext3)--> /boot
3 Installing Grub2
After installed Fedora 11, boot into it, and it's time to compile Grub2:
# tar zxvf grub-1.97~beta3.tar.gz
# cd grub-1.97~beta3
# ./autogen.sh
# ./configure
# make
# make install
Install Grub2 onto the MBR:
# ./grub-install /dev/sda
4 Boot Fedora 11 from ext4 filesystem
Move "boot" directory from /dev/sda2 to /dev/sda1:
# cd /
# umount /dev/sda2
# mkdir /boot1
# mount /dev/sda2 /boot1
# cp -dpR /boot1/* /boot/
Now the whole Fedora 11 system is all in one partition /dev/sda1, and /dev/sda2 is free to use for any other purpose.
Delete the following line from /etc/fstab:
/dev/sda2 /boot ext3 defaults 0 0
And now it's look like:
/dev/sda1 / ext4 defaults 1 1
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
……
Add Grub2 configuration file /boot/grub/grub.cfg, with the following contents:
# Begin
# GRUB2 configuration file
#
# Boot automatically after 30 secs.
set timeout=30
# By default, boot the first entry.
set default=0
# This is the entry for Fedora 11
menuentry "Fedora 11" {
set root=(hd0,1)
linux /boot/vmlinuz-2.6.31.1 root=/dev/sda1
initrd /boot/initrd-2.6.31.1.img
}
# End
For Grub2, the partition number counts from 1 instead of 0, here (hd0,1) means /dev/sda1. Also, the indication for kernel is not "kernel", it's "linux". Please notice that.
Reboot, and everything go well~ Good luck!
5 Links
* This aritcle: http://blog.chinaunix.net/u/8754/showart_2066255.html
* Beta-song' blog: http://sxg.cublog.cn
* Grub2:
阅读(1425) | 评论(0) | 转发(0) |