Re: mlocate/updatedb and btrfs subvolume mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zygo Blaxell posted on Sun, 12 Apr 2015 16:11:07 -0400 as excerpted:

> Since these are simple binds (not rbinds), they don't see any other
> filesystems, period.  They do see btrfs subvolumes, though.

Tho... for systemd users...

Do note that systemd plays with the kernel's shared-subtree "private" 
default, switching it to shared for /.  The idea is that this makes 
containers "just work", since mounts on / get propagated into containers 
as well.  Unfortunately, the kernel default is private because that's the 
way the kernel behaved before the shared-subtree feature was introduced, 
and systemd changed that, breaking a lot of assumptions and scripts, 
including my backup script, along the way.

I don't use subvolumes, but do use a mount --bind of / elsewhere, so I 
can backup /, ALL of / (including subtrees hidden on the primary mount by 
overmounts), without any danger of crossing mount-points, since the bind-
mount was always private.  I've been doing this since well before I 
switched to either btrfs or systemd, and probably since before the kernel 
and mount introduced the shared-subtree feature, and it has worked very 
well.

But then systemd came around and decided that the "private" default-mount 
wasn't good enough for systemd, and that it was now going to default to 
shared.  Of course that broke existing solutions all over the place, but 
as we know, care to keep from breaking existing solutions isn't a 
priority, to say the least, with systemd, so...

So I had to add "private" to my / mount options, so mounting the backup 
partition on /mnt/bk wouldn't cause it to mount on the already bind-
mounted /mnt/rootbind that I was trying to backup, as well.

Link to a systemd-devel thread describing the change (with a link to the 
commit) and the systemd-ish way to undo it using a unit file (as opposed 
to the option I added to the fstab / entry instead).

http://lists.freedesktop.org/archives/systemd-devel/2013-
February/008558.html

Also see the mount(8) manpage under shared subtree operations, and the 
kernel documentation file in Documentation/filesystems/sharedsubtree.txt.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux