前置步骤:
1. 下载 Gentoo Live DVD 10.1 (Gentoo十周年纪念版)
2. x86版下载位置:http://mirrors.sohu.com/gentoo/releases/x86/10.1/livedvd-x86-amd64-32ul-10.1.iso
3. x64版下载位置:http://mirrors.sohu.com/gentoo/releases/amd64/10.1/livedvd-amd64-multilib-10.1.iso
相关阅读:Gentoo Linux最小安装 http://www.linuxidc.com/Linux/2011-12/48643.htm
安装步骤:
1. 分割磁区
2. 格式化分割区
3. 挂载分割区
4. 复制Live DVD Gentoo档案
5. 把环境切到硬碟
6. 修改root密码
7. 安装grub到 mbr
8. 设定、注解与停用服务
9. 复制kernel到 /boot区
10. 修改/etc/fstab
11. 编辑/boot/grub/grub.conf
12. 重开机,退出光碟
13. 完成基础Gentoo Live DVD安装
LiveDVD 光碟开机,不进X-Window开机,加快安装速度
boot: gentoo nox
分割磁区
这里是 boot 100M、SWAP 1G、ROOT 79G,其实 ROOT分割10G就可以了,如果不在安装什么的话!保险一点就是开大一点啰。
Livecd ~ # fdisk /dev/sda
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (15-10443, default 15): 1
Last cylinder, +cylinders or +size{K,M,G} (15-10443, default 10443):+100M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (15-10443, default 15): 15
Last cylinder, +cylinders or +size{K,M,G} (15-10443, default 10443): +1G
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (15-10443, default 15): 147
Last cylinder, +cylinders or +size{K,M,G} (15-10443, default 10443): 10443
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap / Solaris)
Command (m for help): p
Disk /dev/sda: 85.8GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x52a68f74
Device Boot Start End Blocks Id System
/dev/sda1 1 14 112423+ 83 Linux
/dev/sda2 15 146 1060290 82 Linux swap / Solaris
/dev/sda3 147 10443 82710652+ 83 Linux
Command (m for help): wq
格式化分割区
mkfs.ext3 /dev/sda1
mkswap /dev/sda2
mkfs.ext4 /dev/sda3
挂载分割区
swapon /dev/sda2
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot
复制 Live DVD Gentoo文件
cp –apf /mnt/livecd/* /mnt/gentoo
把环境切换到硬盘
chroot /mnt/gentoo /bin/bash
env-update && source /etc/profile
修改 root 密码
passwd
New password: ******
Retype new password: ******
passwd: password updated successfully
安装 grub 到 mbr
grub
root (hd0,0)
setup (hd0)
quit
注解 /etc/conf.d/local.start 里面全部东西,或用下面的指令清空
cat /dev/null > /etc/conf.d/local.start
rc-update del autoconfig
设定时区
rm /etc/localtime
ln –s /usr/share/zoneinfo/Asia/Taipei /etc/localtime
修改 /etc/fstab
/dev/sda1 /boot ext3 defaults 1 2
/dev/sda2 none swap sw 0 0
/dev/sda3 / ext4 defaults 0 1
复制 kernel 到 /boot区
cp /usr/src/linux/System.map /boot/System.map-genkernel-x86-2.6.30-gentoo-r6
cp /usr/src/linux/arch/i386/boot/bzImage /boot/kernel-genkernel-x86-2.6.30-gentoo-r6
genkernel ramdisk
编辑 /boot/grub/grub.conf 内容如下
default 0
timeout 30
title Gentoo Linux 2.6.30-r6
root (hd0,0)
kernel /boot/kernel-genkernel-x86-2.6.30-gentoo-r6 root=/dev/rm0 real_root=/dev/sda3
initrd /boot/initramfs-genkernel-x86-2.6.30-gentoo-r6
退出环境,重开机,退出光碟
exit
reboot