Added howto to mount files as virtual file systems

This commit is contained in:
Michele Cereda
2022-09-27 23:32:35 +02:00
parent 7e8edd71d4
commit da4a29c615
2 changed files with 22 additions and 2 deletions

View File

@@ -14,7 +14,8 @@ mkfs.ext4 'path/to/file'
mkdir 'mount/point'
# Mount the file system.
sudo mount -t 'ext4' 'path/to/file' 'mount/point'
# The 'loop' option is optional.
sudo mount -t 'ext4' -o 'loop' 'path/to/file' 'mount/point'
```
Prefer `truncate` to `dd` to let the file expand dynamically and be resized (both larger or smaller) without damaging data with `losetup` and `resize2fs`.

View File

@@ -1,6 +1,25 @@
# Raspberry Pi OS
## Let it run containers
1. [Store files on the SD even when the overlay file system is active](#store-files-on-the-sd-even-when-the-overlay-file-system-is-active)
2. [Make it able to run containers](#make-it-able-to-run-containers)
1. [Kernel containerization features](#kernel-containerization-features)
2. [Firewall settings](#firewall-settings)
3. [Sources](#sources)
## Store files on the SD even when the overlay file system is active
The files just need to be stored on a different file system from `/`. You can partition the SD and use that, or create a file and mount it as a virtual file system:
```sh
truncate -s '6G' 'file'
mkfs.ext4 'file'
mkdir 'mount/point'
sudo mount -t 'ext4' -o 'loop' 'file' 'mount/point'
sudo chown 'user':'group' 'mount/point'
touch 'mount/point/new-file'
```
## Make it able to run containers
### Kernel containerization features