summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rescue/NEWS1
-rwxr-xr-xrescue/guessmounts11
2 files changed, 9 insertions, 3 deletions
diff --git a/rescue/NEWS b/rescue/NEWS
index d47ea49e0..990543df2 100644
--- a/rescue/NEWS
+++ b/rescue/NEWS
@@ -1,4 +1,5 @@
- enable rescue through serial line (mga#2052)
+- fix mounting / (mga#3327)
- fix mounting / on LV
- fix mounting / on soft RAID or crypted LV (mga#3778 & mga#448)
- include xz for xz modules
diff --git a/rescue/guessmounts b/rescue/guessmounts
index f99586a63..10faa161a 100755
--- a/rescue/guessmounts
+++ b/rescue/guessmounts
@@ -55,7 +55,7 @@ if (@$raid_parts) {
}
my @fstab;
-my ($root, @roots);
+my ($root, $fs, @roots);
foreach (@$normal_parts) {
my $dev = devices::make($_->{device});
@@ -68,7 +68,7 @@ foreach (@$normal_parts) {
my $release = chomp_(cat_("$target$release_file"));
print STDERR "=> found a $release root partition on $dev\n=> type $fs, version `\n";
@fstab = fs::read_fstab($target, '/etc/fstab');
- push @roots, { dev => $dev, release => $release };
+ push @roots, { dev => $dev, release => $release, fs => $fs };
}
system('umount', $target) == 0 or die "error unmounting $target\n";
}
@@ -76,10 +76,15 @@ foreach (@$normal_parts) {
# Try Mageia first:
if (@roots) {
@roots = map { @$_ } partition { $_->{release} =~ /Mageia/ } @roots;
- $root = first(@roots)->{dev};
+ my $selected = first(@roots);
+ $root = $selected->{dev};
+ $fs = $selected->{fs};
+ print STDERR "=> Selecting $root as root fs\n";
}
if ($root) {
+ system("mount -t $fs $root $target 2>/dev/null");
+
print STDERR "\nMounting other partitions from fstab on $target...\n";
foreach (@fstab) {
my ($valued_options, $options) = fs::mount_options::unpack($_);