News

Gentoo linux 10.1 Live DVD 超快速安裝方法

Contributed by TyroneYeh on Jun 04, 2010 - 12:05 AM

因為Gentoo Linux的程式會在自己的電腦裡編譯,所以安裝X-Window (KDE4)會很久,所以就找了個辦法來快速安裝,就是把 live DVD的Gentoo X-Window編譯好的環境複製到硬碟裡,這樣就不用長時間編譯的動作,不過很怪的事,DVD才2.6G左右,複製到硬碟中就要9G,複製的時間約要20分鐘(VirtualBox Intel P7350 2.0G 4GRAM),整體安裝應該可以在 30 minute 內完成安裝跟Live DVD一模一樣的環境。

ps. Gentoo 如果要正常方式安裝有 X-Window 需一天一夜

特地錄了一個安裝影片,不過因為輸入指令不快加上 Grub 設定大小寫錯誤,小修了一下,但也有安裝成功!花了 43.53 分鐘!

Gentoo Linux 10.1 LiveDVD to install 43.53 minute (Real-time)

已知但還無法解決的問題:
1. 會預設帶 Gentoo 帳號登入,跟 Live DVD開機後等個10秒就用這個帳號自動登入。
2. 還沒有中文環境,跟 Live DVD開機後一樣。
3. 就是跟 Live DVD開機後一樣啦。

環境:
1. Host: Win7 (64bit) + VirtualBox(32bit) Gentoo Linux 10.1 Live DVD
2. Host: 4G RAM / Guest 512M RAM
3. Host: 320G HDD / Guest 80G HDD

前置步驟:
1. 下載 Gentoo Live DVD 10.1 (Gentoo十週年紀念版)
2. x86版下載位置 ftp://ftp.twaren.net/pub/Linux/Gentoo/releases/x86/10.1/livedvd-x86-amd64-32ul-10.1.iso
3. x64版下載位置ftp://ftp.twaren.net/pub/Linux/Gentoo/releases/amd64/10.1/livedvd-amd64-multilib-10.1.iso
看起來x86版看檔名也可以裝64位元的樣子,VirtualBox虛擬機器就不多介紹了


安裝步驟:
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
參考資料:
1. http://www.adzymaniac.web.id/force-install-gentoo-10-1-livedvd/
2. http://www.gentoo.org/doc/zh_tw/gentoo-x86-quickinstall.xml

 

發票登錄摘要

使用者數 256 位
發票張數 21354張
花費金額 2266370 元
中獎金額 62074600元
金額比率 2738.94 %