Open camoz opened 2 years ago
I kind of agree with what you say. For the examples in the documentation I would say it's ok, at least I would not know what other directory I should propose as "standard" for btrbk (probably something like /var/btrbk/mnt
would be FHS conform? Sounds wrong to me as well...).
I'm not sure if I should confuse the users with FHS recommendations. Every linux user should know that the examples in the documentation are interchangeable, and /mnt
is merely a suggestion.
I will happily add a note about the FHS conform, "correct" path for the mount points, but I would need some good arguments on where it should be.
Actually I disagree. Every Linux distro I used doesn't actually mount temporary filesystems to /mnt
. Instead, media
or /run/username/media
is used for temporary mounts such as external drives.
/mnt
literally stands for "mount" making it the most logical top level folder for your drives. I actually have:
/mnt/drives
containing a folder (mountpoint) for each drive. For example my btrfs root subvolume of the OS drive is mounted with noauto
to /mnt/drives/system.
But my backup drive is also there (also with noauto
). These are actually only mounted for backup actions or maintenance.
I also have /mnt/pool
containing the filesystem of my data storage (user data and media downloads), which could have multiple underlying drives/subvolumes. That's a permanent one.
There simply isn't another top level folder that makes sense and creating one yourself while /mnt
is there to use doesn't make much sense..
I actually have a very similar setup, except that I don't have permanent mounts under /mnt
. But I guess there is no immediate harm done by doing that, even if it's not conforming to the FHS. In any case, /mnt
ist intended for manual mounts by the system administrator only, but as btrbk is not doing any mount operations there, this is also fine.
I just noticed it and wanted to bring it up, as I think following common standards is a good idea. But I admit it's more of a minor nitpick...
What do you think about adding noauto
to the fstab example? The words mnt
and fstab
are not contained in any of the man pages, the only place that mentions fstab is here in the README. Currently it reads like this:
The examples below assume that the btrfs subvolume containing home and rootfs is mounted at /mnt/btr_pool. This is usually the btrfs root subvolume, which always has subvolid=5.
Mounting subvolid=5 is recommended (mandatory for btrbk < v0.32.0) if you want to backup your root filesystem /.
/etc/fstab:
/dev/sda1 /mnt/btr_pool btrfs subvolid=5,noatime 0 0
At the beginning it is already stated that "the examples below assume that the btrfs subvolume containing home and rootfs is mounted at /mnt/btr_pool", so the fstab line is kind of optional and maybe unnecessary. Some thoughts about it:
/etc/fstab
" to make clear it's only an example and not needed exactly like this./dev/sda1
. I would change that to something generic so that users are not tempted to just copy&paste. Maybe even use UUID=...
.noatime
seems kind of random, I think relatime
is the default nowadays. Maybe something like defaults,subvolid=5,noauto,<additional options>
would be better, to make it clear the user can/should adjust it further?Alternatively, as I said, the fstab example could just be removed.
What do you think?
@camoz But noauto
is what you should already use when adding those mounts (the ones you only need to run btrbk) to fstab
. Because they (root filesystems) do not have any need to be mounted for any other purpose, and this way you can always easily mount via sudo mount /mnt/drives/data1
instead of the whole mount command.
This will also allow you to use btrbk-mail.sh
since that requires you to add all necessary mountpoints to fstab
.
@zilexa Maybe we are talking past each other? As I wrote, I am already using noauto
. This issue is about adding it to the btrbk documentation.
But these are basic tasks/best practices. it seems weird to ask this to be added to btrbk documentation. If we would want that level of detail, the documention needs a whole lot more.. Instead, it makes more sense to not expect such detailed level.. since this info is easy to find, either Arch wiki (even if you are on Ubuntu, the Ubuntu wiki often forwards you to Arch wiki) or fstab man.
The problem I see with using /mnt/btr_pool is that the user might have multiple disks with separate btrfs filesystems. The question then becomes which disk is the /mnt/btr_pool for? I'm not sure what the answer is, just throwing it out there so folks can keep that issue in mind while deciding the best solution.
@wolfgangrupprecht That should be clear after reading the README:
The examples below assume that the btrfs subvolume containing home and rootfs is mounted at > /mnt/btr_pool. This is usually the btrfs root subvolume, which always has subvolid=5.
@zilexa Why not just adapt the fstab example to follow the best practices? Why show bad practices instead? It only changes one line...
As far as I can see, according to the Filesystem Hierarchy Standard,
/mtn
is intended for temporary mounts only. See e.g. then man pagehier(7)
:Or https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s12.html :
The btrbk documentation currently rather encourages to permanently mount subvolumes there, e.g. in the README:
Now changing all the documentation would be tedious, and for demonstration and explaining how it works it's maybe good to use
/mnt
in the examples, but maybe the fstab example should be removed, or changed tonoauto
. Or a note somewhere about the FHS not recommending mounting filesystems permanently at/mnt
would be useful.