I wanted to get some opinions on best practices to follow when running a FreeBSD system from flash-based storage devices, with respect to minimising frequent writing and avoiding wearing the devices out rapidly.
I've built a couple of NAS systems using ZFS for my main storage pool, but to keep things simple I've always opted to create the pool from whole disks, meaning the systems can't be booted from any of the disks in the pool. Instead I've configured the systems to boot from a flash device, an internally connected USB stick in one case, and a compact flash card in another.
The flash device has bootcode installed and has a single UFS filesystem containing only the /boot directory, so the kernel and ZFS modules are loaded from there, then the root filesystem can be mounted from the ZFS pool.
What I want to do is move the entire FreeBSD installation to the flash device to maintain a cleaner separation between the OS and my data. To do this, what steps should I take to reduce the frequency of writes to the device? A few things I've already considered are:
Another thing that springs to mind is kernel/world/port building. I assume this results in a lot of temporary files being written during the build process. Does this usually happen in the /tmp directory? If not, where else?
What other routine system activities that involve a lot of disk writing may I have missed?
Thanks for any suggestions.
I've built a couple of NAS systems using ZFS for my main storage pool, but to keep things simple I've always opted to create the pool from whole disks, meaning the systems can't be booted from any of the disks in the pool. Instead I've configured the systems to boot from a flash device, an internally connected USB stick in one case, and a compact flash card in another.
The flash device has bootcode installed and has a single UFS filesystem containing only the /boot directory, so the kernel and ZFS modules are loaded from there, then the root filesystem can be mounted from the ZFS pool.
What I want to do is move the entire FreeBSD installation to the flash device to maintain a cleaner separation between the OS and my data. To do this, what steps should I take to reduce the frequency of writes to the device? A few things I've already considered are:
- Don't put swap on the device
- Use tmpmfs or tmpfs(5) for /tmp
- Use varmfs for /var
Another thing that springs to mind is kernel/world/port building. I assume this results in a lot of temporary files being written during the build process. Does this usually happen in the /tmp directory? If not, where else?
What other routine system activities that involve a lot of disk writing may I have missed?
Thanks for any suggestions.