星期三, 6月 04, 2008

用debootstrap安裝系統

1.準備並掛載根目錄
mkdir /new_root
mount /dev/new_partition /new_root
mkdir /new_root/dev
mount --bind /dev /new_root/dev
mkdir /new_root/proc
mount -t proc proc /new_root/proc
mkdir /new_root/sys
mount -t sysfs sys /new_root/sys

2.安裝基礎系統
sudo apt-get install debootstrap
debootstrap dapper /new_root
cp /etc/apt/sources.list /new_root/etc/apt
cp /etc/resolv.conf /new_root/etc
cp /etc/hosts /new_root/etc
cp -a /etc/network* /new_root/etc

3.chroot到new_root繼續安裝
sudo chroot /new_root
apt-get update
apt-get install ubuntu-base linux-386 ubuntu-desktop dmraid grub

4.安裝GRUB
mkdir /boot/grub
cp /lib/grub/i386-pc/stage1 /boot/grub/
cp /lib/grub/i386-pc/stage2 /boot/grub/
grub
device (hd0) /dev/new_disk
root (hd0,0)
setup (hd0)
quit
update-grub

5.檢查並修改設定
vi /boot/grub/menu.lst
vi /etc/fstab

沒有留言: