Run FreeBSD from an SD-card?

Hi,

with the advent of ZFS on Linux, running FreeBSD (and Linux) from an SD-card has come into focus here, once again.
The last time I tried it, I got "strange" errors sometimes, maybe due to the slowness of the card.
Are there any guidelines or tips for running a stock operating system on SD-cards?
The idea is to be able to utilize all available drive slots for actual data-drives (ZFS pool).
Currently, for our HP Gen9 servers, we need to buy a special "rear cage" which holds two drives and an extra RAID controller.
 
There are actual USB3 SSDs now. I'd lean more towards that. Actually, I have a 32G Lexar USB3 stick with an install of FreeBSD. Other than booting speed, it's not bad.
 
rainer_d, I use a ThinkPad X230 which boots from a SanDisk Ultra Fit on a USB 3.0 port. I have noticed that this particular USB stick runs warm to the touch, and it's occasionally slow while installing packages (including sporadic I/O hangs which last about five seconds), but it seems fine otherwise. ZFS scrubs have never reported any problems with it, and I've used it like this for about a year.

I've also been running a Supermicro 5018A-MHN4 with this same USB stick model plugged directly in to its motherboard for the past few months, and it's working fine so far, though I know it might fail at any moment. I wouldn't risk it like this if either system were depended on by a lot of people.
 
People tell me they run Ubuntu on SD-cards with no problem (at home, read/write mounted, of course).
But I just can't bring myself to completely trust it. I would trust read-only mounted SD-cards more, but I'm not sure how useful that really is in practice.

BTW: the NanoBSD documentation here: https://www.freebsd.org/doc/en/articles/nanobsd/howto.html seems to be bit out of date. Still mentions pkg_add.
 
I would trust read-only mounted SD-cards more, but I'm not sure how useful that really is in practice.
It might take a bit of fiddling but it should certainly be possible to run off a read-only system, the Live CD option of the CD/DVD installers use the same principle. You could point syslogd(8) to an external logging host and you'd probably need to use a RAM disk (tmpfs(5) and/or mdmfs(8)) for things like /var/ and /tmp.

You can keep it read-only during normal operations and only switch it to read/write for updates for example.
 
Hi,

with the advent of ZFS on Linux, running FreeBSD (and Linux) from an SD-card has come into focus here, once again.
The last time I tried it, I got "strange" errors sometimes, maybe due to the slowness of the card.
Are there any guidelines or tips for running a stock operating system on SD-cards?
The idea is to be able to utilize all available drive slots for actual data-drives (ZFS pool).
Currently, for our HP Gen9 servers, we need to buy a special "rear cage" which holds two drives and an extra RAID controller.
There is something even better. There are two (possibly three) turn key NAS appliances which could run of SD cards. I have being using FreeNAS 9.2.1.9 almost for two years now without any problems. I run it from 16 GB M.2 SSD drive. Note that 9.2.1.9 is the last version which uses UFS for OS. It is based of NanoBSD so it is read only system. FreeNAS 9.3 uses ZFS for OS. NAS4Free is also tailored for embedded devices (read to run of SSD, flash drive or similar). It has a smaller following but it is a nice product. Finally I am not familiar with ZFSgury so I am not sure if it is tailored for embedded devices.

There is nothing that prevents you from building minimalists embedded image using NanoBSD tools.
 
So to make it a read-only SD-card or USB, you'd set the partition with boot by using /etc/fstab with ro? I understand that will work, but will it be enough to stop the filesystem from being corrupted if it doesn't start up properly? This problem happened too many times with me for USB operating systems or install medium, where the contents had to be constantly reinstalled.
 
It appears to be in the driver or physically soldered on. Why not set the partition to
Code:
ro
in /etc/fstab? Ok, now I realize this isn't always early enough in the boot process to protect the filesystem.
 
I'm just being silly again. If one really wanted to, an SD could be turned into a ROM by flipping a write-once bit in the chip. One bit for temporary write-protect, another for permanent freeze.

The functionality does not seem to exist in FreeBSD: MMC_PROGRAM_CSD command is defined, but not used anywhere.

Juha
 
NanoBSD is probably the way to go. I will have to look into it more closely. For stuff like a NAS, FreeNAS is probably enough.
Perhaps it might be more practical to run NanoBSD + iocage (AFAIK, iocage stores all its configuration on ZFS datasets, so the read-only SD card would be untouched.
I would only need to get nullfs mounts inside the jails working (I run mostly php stuff, chrooted, with some directories read-only mounted from the base-system).
 
People tell me they run Ubuntu on SD-cards with no problem (at home, read/write mounted, of course).
People do silly things :) I run my home firewall flashrd embedded installation of OpenBSD of 16GB SSD. With exception of /flash partition everything is read only and fully loaded into the RAM.DF HAMMER is one of those rare file system which can take advantage of flash based hard drives. Unfortunately /boot on DF is always UFS. That is only 1MB
 
Back
Top