移动 FreeBSD 到新硬盘

工具准备
FreeBSD 7.0 livefs 盘,下载地址:http://ftp.tw.freebsd.org/pub/FreeBSD/ISO-IMAGES-i386/7.0/7.0-RELEASE-i386-livefs.iso

环境假设
源硬盘(FreeBSD已安装在其中): USB移动硬盘 40GB
/dev/ad0s1a / UFS 37000MB
/dev/ad0s1b SWAP 1151MB
目标硬盘(FreeBSD将移动到其中) : 本机硬盘 80GB
没有分区

用 FreeBSD livefs 盘启动
为目标硬盘分区
/dev/ad0s1a / UFS 20000MB
/dev/ad0s1d /usr/home UFS 55000MB
/dev/ad0s1b SWAP 1030MB

使用 Fixit, Main Menu->Fixit->CD/DVD

复制文件系统

Fixit# mkdir /mnt/s /mnt/d /mnt/home
Fixit# mount /dev/da0s1a /mnt/s
Fixit# mount /dev/ad0s1a /mnt/d
Fixit# mount /dev/ad0s1d /mnt/home
Fixit# cd /mnt/s
Fixit# find . -print -depth | cpio -pdm /mnt/d
Fixit# cd /mnt/d/usr/home
Fixit# find . -print -depth | cpio -pdm /mnt/home
Fixit# rm -r /mnt/d/usr/home/*

修改 /etc/fstab

Fixit# vi /mnt/d/etc/fstab
# Device		Mountpoint	FStype	Options		Dump	Pass#
/dev/ad0s1b		none		swap	sw		0	0
/proc			/proc		procfs	rw		0	0
/dev/ad0s1a		/		ufs	rw		1	1
/dev/ad0s1d		/usr/home	ufs	rw		1	1
/dev/acd0		/cdrom		cd9660	ro,noauto	0	0

Umount

Fixit# umount /mnt/*

2 thoughts on “移动 FreeBSD 到新硬盘”

Leave a Reply

Your email address will not be published. Required fields are marked *