eMMC support & concerns

Matthew Dillon dillon at backplane.com
Sat Feb 18 10:15:13 PST 2023


Just as a side note, it is totally possible to mount root read-only and
then use tmpfs/copied mounts for the directories that the system needs to
write to.   Example included below (this is what our release image uses).
 Basically you specify a read-only root mount in /etc/fstab and then a
bunch of rw tmpfs mounts using the -C option, which causes tmpfs to copy
the underlying read-only filesystem onto the rw tmpfs filesystem.

# Device                Mountpoint      FStype  Options         Dump
 Pass#
/dev/blahblah          /                ufs  ro           0       0
dummy                   /root           tmpfs   rw,-C           0       0
dummy                   /var            tmpfs   rw,-C           0       0
dummy                   /tmp            tmpfs   rw,-C           0       0
dummy                   /etc            tmpfs   rw,-C           0       0
dummy                   /usr/obj        tmpfs   rw              0       0
proc                    /proc           procfs  rw              0       0

If you need to make adjustments to the root filesystem you can manually
change it to a rw mount via 'mount -u -o rw /', and then you can use a null
mount to access the portions hidden by the tmpfs mounts without having to
unmount the tmpfs mounts.  e.g. 'mount_null / /mnt'  like that.

A couple of other things you might want to do for a small read-only system
is turn off syslogd, e.g. in /etc/rc.conf:

syslogd_enable="NO"

Some additional work might be necessary but those are the basics of working
with a read-only root filesystem.

-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20230218/b22caf4f/attachment.htm>


More information about the Users mailing list