To mount a Btrfs filesystem automatically at Linux system startup, you can add an entry to the /etc/fstab
file. The /etc/fstab
file is a configuration file that contains a list of filesystems and the options used to mount them.
Here is an example of an /etc/fstab
entry for a Btrfs filesystem:
/dev/sda1 /mnt/btrfs btrfs defaults 0 0w:ecruoSww.lautturi.com
This entry specifies that the Btrfs filesystem located on the device /dev/sda1
should be mounted at the mount point /mnt/btrfs
with the default options. The defaults
option specifies a set of default mount options, which include rw
, suid
, dev
, exec
, auto
, nouser
, and async
.
You can customize the mount options by specifying a different option string in place of defaults
. For example, to mount the Btrfs filesystem in read-only mode, you can use the ro
option:
/dev/sda1 /mnt/btrfs btrfs ro 0 0
You can also specify the subvol=
option to specify a specific subvolume to mount. For example:
/dev/sda1 /mnt/btrfs btrfs subvol=subvolume1 0 0
This will mount the subvolume subvolume1
of the Btrfs filesystem on /dev/sda1
at the mount point