Persistent storage - RedCoolBeans/CargOS GitHub Wiki

Persistent storage

CargOS is mainly intended as an in-memory operating system, so a persistent storage is necessary to allow configuration and modifications on the running system. The main CargOS filesystem image is loaded into memory when booting and is ready-only. Only a subset of directories are allowed to be modified and these directories are located on the persistent storage which will be configured by the CargOS Setup Utility on first boot.

If CargOS is booted on a machine where no persistent storage was configured before, the CargOS Setup Utility will be started where you can configure the system by answering some basic questions.

The setup utility will create a btrfs volume using the selected disks and create several subvolumes by default:

  • root - mounted as /root to allow persistent changes to the root user's home directory
  • pkg - mounted as /usr/pkg for 3rd party packages
  • etc - this subvolume gets union mounted with /.etc to allow local modifications to the /etc directory
  • home - mounted as /home to provide a /home partition for users
  • data - this subvolume is not mounted by default and can be used by the users to create extra volumes
  • data/docker - mounted as /var/lib/docker for docker.io

Details about /etc

/etc is mounted as a union file system to allow local modifications to the /etc directory by the user. The original files can be accessed at the /.etc directory. Due to the fact that mounting the /etc persistent storage happens during the boot process there are files that cannot be changed or even after chaning, will not take any effect. These files are not supposed to be modified by anyone (e.g. /etc/rc, /etc/inittab) but in rare cases modifications might be needed. In this case please contact us for assistance.