From c2fcfde5b3064845d96f7cb29ddc27689ea6e710 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 19 Mar 2020 14:33:39 +0100 Subject: just use the fs reported by blkid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of doing brute force guessing. Thus making logs easier to read… Also slightly faster and less error-prone (even if no true FS should havoc on another fs type). We could have fallbacked on ->{fs_type_from_magic} but that would only help iso9660 & the like which are not true FSes such as tested previously by fs::type::true_local_fs_types() --- rescue/NEWS | 3 +++ rescue/bin/guessmounts | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rescue/NEWS b/rescue/NEWS index f3f4f4c47..381194815 100644 --- a/rescue/NEWS +++ b/rescue/NEWS @@ -1,3 +1,6 @@ +- guessmount: + o just use the fs reported by blkid instead of doing brute force guessing + Version 1.63 - 19 March 2020 by Thierry Vignaud - add more tools for XFS & btrfs diff --git a/rescue/bin/guessmounts b/rescue/bin/guessmounts index 07cd62ba3..a4d1fa7f7 100755 --- a/rescue/bin/guessmounts +++ b/rescue/bin/guessmounts @@ -62,9 +62,9 @@ my $arch = arch() =~ /i.86/ ? $MDK::Common::System::compat_arch{arch()} : arch() foreach (@$normal_parts) { my $dev = devices::make($_->{device}); - my $fs = find { - system("mount -t $_ $dev $target 2>/dev/null") == 0; - } fs::type::true_local_fs_types() or next; + my $fs = $_->{fs_type}; + $fs or next; # no need to display an error if there's no fs... + system("mount -t $fs $dev $target 2>/dev/null"); if (my $release_file = common::release_file($target)) { my $release = chomp_(cat_("$target$release_file")); -- cgit v1.2.1