Skip to content

Commit

Permalink
mxraid_assemble: Indicate disks that are mounted
Browse files Browse the repository at this point in the history
Verbose listing mode now adds a hint when a disk (or parts on it)
are mounted.
  • Loading branch information
thomas committed Jan 21, 2019
1 parent c62f14e commit 1e5e2f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mxraid/mxraid_assemble
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down

0 comments on commit 1e5e2f6

Please sign in to comment.