From 1e5e2f68bd65d3563f864065298d6e3693496043 Mon Sep 17 00:00:00 2001 From: thomas Date: Mon, 21 Jan 2019 12:50:53 +0100 Subject: [PATCH] mxraid_assemble: Indicate disks that are mounted Verbose listing mode now adds a hint when a disk (or parts on it) are mounted. --- mxraid/mxraid_assemble | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mxraid/mxraid_assemble b/mxraid/mxraid_assemble index de9f5d0..0005f0c 100755 --- a/mxraid/mxraid_assemble +++ b/mxraid/mxraid_assemble @@ -140,9 +140,11 @@ if ($opts{l}) { print "\n"; } if ($VERBOSE >= 2) { + my @mounts = split m/\n/, `cat /proc/self/mounts`; print "Disks not part of a configured SW-RAID:\n"; for my $rec (@{$hd->non_raid_disks()}) { - printf " %-9s %-16s '%s'\n", @$rec; + my $mnt = scalar(grep {m|^/dev/$rec->[0]\d*\b|} @mounts) ? ' (mounted)':''; + printf " %-9s %-16s '%s'%s\n", @$rec, $mnt; } print "\n"; }