On 05/05/2017 13:32, Carlos Maiolino wrote:
This is not true, XFS can't identify mounts on different systems. It is not a shared or clustered filesystem.
Ok, this confirm my finding. To reiterate: there is *no* method to prevent multiple mounts in XFS, right?
At the worst case, it would need to store something to disk saying the filesystem is already mounted, and the mount process would need to read it before actually mounting the filesystem. Nothing though would prevent a race between two systems, or even make the filesystem unmountable after a crash, needing something like xfs_repair to clean some "is_mounted" flag, which would trash one of the reasons why we have a journal (fast recovery without needing an fsck before mounting).
EXT4 uses a "keepalive" approach: enabling the "mmp" feature (which require kernel 3.10+), a specific on-disk structure is continuously (each 5 seconds, by default) updated with a timestamp by the mounting machine. If another machine tries to mount the filesystem, it sees the mmp structure changing and it refuse to mount.
It's not perfect, but better than nothing ;) Regards. -- Danti Gionatan Supporto Tecnico Assyoma S.r.l. - www.assyoma.it email: g.danti@xxxxxxxxxx - info@xxxxxxxxxx GPG public key ID: FF5F32A8 -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html