summaryrefslogtreecommitdiffstats
path: root/rescue/guessmounts
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-01-25 18:30:29 +0000
committerThierry Vignaud <tv@mageia.org>2012-01-25 18:30:29 +0000
commit30f3dffc00bdc1582c74b8882c14e1b5c1260e55 (patch)
tree99b1fb8e98f3f1d43ac5bd2cfee8d79dffe64682 /rescue/guessmounts
parente95388927be1f0de67413bdb5430cf0031710f54 (diff)
downloaddrakx-30f3dffc00bdc1582c74b8882c14e1b5c1260e55.tar
drakx-30f3dffc00bdc1582c74b8882c14e1b5c1260e55.tar.gz
drakx-30f3dffc00bdc1582c74b8882c14e1b5c1260e55.tar.bz2
drakx-30f3dffc00bdc1582c74b8882c14e1b5c1260e55.tar.xz
drakx-30f3dffc00bdc1582c74b8882c14e1b5c1260e55.zip
fix mounting / (mga#3327)
Diffstat (limited to 'rescue/guessmounts')
-rwxr-xr-xrescue/guessmounts11
1 files changed, 8 insertions, 3 deletions
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($_);