summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-30 12:24:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-30 12:24:42 +0000
commita5b128d11b7ce8b5776492e1f560ab034e255ab7 (patch)
tree6c2fcee2ec50ccbeca1ee5230bcf25a7152768cf
parent3507110b9e2f60e615983a93003dc0cc4e140808 (diff)
downloaddrakx-backup-do-not-use-a5b128d11b7ce8b5776492e1f560ab034e255ab7.tar
drakx-backup-do-not-use-a5b128d11b7ce8b5776492e1f560ab034e255ab7.tar.gz
drakx-backup-do-not-use-a5b128d11b7ce8b5776492e1f560ab034e255ab7.tar.bz2
drakx-backup-do-not-use-a5b128d11b7ce8b5776492e1f560ab034e255ab7.tar.xz
drakx-backup-do-not-use-a5b128d11b7ce8b5776492e1f560ab034e255ab7.zip
- call fsck.jfs before mounting read-write (otherwise mount simply fails)
- propose fsck -y for ext2 when fsck -a fails
-rw-r--r--perl-install/fs.pm20
-rw-r--r--perl-install/install_steps_interactive.pm19
2 files changed, 27 insertions, 12 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 2cb5c280d..c684bf7be 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -700,10 +700,21 @@ sub mount {
#- without knowing it, / is forced to be mounted with notail
# if $where =~ m|/(boot)?$|;
$mount_opt = 'notail'; #- notail in any case
+ } elsif ($fs eq 'jfs' && !$rdonly) {
+ #- needed if the system is dirty otherwise mounting read-write simply fails
+ run_program::run("fsck.jfs", $dev) or die "fsck.jfs failed";
} elsif ($fs eq 'ext2') {
- run_program::run("fsck.ext2", "-a", $dev);
- $? & 0x0100 and log::l("fsck corrected partition $dev");
- $? & 0xfeff and die _("fsck failed with exit code %d or signal %d", $? >> 8, $? & 255);
+ foreach ('-a', '-y') {
+ run_program::run("fsck.ext2", $_, $dev);
+ my $err = $?;
+ if ($err & 0x0100) { log::l("fsck corrected partition $dev") }
+ if ($err & 0xfeff) {
+ my $txt = sprintf("fsck failed on %s with exit code %d or signal %d", $dev, $err >> 8, $err & 255);
+ $_ eq '-y' ? die($txt) : cdie($txt);
+ } else {
+ last;
+ }
+ }
}
if (member($fs, @fs_modules)) {
eval { modules::load($fs) };
@@ -803,10 +814,9 @@ sub umount_part {
sub mount_all($;$$) {
my ($fstab, $prefix) = @_;
- #- TODO fsck, create check_mount_all ?
log::l("mounting all filesystems");
- #- order mount by alphabetical ordre, that way / < /home < /home/httpd...
+ #- order mount by alphabetical order, that way / < /home < /home/httpd...
foreach (sort { $a->{mntpoint} cmp $b->{mntpoint} } grep { isSwap($_) || $_->{mntpoint} && isTrueFS($_) } @$fstab) {
mount_part($_, $prefix);
}
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 68e986898..ffbc9ad82 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -468,13 +468,18 @@ sub choosePartitionsToFormat {
sub formatMountPartitions {
my ($o, $fstab) = @_;
my $w;
- fs::formatMount_all($o->{all_hds}{raids}, $o->{fstab}, $o->{prefix}, sub {
- my ($part) = @_;
- $w ||= $o->wait_message('', _("Formatting partitions"));
- $w->set(isLoopback($part) ?
- _("Creating and formatting file %s", $part->{loopback_file}) :
- _("Formatting partition %s", $part->{device}));
- });
+ catch_cdie {
+ fs::formatMount_all($o->{all_hds}{raids}, $o->{fstab}, $o->{prefix}, sub {
+ my ($part) = @_;
+ $w ||= $o->wait_message('', _("Formatting partitions"));
+ $w->set(isLoopback($part) ?
+ _("Creating and formatting file %s", $part->{loopback_file}) :
+ _("Formatting partition %s", $part->{device}));
+ });
+ } sub {
+ $@ =~ /fsck failed on (\S+)/ or return;
+ $o->ask_yesorno('', _("Failed to check filesystem %s. Do you want to repair the errors? (beware, you can loose data)", $1), 1);
+ };
die _("Not enough swap space to fulfill installation, please add some") if availableMemory < 40 * 1024;
}