Install FreeBSD on a flash drive?

Hello and welcome to the forums.

Is it possible to install FreeBSD on a flash drive or memory stick and use them as an HD?
Yes. Instead of installing to something like ada0, you install to something like da0.
The most significant difference is that USB devices are much slower.
Mounting /tmp on tmpfs(5) is highly recommended for such setup.
 
Is it possible to install FreeBSD on a flash drive or memory stick and use them as an HD?
All are treated as regular disks and can therefor be used to install onto. One thing to note though, flash drives or memory sticks tend to "move around" depending on other sticks being inserted. So it can show up as da0, da1, da2, etc. In order to make sure it always works, regardless of the actual device name, make sure to use labels instead of referring to disks.

http://www.wonkity.com/~wblock/docs/html/labels.html
 
My home NAS is set up to boot from a usb thumb drive. One thing I recommend is to disable daily/weekly periodic scripts that tend to use excessive I/O for usb thumb drives.
 
Hi SirDice,

examining hier(7), it appears that all(?) the log files are in /var/log. Is this correct? If so, how does on practically accomplish logging to a different location, i.e., a different drive on the same machine or a specific location on a different machine?

Kindest regards,

M
 
examining hier(7), it appears that all(?) the log files are in /var/log. Is this correct?
Most applications will, yes. Notable exception is perhaps MySQL/MariaDB as that typically logs to /var/db/mysql/$(hostname).err.
If so, how does on practically accomplish logging to a different location, i.e., a different drive on the same machine
You can mount a filesystem from a different drive on /var/log, that's the easiest way to do.

or a specific location on a different machine?
Typically only works for syslog(8) messages (not everything in /var/log/ is from syslog(8)):
Code:
     o   A hostname (preceded by an at ("@") sign).  Selected messages are
         forwarded to the syslogd(8) program on the named host.  If a port
         number is added after a colon (`:') then that port will be used as
         the destination port rather than the usual syslog port.  IPv6
         addresses can be used by surrounding the address portion with square
         brackets (`[' and `]').
See syslog.conf(5).
 
Hi SirDice,

thank you very much for the detailed answer. I actually have been running a server with the OS on a USB flash drive with all unnecessary writing - except logs - disabled for a few years without problems and storing data on hard drive(s). However, the logs writing has been still worrying me.

What would be the advantages/disadvantages to mounting filesystem from a different drive on /var/log vs. moving the /var/log onto a different drive?

Kinds regards,

M
 
What would be the advantages/disadvantages to mounting filesystem from a different drive on /var/log vs. moving the /var/log onto a different drive?
Both are the same? I mean, if you mount a filesystem from a different drive on /var/log/ you've effectively moved /var/log to another drive.

Advantages, spinning rust disks typically have a lot more capacity than thumb drives. They're probably also a bit faster compared to the relatively slow write speeds of thumb drives (depends on the thumb drive though).

Disadvantage, the only thing I could think of is more complexity. It takes a little bit more effort to set up.
 
Back
Top