# customized FreeBSD Desktop LIVE on USB stick



## ccc (Dec 19, 2010)

hi

Howto create my own customized FreeBSD Desktop LIVE on USB stick and make it bootable?


----------



## tingo (Dec 19, 2010)

The same way as you would install FreeBSD on any other hard drive?
I'm not sure I understand your question?


----------



## ccc (Dec 21, 2010)

tingo said:
			
		

> The same way as you would install FreeBSD on any other hard drive?
> I'm not sure I understand your question?



I think, you didn't understand my question.


----------



## danbi (Dec 21, 2010)

I don't think you need 'desktop' on the USB stick. If you can do your job with the shell, you may use the USB memstick image from http://www.freebsd.org/releases/8.1R/announce.html.

If you need 'desktop' you may use this memstick image to install the 'desktop' (X11, kde/gnome etc) on another USB stick.


----------



## Beastie (Dec 21, 2010)

ccc said:
			
		

> I think, you didn't understand my question.


Then rephrase it.
Are you asking how to install a FreeBSD *livefs* system on a USB pendrive or how to install FreeBSD on that USB pendrive (and thus make a live system)? I believe the USB ISO image provided has a "fixit" environment. As for the latter, tingo's reply still stands.


----------



## ccc (Jan 28, 2011)

Really sorry for misunderstanding.
I'd like to customize, install some additional programs and create my own FreeBSD Live running from USB.


----------



## Beastie (Jan 28, 2011)

You still can achieve that by doing a normal installation using sysinstall and just choosing da0 instead of ad0.

Another way is to create an image on your (internal) disk and install things inside it. This is more useful than the above if you want to redistribute the image. (Well you can always do the above and dd the pendrive to create an image of it but still.)
You'll need the distributions from here or from a *disc1*/*dvd1*. The *base* and *kernels* distributions are the only ones required, the rest is optional.
If you want to customize the system, then install from source as is done normally (buildworld/kernel, installworld/kernel).

Of course you should mount directories such as /tmp, /var/run, /var/log, etc. on md(4) (i.e. *FStype*=*mfs* in fstab) in order to minimize writes on the flash memory.

`% dd if=/dev/zero of=freebsd.iso count=2000 bs=1m`
`# mdconfig -a -t vnode -f freebsd.iso -u 0`
`# fdisk -BI /dev/md0`
`# bsdlabel -B -w md0s1`
(a single partition for a live system should be good enough)
`# newfs /dev/md0s1a`
`# mount -o noatime /dev/md0s1a /mnt/md`
In the directory of each distribution you want to install (you should be using sh for that):
`# DESTDIR=/mnt/md ./install.sh`
Do anything else you want to do here.
`# umount /mnt/md`
`# mdconfig -d -u 0`
Note 1: the above may contain many errors, missing and inaccurate things, but you should get the general idea.
Note 2: the kernel should be installed in /boot/kernel so make sure it's there when you extract the *kernels* distribution.
Note 3: don't forget to create the /mnt/md/etc/fstab file and any other configuration file.
Note 4: you can create a GEOM label for your partition.

Applications can be installed as packages (or packaged ports, see pkg_create(1)) from your current installation using pkg_add()'s *-C* / *--chroot* option I believe. Or you could boot the pendrive and install applications from there.


----------



## ccc (Feb 11, 2011)

Thanks a lot, but I'd like to create a FreeBSD live image to boot every x86 computer.

NanoBSD seems to be one of the solutions:

http://www.freebsd.org/doc/en_US.ISO8859-1/articles/nanobsd/howto.html


----------

