сряда, 22 август 2007 г.

Днес забелязах няколко статийки за това как да си пуснем Фрии БиЕсДи на ЮЕсБи
...
Installing FreeBSD onto a USB stick
Posted by Ceri Davies on 21 Март 2006 г.
Note: this is pretty much obsoleted by the followup article. You really should read that one instead.
It seems that a bunch of folks are ending up here by searching for instructions for installing FreeBSD on a USB stick, so here they are.
I'll assume that, like me, you don't have any SCSI disks and so your USB stick will show up on da0. I'm also assuming that you don't care much for the data on there.
The easy way
A little secret - the easy way to do this is to boot from the installation CDROM while you have the USB stick in and just install to it.
You didn't come here for that though, did you?
The slightly more involved way
It doesn't qualify as "hard".
You'll still need to grab that ISO — get the latest one.
Mount that ISO on /dist: # mkdir /dist
# mdconfig -a -f /a/FreeBSD/6.1-BETA4-i386-disc1.iso
md17
# mount -t cd9660 /dev/md17 /dist
Insert the stick. They come preformatted with a FAT32 partition on, so we'll need to throw a BSD slice label on there — this command will destroy all existing slices. If you get a warning regarding "Geom not found", don't worry.:# fdisk -BI /dev/da0
We need a disk label:# bsdlabel -B -w da0s1
and a filesystem, which we'll mount on /mnt:# newfs -U /dev/da0s1a
/dev/da0s1a: 481.0MB (985040 sectors) block size 16384, fragment size 2048
using 4 cylinder groups of 120.25MB, 7696 blks, 15424 inodes.
with soft updates
super-block backups (for fsck -b #) at:
160, 246432, 492704, 738976
# mount /dev/da0s1a /mnt
Now to do an install the blindingly easy way:# cd /dist/6.1-BETA4/base
# DESTDIR=/mnt ./install.sh
You are about to extract the base distribution into /mnt - are you SURE
you want to do this over your installed system (y/n)? y
Since we are using 6.1-BETA4, there is some additional messing about to do. This is very likely to change in later release candidates (since it is somewhat broken), but this works for 6.1-BETA4:# cd /dist/6.1-BETA4/kernels
# DESTDIR=/mnt sh ./install.sh generic
# rmdir /mnt/boot/kernel
# mv /mnt/GENERIC /mnt/boot/kernel
Make the USB stick bootable:# boot0cfg -v -B da0
# flag start chs type end chs offset size
1 0x80 0: 1: 1 0xa5 480: 63:32 32 985056
version=1.0 drive=0x80 mask=0xf ticks=182
options=packet,update,nosetdrv
default_selection=F1 (Slice 1)
Create an fstab(5) file on the USB stick. Here's a simple one:/dev/da0s1a / ufs rw 1 1
md /tmp mfs rw,-s16M,nosuid,noatime 0 0
/dev/acd0 /cdrom cd9660 ro,noauto,nosuid 0 0
proc /proc procfs rw 0 0
Install any packages you might want:# chroot /mnt /bin/sh
# pkg_add -r lsof rsync unzip zsh kde...
You're done.
...

nstalling FreeBSD on a USB stick, episode II
Posted by Ceri Davies on 13 Април 2006 г.
I previously wrote about putting a 6.1-BETA4 FreeBSD installation on a USB stick. Since the bugs that were in the 6.1-BETA4 installation have been fixed, plus to get 6.1-RC1 tested, here are updated instructions (which should work with 6.1-RELEASE as well).
These instructions result in a downloadable image suitable for dding direct to a USB stick of 512MB or larger.
arved pointed out that it’s good to minimize the amount of writes done to USB sticks (and flash memory in general), and I’ve got some pointers in these instructions, but I haven’t really looked at this point.
If you are looking to install FreeBSD from a USB stick, you should check out Dario Freni’s script.
Note
I assume that, like me, you don't have any SCSI disks and so your USB stick will show up on da0, at least while you're preparing it; we're using GEOM disk labels in the image so we don't care so much where the disk appears in the device tree. I'm also assuming that you don't care much for the data on your USB stick.
The installation
You'll need to grab the disc1 ISO — get the latest one.
Mount that ISO on /dist: # mkdir -p /dist
# mdconfig -a -f /a/FreeBSD/6.1-RC1-i386-disc1.iso
md1
# mount -t cd9660 /dev/md1 /dist
Insert the stick. They come preformatted with a FAT32 partition on, so we'll need to throw a BSD slice label on there — this command will destroy all existing slices. If you get a warning regarding "Geom not found", don't worry.:# fdisk -BI /dev/da0
We need a disk label:# bsdlabel -B -w da0s1
and a filesystem, which we'll mount on /mnt. In order to reduce the number of writes to the USB pen, and as common practice, we use the -U flag to enable soft updates. Additionally, so that we can find the filesystem easily no matter where the USB pen appears in the device tree, we will label the filesystem as FreeBSDonUSB:# newfs -U -L FreeBSDonUSB /dev/da0s1a
/dev/da0s1a: 481.0MB (985040 sectors) block size 16384, fragment size 2048
using 4 cylinder groups of 120.25MB, 7696 blks, 15424 inodes.
with soft updates
super-block backups (for fsck -b #) at:
160, 246432, 492704, 738976
# mount /dev/da0s1a /mnt
Now to do an install the blindingly easy way:# cd /dist/6.1-RC1/base
# DESTDIR=/mnt ./install.sh
You are about to extract the base distribution into /mnt - are you SURE
you want to do this over your installed system (y/n)? y
With 6.1, we are providing both uniprocessor and SMP kernels on the CD. sysinstall will install the correct one depending on your hardware configuration, but we need to decide. It's probably OK to just use the SMP one, but I have no multiprocessor machines, so will use the UP kernel. If you want the SMP kernel, just specify smp where I have generic below:# cd /dist/6.1-RC1/kernels
# DESTDIR=/mnt ./install.sh generic
# rmdir /mnt/boot/kernel
# mv /mnt/boot/GENERIC /mnt/boot/kernel
Install the boot manager. We use the noupdate option to prevent boot0 writing itself back to disk every boot:# boot0cfg -v -B -o noupdate da0
# flag start chs type end chs offset size
1 0x80 0: 1: 1 0xa5 480: 63:32 32 985056
version=1.0 drive=0x80 mask=0xf ticks=182
options=packet,noupdate,nosetdrv
default_selection=F1 (Slice 1)
Create an fstab(5) file on the USB stick. Here's a simple one that puts the logs on to memory storage (to try to minimize writes). We also null mount /var/tmp on /tmp, which makes it non-persistent:# Device Mountpoint FStype Options Dump Pass#
/dev/ufs/FreeBSDonUSB / ufs rw,noatime 1 1
md /tmp mfs rw,-s16M,nosuid,noatime 0 0
md /var/run mfs rw,-s4M,nosuid,noatime 0 0
md /var/log mfs rw,-s16M,nosuid,noatime 0 0
/dev/acd0 /cdrom cd9660 ro,noauto,nosuid 0 0
/proc /proc procfs rw,noauto 0 0
/tmp /var/tmp nullfs rw 0 0
Since we're using the UFS label to define the root filesystem, we must force the GEOM label class to be loaded early:# cat >> /mnt/boot/loader.conf << EOF
geom_label_load="YES"
EOF
vi(1) likes to have a /var/tmp/vi.recover around, so we ensure that it exists on boot. Pull down this example script and install it:# mkdir -p /mnt/usr/local/etc/rc.d/
# cd /mnt/usr/local/etc/rc.d/
# fetch http://people.freebsd.org/~ceri/FreeBSDonUSB/scripts/mkvirecover
# chmod 555 mkvirecover
In order for commands that use wtmp(5) to work correctly with /var/log on a memory disk, we need to tell newsyslog(8) that it is OK to create an empty /var/log/wtmp. Edit /mnt/etc/newsyslog.conf and add C to the /var/log/wtmp line:/var/log/wtmp 644 3 * @01T05 BC
Set the interfaces to configure themselves over DHCP. I exclude plip0 and fwe0 since they are practically never connected to a DHCP server, but are reasonably common:# cat >> /etc/rc.conf << EOF
ifconfig_DEFAULT="DHCP"
ifconfig_fwe0="NOAUTO"
ifconfig_plip0="NOAUTO"
EOF
Again, to reduce the number of writes to the USB key, we will pregenerate a locate database and then turn off the weekly update:# chroot /mnt /bin/sh
# mount_devfs devfs /dev
# /etc/periodic/weekly/310.locate
Rebuilding locate database:
# cat >> /etc/periodic.conf << EOF
weekly_locate_enable="NO"
weekly_whatis_enable="NO"
EOF
Install any packages you might want, and set a root password:# chroot /mnt /bin/sh
# passwd root
# pkg_add -r lsof rsync unzip zsh kde...
That's it for now.
...
http://typo.submonkey.net/articles/2006/03/20/installing-freebsd-onto-a-usb-stick
http://typo.submonkey.net/articles/2006/04/13/installing-freebsd-on-usb-stick-episode-2

Както и за доброто митично същество Убунту (на ЮЕсБи и под КюЕму)
http://www.pendrivelinux.com/2007/02/12/usb-ubuntu-tutorial-for-linux-users/
http://www.pendrivelinux.com/2007/03/26/portable-qemu-persistent-ubuntu-linux/