$ findmnt -rn --target /home/kzak/.bashrc -o UUID
uses libudev to ask for UUID, unfortunately /home/kzak is DM device
and libudev expects sysfs-like names (e.g. dm-0). We have to convert
the name to kernel devname.
Signed-off-by: Karel Zak <kzak@redhat.com>
This change allows to exclude for example NFS mountpoint:
findmnt --fstab --target /mnt/foo --type nonfs
to stall on a stalled nfs mount.
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab.c:990:34: warning: symbol 'fs' shadows an earlier one
libmount/src/tab.c:970:26: originally declared here
misc-utils/findmnt.c:492:30: warning: symbol 'tmp' shadows an earlier one
misc-utils/findmnt.c:473:14: originally declared here
fdisks/fdiskdoslabel.c:211:36: warning: symbol 'pe' shadows an earlier one
fdisks/fdiskdoslabel.c:180:20: originally declared here
fdisks/fdiskdoslabel.c:639:34: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:578:16: originally declared here
fdisks/fdiskdoslabel.c:947:21: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
fdisks/fdiskdoslabel.c:976:29: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
fdisks/fdiskdoslabel.c:984:29: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
[kzak@redhat.com: - don't use local 'tmp' in findmnt.c]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Currently findmnt uses libmount to get filesystem properties (and
libmount uses libblkid). This works as expected, but root permissions
are required to read the tags from the devices.
It seems better to read the information from udev db and use libblkid
as fallback solution only.
Signed-off-by: Karel Zak <kzak@redhat.com>
It seems that we can create the tree also if output is restricted by
fstype or options filter, for example
$ findmnt -t cgroups
Signed-off-by: Karel Zak <kzak@redhat.com>
The --target <non-mount-point> functionality should be enabled only if
previous regular search found nothing to avoid collisions with bind
mounts, because to detect mountpoint we use traditional child / parent
stat.st_dev comparison which does not work for bind mounts (--bind /A
/A).
Signed-off-by: Karel Zak <kzak@redhat.com>
This matches more closely with what 'df -h' reports as space available.
Any remaining discrepancy between these 2 tools is a result of precision
and choices in rounding.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
just in case we read from more mountinfo files.
For example get mountpoint from the current namespace which is invisible
for initd (PID=1):
# unsahre -m bash
# mount /dev/sdb /mnt/test
# echo $$
30070
# findmnt -n -o TARGET,TID,SOURCE --task 1 --task $$ | \
sort -u --key=1,1 | awk ' ($2 != 1) { print $0 }'
/mnt/test 30070 /dev/sdb
Signed-off-by: Karel Zak <kzak@redhat.com>
Provide this separately in an unambiguous format, mainly to avoid the
need for scripts to parse the source of a btrfs subvol or bind mount.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
If no tabfiles are specified, default to watching /proc/self/mountinfo
rather than exiting silently with EXIT_FAILURE.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
findmnt.c:333:29: error: ‘vfs_attr’ may be used uninitialized in this function [-Werror=uninitialized]
findmnt.c:307:11: note: ‘vfs_attr’ was declared here
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Use the newly exported mnt_get_mountpoint to determine the device that a
given file resides on, in case the supplied source or target is not
explicitly a mount point.
http://www.spinics.net/lists/util-linux-ng/msg06081.html
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Note that lib/tt.c will never truncate columns without TT_FL_TRUNC or
relative column width. So it's fine to set small width for columns
with SIZEs, the defined width is minimal width.
Signed-off-by: Karel Zak <kzak@redhat.com>
Provide display of filesystem attributes from statvfs(3). These are all
displayed in human readable format.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Using the -w flag with grep actually fought against us here, and hid
some instances where xalloc functions weren't used. Discard it in
favor of an explicit word boundary as a prefix to the function name,
and extend our requirements on the trailing side of the pattern.
This also fixes the few new instances that were overlooked because of
the regex's deficiency.
[kzak@redhat.com: - fix also newfound in findmnt
- remove unnecessary checks after xallocs]
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
The optional argument for -s, --fstab options (--fstab=file) is not
backwardly compatible, because command line with short options (e.g.
findmnt -snr) will be interpreted incorrectly.
This patch removes support for the optional --fstab argument and
introduces a new option --tab-file, for example:
findmnt --fstab --tab-file=/etc/fstab.foo
Reported-by: Juergen Daubert <jue@jue.li>
Signed-off-by: Karel Zak <kzak@redhat.com>