-
Notifications
You must be signed in to change notification settings - Fork 48
Partitions
- SD Card Partition Layout
- Partition Sizes
- Read-only Mounts
- The Data Partition
- Overlay Filesystems
- fstab Files
- External Drives
thingOS uses three partitions on the SD card:
- a boot partition, FAT, about 20M, mounted read-only at
/boot
- a root partition, EXT4, about 180M, mounted read-only at
/
- a data partition, EXT4, fills up the entire remaining card space, mounted read-write at
/data
The size of the boot and root partitions are set in mkimage.sh. By default they are set to 30MB
and 200MB
, respectively. The offsets at which they live on the card are set in such a way that some spare space remains between them, for future partition enlargements. By default, boot start depends on the board, while root start is set to 100MB
. Data partition will start at 1024MB
, as dictated by S00datapart init script.
The boot and root partitions are normally mounted read-only to reduce the chances of filesystem corruptions. If you really want to edit stuff on these partitions, run the following commands to make them writable:
mount -o remount,rw /
mount -o remount,rw /boot
If the OS_DEBUG
variable is set to true
, these partitions are automatically mounted as read-write at boot, to allow debugging.
Keep in mind that boot and root partitions are both overwritten when performing a firmware update (except for some board-specific files which are preserved).
The data partition is created and formatted at first boot in such a way that it fills up all remaining space on the SD card.
The data partition contains all the editable configuration files, logs and all other files that need to be persisted. This is the only partition on the SD card that is normally writable. Wiping out the data partition is equivalent to a factory reset.
To circumvent the read-only state of root and boot partitions when user changes really need to me made to these partitions, the power of OverlayFS is leveraged. S01mountall
will mount all overlay filesystems defined in /etc/fstab.overlay
, if the running kernel supports OverlayFS.
By default, the following overlay filesystems are mounted:
-
/data/usr
over/usr
-
/data/varlib
over/var/lib
-
/data/log
over/var/log
Just add more entries to /etc/fstab.overlay
to cover other parts of the root or boot filesystems structure.
Different fstab files are used to mount the various available filesystems, as follows:
-
/etc/fstab.sys
is used bymountsys
to mount the pseudo-filesystems before executing any init script. -
/etc/fstab.disk
is used byS01mountall
to mount the filesystems on the SD card. -
/etc/fstab.extra
is used byS01mountall
to mount any additional filesystems required by the OS. -
/etc/fstab.overlay
is used byS01mountall
to mount overlay filesystems. -
/data/etc/fstab.user
, if present, is used byS01mountall
to mount any user-configured filesystems.
Common partitions found on any connected drives are automatically mounted at /data/media
. These partition types include ext2, ext3, ext4, fat32 and ntfs. The mount point is built based on the block device name (e.g. /data/media/sdb2
).
This job is done by udev and its storage rules file.
- bluetooth.conf
- captive-portal.conf
- cpufreq.conf
- date.conf
- dnsmasq.conf
- docker-compose.yml
- dtoverlays
- dyndns-update.sh
- environment
- firewall.sh
- fstab.user
- hostapd.conf
- ifalias.conf
- localtime
- modprobe.conf
- modules
- mongodb.conf
- netwatch.conf
- ntp.conf
- os.conf
- proftpd.conf
- redis.conf
- smb.conf
- ssh/config
- ssh/sshd_config
- ssl/domain
- ssl/email
- static_ip.conf
- sysctl.conf
- toemmc.conf
- version
- watchdog.conf
- wpa_supplicant.conf