Re: Can I see what device was used to mount btrfs?

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

 



Chris Murphy posted on Wed, 03 May 2017 12:43:36 -0600 as excerpted:

> If I understand the bug report correctly, the user specifies mounting by
> label which then systemd is converting into /dev/dm-0 (because it's a
> two LUKS devices Btrfs volume).
> 
> Why not convert the fstab mount by label request, into a /dev/by-uuid/
> path; and then systemd calls mount with -u,--uuid mount option rather
> than the block device? I'd think this is better no matter what the file
> system is, but certainly with Btrfs and possibly ZFS. That makes the
> device discovery problem not systemd's problem to hassle with.

You're forgetting one thing:  mount doesn't handle either label or uuid 
(or similar partlabel/partuid/etc) mounting on its own -- it interprets 
all of these as the appropriate /dev/disk/by-* symlink references, 
dereferences those to the canonical device name, and actually mounts 
using that.

See the mount (8) manpage, relatively near the top under "Indicating the 
device", the relevant quote being "The mount (8) command internally uses 
udev symlinks, so the use of symlinks in /etc/fstab has no advantage over 
[LABEL=, UUID=, etc] tags."

And of course it's systemd's udev component that sets up those /dev/disk/
by-* symlinks in the first place.

So converting mount-by-label requests to mount-by-uuid requests gets you 
exactly nowhere, as underneath the covers they're both using the the same 
level udev-generated /dev/disk/by-* symlinks to get the canonical device 
name, so not only do you fail to get rid of the systemd/udev involvement, 
you fail to even reduce abstraction to a lower level.

Not to mention that newer systemd is apparently using its own mount-
alternative now, and doesn't actually call the traditional mount binary 
any more, at least for supported filesystem types.  I'm not qualified to 
argue the case for or against that, but it's apparently happening now, 
and regardless of where one stands on the merits, it's certainly 
inserting systemd even farther into the mount process for relatively 
complex and fuller-featured filesystems such as btrfs.

-- 
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