]> git.ipfire.org Git - thirdparty/util-linux.git/commit
findmnt: add SOURCES column to print all devices with the same tag
authorKarel Zak <kzak@redhat.com>
Thu, 9 Dec 2021 12:20:50 +0000 (13:20 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 9 Dec 2021 12:20:50 +0000 (13:20 +0100)
commitfd2ae1e1b03cb8e9a76aa55c47769991f7dd5d4d
tree00b5322d116d0e9738a04d42b1b57620cf7745c6
parentc4762c436b2ee637d7752597cec950598d7d4486
findmnt: add SOURCES column to print all devices with the same tag

It's the same like TARGETS for lsblk (the same device is possible to
mount on more mountpoints). Here in findmnt we support by a new column
SOURCES scenario when more devices (filesystems) use the same tag
(LABEL, UUID, e.g.).

For example:

$ findmnt --fstab -oTARGET,SOURCES --evaluate --json UUID=b45897ca-ffc4-4089-8404-5d6072f5aee1
{
   "filesystems": [
      {
         "target": "/mnt/test",
         "sources": [
             "/dev/sdb1", "/dev/sdc"
         ]
      }
   ]
}

Fixes: https://github.com/util-linux/util-linux/issues/1078
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/findmnt.8.adoc
misc-utils/findmnt.c