1 用live CD启动,光盘进入。
2 pppoeconf配置网络
上网找cn99源,加入/etc/apt/sources.list
sudo apt-get update
安装dmraid: sudo apt-get install dmraid
3 分区
sudo dmraid -ny
启动gparted
对mapper/ddf1....进行分区,注意一个一个分(中间有错误信息,不理会),不格式化。apply chage
奇怪:320G mapper比sdx少1个G,故sdx有1G未分配。
4 格式化
mkfs -t ext3 /dev/map...
mkswap /dev/ma...
5
sudo mkdir /target
sudo mount -t reiserfs /dev/mapper/via_hfciifae7 /target
cd /target
sudo mkdir boot dev cdrom proc sys
sudo mount -t ext2 /dev/mapper/via_hfciifae5 /target/boot --->改挂/target/home
sudo mount --bind /dev /target/dev
# added: mount the cdrom to install packages from ubuntu ISO
sudo mount --bind /cdrom /target/cdrom
sudo mount -t proc proc /target/proc
sudo mount -t sysfs sysfs /target/sys
6 Install the Base System
sudo apt-get install debootstrap
# install base system 好长时间2h
sudo debootstrap feisty /target # or breezy etc
# copy configuration files
sudo cp /etc/apt/sources.list /target/etc/apt
sudo cp /etc/resolv.conf /target/etc
sudo cp /etc/hosts /target/etc/hosts
sudo cp /etc/network/interfaces /target/etc/network
# run in the now installed system as a chroot
sudo chroot /target
# You are now superuser so do not need sudo
# Add packages from the ubuntu install CD/DVD
apt-cdrom -m add
# Update the apt repository
apt-get update
# replace en with the two-letter identifier for your language
apt-get install language-pack-en 用-zh代替-en
# exit, remount proc+sysfs, then chroot again
exit
sudo mount -t proc proc /target/proc
sudo mount -t sysfs sysfs /target/sys
sudo chroot /target
sudo apt-get install dmraid
7---------------------
apt-get install grub # or other bootloader
# if unsure of your kernel, run 'apt-cache search linux-'
apt-get install linux-386 # or k7, k8, k8-smp, etc
The installer may ask you some questions:
Q: Create a symbolic link? A: Yes (press SPACE)
Q: You need to configure your bootloader. A: ok (TAB, SPACE)
Q: Do you want to abort now? A: No (TAB, SPACE)
8-----------------------
apt-get install ubuntu-standard # or minimal or base (dapper) 选择base
# Optional: you can install this later if you like
apt-get install ubuntu-desktop # or ubuntu-server, xubuntu-desktop, etc 约40分钟 217k/s
# You MUST add a user
# (you can do this in a second window while waiting for apt-get
# if you sudo chroot /target first)
useradd zzf # your name instead of alice
passwd zzf
mkdir /home/zzf
chown alice /home/zzf
9---------------------------Set Up the Bootloader for RAID
mkdir /boot/grub
cp /usr/lib/grub/<your-cpu-arch>-pc/stage1 /boot/grub/ #i386-pc
cp /usr/lib/grub/<your-cpu-arch>-pc/stage2 /boot/grub/
cp /usr/lib/grub/<your-cpu-arch>-pc/<the staging file for your boot partition's filesystem>
The "staging files" look like: "e2fs_stage1_5" (for ext2 or 3); "reiserfs_stage1_5" (for reiserfs); "xfs_stage1_5" (and so on). It is safe to copy them all to your /boot/grub.
Next, go into the grub shell:
grub
You should now see the grub prompt.
device (hd0) /dev/mapper/ddf...
root (hd0,0) #我的在第一分区
setup (hd0)
quit
update-grub
10----------配置启动菜单
备份 cp /boot/grub/menu.lst /boot/grub/menu.lst.bak
vi /boot/grub/menu.lst
title Ubuntu, kernel 2.6.15-29-amd64-k8
root (hd0,4)
kernel /vmlinuz-2.6.15-29-amd64-k8 root=/dev/mapper/ddf... ro quiet
initrd /initrd.img-2.6.15-29-amd64-k8
savedefault #此行删掉,Every time you run update-grub you need to manually remove savedefault
boot #可以不要The "boot" command you would issue at the grub prompt is implied, so you can leave it out of the menu file.
ps: windows菜单
title Windows XP
rootnoverify (hd0,XX)
chainloader +1
prevented from editing the bootlines, and prevented from dropping to a command prompt. To do this, in the console type:
grub-md5-crypt
When it prompts you "Password:", it's asking what you want to be the GRUB password (not your user password, the root password, or anything else).
You will be prompted to enter it twice, then it will spit out the MD5 hash that you need to paste into menu.lst. This line should end up looking something like the following (obviously, the MD5 hash of YOUR password goes where "$1$gLhU0/$aW78kHK1QfV3P2b2znUoe/" is shown):
password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
Then, to keep your "recovery mode" boot alternative(s) locked each time update-grub runs, set
lockalternative=true
make a backup of menu.lst - then run update-grub again - watch for errors and re-examine menu.lst for discrepancies - correct as needed.
1)再次update-grub
2)然后再进入vi /boot/grub/menu.lst
3)去掉savedefault
1)2)3)没做,漏了,补做时光盘不动、系统死了,只好重启,重启好像没问题 :)
11----------------------Preconfigure the New System
sudo chroot /target
cat /etc/mtab
nano /etc/fstab
Then delete everything except the proc line, and the lines that refer to your RAID partitions. It might end up something like this (yours will vary - people asked for examples):
#FileSystem MountPoint Type Options Dump/Pass
proc /proc proc rw 0 0
/dev/mapper/via_hfciifae5 /boot ext3 defaults 0 2
/dev/mapper/via_hfciifae7 / reiserfs notail,noatime 0 1
/dev/mapper/via_hfciifae6 none swap sw 0 0
启动界面,按esc,选择菜单recovery,设置passwd。
重启,出现错误:/bin/sh:can't access tty;job control turned off
参考文档
https://help.ubuntu.com/community/FakeRaidHowto
https://wiki.ubuntu.com/FakeRaidEdgy
http://ftp.riken.go.jp/pub/Linux/ubuntu/pool
花了两个晚上到2、3点,郁闷死,放弃fakeRaid,下载64位,使用软Raid
http://www.ubuntu.com/getubuntu/download
Ubuntu Edition: Ubuntu 6.06.1 server
Computer Platform: amd64