Btrfs: Difference between revisions
Guest09248 (talk | contribs) |
Guest09248 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
Documentation how to use | Documentation how to use Btrfs on Alpine Linux. | ||
== Install == | == Install == | ||
Installing [https:// | Installing [https://wikipedia.org/wiki/Btrfs BTRFS] is relatively straight forward. Install the package and tell Alpine to load the module on startup: | ||
{{Cmd|apk add btrfs-progs | {{Cmd|apk add btrfs-progs |
Revision as of 15:48, 31 December 2021
Documentation how to use Btrfs on Alpine Linux.
Install
Installing BTRFS is relatively straight forward. Install the package and tell Alpine to load the module on startup:
apk add btrfs-progs echo btrfs >> /etc/modules
To load the module right away, you can use the following command:
modprobe btrfs
Mounting a volume
To mount a volume on boot, add a new entry to your fstab:
UUID=abcdef-0055-4958-990f-1413ed1186ec /var/data btrfs defaults,nofail,subvol=@ 0 0
More information about mounting can be found in the official BTRFS wiki
Troubleshooting
Mount failed
If you try mounting a btrfs volume via your /etc/fstab and it doesn't show up, it could be because BTRFS does not know about the drives during boot.
To work around this, you can create an OpenRC service that runs a btrfs scan to detect the drives. To do so, create a new service under /etc/init.d/btrfs-scan with the following content:
#!/sbin/openrc-run name="btrfs-scan" depend() { before localmount } start() { /sbin/btrfs device scan }
Make the service executable and register it:
chmod +x /etc/init.d/btrfs-scan rc-update add btrfs-scan boot
The volume should mount correctly after a reboot.