From 30f3dffc00bdc1582c74b8882c14e1b5c1260e55 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 25 Jan 2012 18:30:29 +0000 Subject: fix mounting / (mga#3327) --- rescue/guessmounts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'rescue/guessmounts') 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($_); -- cgit v1.2.1