歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Gentoo Linux 快速安裝方法安裝

Gentoo Linux 快速安裝方法安裝

日期:2017/2/28 16:02:03   编辑:Linux教程
前置步驟:
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

Copyright © Linux教程網 All Rights Reserved