gentoo系统安装记录

这里是最直接的安装方法,官方文档:

http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml

 

可能你会遇到个不爽的问题:

grub-install --no-floppy /dev/sda 时候

 

end_request: I/O error, dev fd0, sector 0
end_request: I/O error, dev fd0, sector 0
Buffer I/O error on device fd0,logical block 0

 

可能你等了很久会有反应,但是那样很不爽,这样吧,Ctr+C终结

nano /boot/grub/device.map

在列表中删除fd0

 

 

下面备份一下安装过程:

 

# 配置网络环境
ifconfig eth0 192.168.0.150 netmask 255.255.255.0 up
route add default gw 192.168.0.1
echo nameserver 192.168.0.253> /etc/resolv.conf
echo nameserver 192.168.0.254 >> /etc/resolv.conf

# 看是否能通
ping -c 3 www.gentoo.org

# 修改root密码
passwd
# abc123 abc123

#启动
/etc/init.d/sshd start

# ssh远程,如果不方便原机器操作


#=========================================================================

# 分区
fdisk /dev/sda

# Disk /dev/sda: 999.7 GB, 999653638144 bytes
# 255 heads, 63 sectors/track, 121534 cylinders
# Units = cylinders of 16065 * 512 = 8225280 bytes
# Disk identifier: 0x698ef8db

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          14      112423+  83  Linux
/dev/sda2              15         276     2104515   83  Linux
/dev/sda3             277        9729    75931222+  83  Linux

#=========================================================================

# 格式化
mkfs.ext3 /dev/sda1
mkswap /dev/sda2
mkfs.ext3 /dev/sda3

# 激活交换分区
swapon /dev/sda2 

# 挂载分区
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot

scp [email protected]:/home/lighttpd/stage3-i486-20100413.tar.bz2 .
scp [email protected]:/home/lighttpd/portage-20100413.tar.bz2 .
# links http://www.gentoo.org/main/en/mirrors.xml
# 下载 /pub/gentoo/releases/x86/current-iso/stage3-i686-20091006.tar.bz2 
# 下载 /pub/gentoo/releases/x86/current-iso/stage3-i686-20091006.tar.bz2.DIGESTS 
# 下载 /pub/gentoo/releases/snapshots/current/portage-latest.tar.bz2
# 下载 /pub/gentoo/releases/snapshots/current/portage-latest.tar.bz2.md5sum
# 解压
mv stage3-i486-20100413.tar.bz2 /mnt/gentoo/
mv portage-20100413.tar.bz2 /mnt/gentoo/
cd /mnt/gentoo
tar xvjpf stage3-i486-20100413.tar.bz2
tar -xvjf portage-20100413.tar.bz2 -C /mnt/gentoo/usr

#=========================================================================

mirrorselect -i -o >> /mnt/gentoo/etc/make.conf

#=========================================================================

mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf

#=========================================================================
# 拷贝DNS信息
cp -L /etc/resolv.conf /mnt/gentoo/etc/

# 挂载/proc和/dev文件系统
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev


# chroot到新环境里
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"

#更新Portage树
emerge --sync
# 如果系统警告你有一个新版本的Portage可用,你可以使用emerge --oneshot portage来更新它。

eselect profile list
# 切换profile
eselect profile set 6

#=========================================================================
nano -w /etc/locale.gen
{
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GB18030
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
zh_CN.UTF-8 UTF-8 
}
#=========================================================================
# 运行locale-gen。它会产生所有你在/etc/locale.gen文件里指定的locale。 
locale-gen


编辑全局变量
# nano -w /etc/env.d/02locale
{
LANG="en_US"
LC_CTYPE="zh_CN.UTF-8"
}

env-update && source /etc/profile

修改系统语言
locale
export LANG=en_US
export LC_CTYPE=zh_CN.UTF-8
locale

# 7.a. 时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# 安装内核源码
# 如果有内核源码就不用下面的命令来下载了
emerge gentoo-sources

cd /usr/src/linux
make menuconfig


# 编译内核
make && make modules_install

cp arch/i386/boot/bzImage /boot/kernel-2.6.30-gentoo-r6

# 8. 配置系统
nano -w /etc/fstab
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
{
/dev/sda1               /boot           ext3            defaults,noatime        1 2
/dev/sda3               /               ext3            noatime                 0 1
/dev/sda2               none            swap            sw                      0 0
#/dev/cdrom              /mnt/cdrom      auto            noauto,user             0 0
}

# 设定主机名
nano -w /etc/conf.d/hostname
# Set to the hostname of this machine
HOSTNAME="gentoo_0"

nano -w /etc/conf.d/net
{
modules=( "ifconfig" )

config_eth0=( "192.168.0.150 netmask 255.255.255.0 brd 192.168.0.255" )
routes_eth0=( "default via 192.168.0.1" )
}

# 添加net.eth0到默认的运行级别
rc-update add net.eth0 default

# 设置root密码
passwd

# 必要安装系统日志工具

emerge syslog-ng
rc-update add syslog-ng default

# 可选:Cron守护进程
emerge vixie-cron
rc-update add vixie-cron default

# 可选:文件索引
emerge slocate

# 实用工具
emerge usbutils
emerge pciutils
# USE="-gtk" emerge evms


# 配置引导程序
# 安装GRUB
emerge grub
# 创建/boot/grub/grub.conf
nano -w /boot/grub/grub.conf
{
default 0
timeout 30
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux 2.6.32-gentoo-r7
root (hd0,0)
kernel /boot/kernel-2.6.32-gentoo-r7 root=/dev/sda3
#kernel /boot/kernel-2.6.30-gentoo-r6 root=/dev/sda3 video=uvesafb:mtrr:3,ywrap,1024x768-32@85

title Gentoo Linux 2.6.32-gentoo-r7 (rescue)
root(hd0,0)
kernel /boot/kernel-2.6.32-gentoo-r7 root=/dev/sda3 init=/bb

}

# 创建/etc/mtab
 grep -v rootfs /proc/mounts > /etc/mtab
# 执行grub-install ,可能会遇到问题:nano /boot/grub/device.map 删除fd0,这是一个已知的BUG
grub-install --no-floppy /dev/sda


# 卸载所有分区和重启

exit
cd
umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
reboot
 

你可能感兴趣的:(c,linux,.net,ssh,lighttpd)