Chinaunix首页 | 论坛 | 博客
  • 博客访问: 128238
  • 博文数量: 4
  • 博客积分: 1560
  • 博客等级: 上尉
  • 技术积分: 315
  • 用 户 组: 普通用户
  • 注册时间: 2004-11-13 15:02
文章分类

全部博文(4)

文章存档

2009年(2)

2008年(2)

我的朋友

分类: BSD

2008-09-28 15:13:40

Source: 




Grossmann Martin  
 更多選項 2006年3月31日, 下午1時44分
新聞群組: lucky.freebsd.questions
寄件者: "Grossmann Martin"
日期: Fri, 31 Mar 2006 20:44:08 +0200
當地時間: 2006年3月31日(星期五) 下午1時44分
主旨: bootable FreeBSD on USB-Flash-Drive [SOLUTION]
| | | | | |
a little success story with freebsd and a tiny usb stick:
[tried with FreeBSD 6.1-BETA4 install-cd and a kingston 256MB
usb-flash-drive]

prepare yourself to work on the command-line ;-)
- attach the usb-stick to the server
- boot the freebsd installation cd-rom
- go to the "fixit" shell
- CHECK YOUR DMESG WHAT DEVICE YOUR USB STICK ACTUALLY IS!!! (here /dev/da0)

create the future "/"-filesystem on your usb-drive:

wipe everything on the usb-drive:
# dd if=/dev/zero of=/dev/da0 bs=1m
create a new partition table on it with a default slice 1 and make it
bootable
# fdisk -BI /dev/da0
label it for booting freebsd:
# bsdlabel -wB /dev/da0s1
you'll have to edit the disklabel (sometimes you'll have to: # export
EDITOR=/mnt2/usr/bin/vi):
# bsdlabel -e /dev/da0s1
... and change partition a from "unused" to "4.2BSD" as partition type
create the future "/" a.k.a. root-filesystem on it:
# newfs -m 0 -o space /dev/da0s1a

mount the filesystem for installation:
# mount /dev/da0s1a /mnt

install freebsd on /mnt:
# export DESTDIR=/mnt
# cd /dist/
# for i in base manpages catpages
# do
#   cd $i; echo y|./install.sh; cd ..;
# done

go to the kernels directory and install a kernel of your choice:
[default is GENERIC kernel; change to "smp" for smp-machines]
# rmdir /mnt/boot/kernel
# cd kernels;
# cat generic.??|tar --unlink -xpzf - -C /mnt/boot
# cd /mnt/boot && mv GENERIC kernel

now, tell freebsd to mount the right root-filesystem:
# echo "/dev/da0  /  ufs  rw,noatime  1  1" >/mnt/etc/fstab

create your rc.conf.local in /mnt/etc to redefine some settings:
# cat </mnt/etc/rc.conf.local
#!/bin/sh
tmpmfs="YES"
tmpsize="128m"
varmfs="YES"
varsize="128m"
populate_var="YES"
hostname="daisy.duck.home"
keyrate="fast"
EOFRCCONF

# chmod 0755 /mnt/etc/rc.conf.local

set a new root password manually, if you want (default="")
# chroot /mnt /usr/bin/passwd root

well, there are many other things you could do like configuring
hosts, networks, dns, users, add. filesystems, etc... but this
is another stuff!

cu & have fun!

ps: just reply to the list for comments/flames, i'm on it ;-)
pps: thx 2 the installer team for keeping things simple and easy!
阅读(2048) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~