• Kirill Smelkov's avatar
    X neotest/info-local: Fix disk display in presence of bind-mounts · d35a2fdf
    Kirill Smelkov authored
    When source device is mounted multiple times, findmnt reports it e.g.
    this way:
    
    	|-/mnt/SLAPOS                         /dev/md2     ext4       rw,relatime,stripe=256,data=ordered
    	|-/srv/slapgrid                       /dev/md2[/srv/slapgrid]
    	                                                   ext4       rw,relatime,stripe=256,data=ordered
    	|-/opt/slapgrid                       /dev/md2[/opt/slapgrid]
    	                                                   ext4       rw,relatime,stripe=256,data=ordered
    	`-/opt/slapos                         /dev/md2[/opt/slapos]
    	                                                   ext4       rw,relatime,stripe=256,data=ordered
    
    and then it breaks:
    
    	$ ./neotest info-local
    	date:   Mon, 26 Mar 2018 21:52:08 +0200
    	xnode:  slapuser5@sd-102959.dedibox.fr (2001:67c:1254:e:49::1 (+ 17·ipv6) 10.0.31.249 (+ 17·ipv4))
    	uname:  Linux vifibcloud-onlinenet-hosting-002 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux
    	cpu:    Intel(R) Xeon(R) CPU D-1531 @ 2.20GHz
    	cpu/[0-11]/freq: intel_pstate/powersave [0.80GHz - 2.70GHz]
    	cpu/[0-11]/idle: acpi_idle/menu: POLL·0/0 C1·1/2 C2·41/82 # elat/tres µs
    	WARNING: cpu: frequency not fixed - benchmark timings won't be stable
    	WARNING: cpu: C-state exit-latency is max 41μs - benchmark timings won't be stable
    	WARNING: cpu: (up to that might be adding to networked and IPC request-reply latency)
    	realpath: '/dev/md2[/srv/slapgrid]': No such file or directory
    
    Fix it by telling findmnt to not include '[/dir]' (-v option).
    
    While we are here also add -u which means "Do not truncate text in columns"
    which is also good to have on a safe side.
    d35a2fdf
neotest 40.2 KB