Bug 10179 - drakx* should add "nofail" option to "foreign" mountpoints to avoid unwanted recovery mode (was: Can't boot Mageia 3 after complete install)
Summary: drakx* should add "nofail" option to "foreign" mountpoints to avoid unwanted ...
Alias: None
Product: Mageia
Classification: Unclassified
Component: Installer (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker critical
Target Milestone: Mageia 5
Assignee: Pascal Terjan
QA Contact:
Keywords: PATCH
: 4042 8687 12566 14274 15694 (view as bug list)
Depends on:
Reported: 2013-05-20 15:24 CEST by Peter Landgren
Modified: 2015-06-02 20:28 CEST (History)
18 users (show)

See Also:
Source RPM:
Status comment:

Patch to add nofail option when diskdrake writes /etc/fstab (1.17 KB, text/plain)
2015-03-04 22:48 CET, Martin Whitaker

Description Peter Landgren 2013-05-20 15:24:06 CEST
I have a dual boot system. A COMPAQ Presario CQ61, with Intel Celeron and Windows 7 64 bit.
There are two partitions: C: normal win and D: which is a recovery partition.

Windows starts and behaves normal.

Installation of Mageia was finished without problems.

Whe I try to boot Mageia 3 I get:

Welcome to emergency mode.....

Logging in as root
Does a journalctl -b and find at the end of the log:

$MFTTMirr does not match $MFT (record 3)
Failed to mount '/dev/sda1': in/ut-fel (IO-error)
NTFS is either inconcistent .....
media-win_c.mount mount process exited, code=exited status=13
Failed to mount /media/win_c.
Dependency failed for Local File Systems.
Dependency failed for Relabel all file systems, if necessary.
Job fedora-autorelabel.service/start failed with result 'dependency'.
Dependency failed for Setup links in /boot for running kernel.
Job mandriva-boot-links.service/start failed with result 'dependency'.
Dependency failed for Mark the need to relabel after reboot.
Job fedora-autorelabel-mark.service/start failed with result 'dependency'.
Job local-fs.target/start failed with result 'dependency'.

The the boot process then stops.

I have run chkdsk on both C: and D: without any error.

Is it possible to skip mounting of the windows partitions?


Steps to Reproduce:
Comment 1 Sander Lepik 2013-05-20 15:46:30 CEST
Try to comment those partitions out in /etc/fstab - will that help? Not sure if rescue has any editors tho'. You might need to use LiveCD/DVD.

CC: (none) => sander.lepik

Comment 2 Peter Landgren 2013-05-20 17:05:05 CEST
But how do I change fstab. It seems to read only when I run the LiveDVD and load into an editor.
Comment 3 Sander Lepik 2013-05-20 17:17:14 CEST
Run LiveDVD, mount your root partition, search for /etc/fstab from that partition and edit it.
Comment 4 Barry Jackson 2013-05-20 17:43:11 CEST
(In reply to Peter Landgren from comment #2)
> But how do I change fstab. It seems to read only when I run the LiveDVD and
> load into an editor.

You need to use :

mkdir /mountpoint
mount -t ext4 /dev/sdxy /mountpoint

su -
kwrite (or gedit)

to run a root GUI editor.

CC: (none) => zen25000

Comment 5 Peter Landgren 2013-05-20 21:37:20 CEST
Thanks, that helped!
Comment 6 Manuel Hiebel 2013-05-20 23:23:06 CEST
what is the output of fdisk -l ?

CC: (none) => mageia, thierry.vignaud

Comment 7 Peter Landgren 2013-05-21 09:42:21 CEST
[root@compaq1 peter]# fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes, 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xb7a32d9f

    Enhet Start     Början        Slut     Block    Id  System
/dev/sda1   *        2048      409599      203776    7  HPFS/NTFS/exFAT
/dev/sda2          417690   296045819   147814065    7  HPFS/NTFS/exFAT
/dev/sda3       296045820   594870884   149412532+  83  Linux
/dev/sda4       594886656   625139711    15126528    7  HPFS/NTFS/exFAT
[root@compaq1 peter]#
Comment 8 Colin Guthrie 2013-05-21 10:06:01 CEST
We really should make drakx* add the "nofail" option to any "foreign" mountpoints to avoid this kind of problem.
Samuel Verschelde 2013-08-27 15:40:25 CEST

CC: (none) => stormi
Version: 3 => Cauldron
Summary: Can't boot Mageia 3 after complete install => drakx* should add "nofail" option to "foreign" mountpoints to avoid unwanted recovery mode (was: Can't boot Mageia 3 after complete install)
Severity: critical => normal

Comment 9 Samuel Verschelde 2013-08-28 15:00:31 CEST
*** Bug 8687 has been marked as a duplicate of this bug. ***

CC: (none) => mahecha

Comment 10 Manuel Hiebel 2013-12-05 21:41:45 CET
was something like this already done ?
Florian Hubold 2014-02-07 21:56:38 CET

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=4042

Comment 11 Florian Hubold 2014-05-17 18:37:08 CEST
*** Bug 12566 has been marked as a duplicate of this bug. ***

CC: (none) => superaphke

Florian Hubold 2014-05-17 18:43:25 CEST

Priority: Normal => release_blocker
CC: (none) => doktor5000
Hardware: x86_64 => All
See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=12631
Target Milestone: --- => Mageia 5
Severity: normal => critical

claire robinson 2014-05-17 20:17:43 CEST

CC: (none) => eeeemail, tmb

Comment 12 Manuel Hiebel 2014-10-20 20:38:05 CEST
*** Bug 14274 has been marked as a duplicate of this bug. ***

CC: (none) => laidlaws

Comment 13 Martin Whitaker 2014-11-12 18:25:56 CET
This caught me again when installing/testing M5b1. It is a common problem for people dual-booting Windows 8. I see this bug is marked as a release blocker - but it's not assigned to anyone, so does it stand any chance of getting fixed?

CC: (none) => mageia

Comment 14 Doug Laidlaw 2014-11-13 06:14:53 CET
Yikes! I just installed 5b1 and didn't think of it.  I usually comment out the line in /etc/fstab.  Then the USB drive behaves as a removable one, similar to other distros.
Comment 15 Rémi Verschelde 2015-02-03 22:15:21 CET
(In reply to Colin Guthrie from comment #8)
> We really should make drakx* add the "nofail" option to any "foreign"
> mountpoints to avoid this kind of problem.

@Thierry, Thomas, or anyone in CC and with some understanding of how that could be achieved: do you think Colin's idea would be the right way to go, and if so how could it be implemented? Possibly in a few non-disrupting lines of code that could make it in Mageia 5?

CC: (none) => remi

Comment 16 Doug Laidlaw 2015-02-04 04:22:54 CET
I don't have the knowledge to make any suggestions.

Ubuntu and derivatives always mount USB keys as removable.  Mageia makes them permanent.  Can we look at what other distros have done?

At the other extreme, the XFCE DE treats all unmounted partitions as "removable" and shows them on the desktop.  OpenMandriva's XFCE manages to corral them in a file manager window, but that is really a workaround.

I unplug everything at install time if I remember soon enough.  Then all removable media are mounted from /run/media/.  Both KDE and Xfce treat them as removable.

I have just purchased a Seagate 1 TB expansion drive.  If I boot up with it attached, it always becomes /dev/sda.  The forums are full of similar stories.  Apparently, it has to do with the drive's firmware.  But that is only incidental to this bug.
Comment 17 Marja Van Waes 2015-02-04 09:25:56 CET
Assigning to pterjan, because afaik he maintains the diskdrake part of drakx, and because I think diskdrake decides what should be added in /etc/fstab

please re-assign if I'm wrong!

CC: (none) => marja11
Assignee: bugsquad => pterjan

Comment 18 Anne Nicolas 2015-02-05 22:36:13 CET
Fix in progress after meeting

CC: (none) => ennael1

Comment 19 Stan Thomas 2015-02-19 22:47:27 CET
I'd like to add my vote to this for Mageia 5.
I've been succesful installing a dual-boot with Windows 8.1 by turning off Windows 'fast-boot' but this hasn't worked with Windows 10 preview and Mageia 5 beta.

Also, I do wonder whether it would be better not to mount the Windows partitions (i.e. any NTFS) in fstab by default. I know people can do this manually but why make such an obvious security breach easy?

CC: (none) => sat

Comment 20 Pascal Terjan 2015-02-19 22:55:04 CET
prepare_write_fstab in perl-install/fs.pm has things like this:

        my ($freq, $passno) =
          exists $_->{freq} ?
            ($_->{freq}, $_->{passno}) :
          isTrueLocalFS($_) && !$_->{dmcrypt_name} && $_->{options} !~ /encryption=/ && (!$_->{is_removable} || member($_->{mntpoint}, fs::type::directories_needed_to_boot())) ?
            (1, $_->{mntpoint} eq '/' ? 1 : fs::type::carry_root_loopback($_) ? 0 : 2) :
            (0, 0);

Sounds like a good place.
Comment 21 Doug Laidlaw 2015-02-20 01:15:59 CET
I really can't add any more. The external drive I mentioned in Comment 16 no longer makes itself /dev/sda, but it keeps unmounting itself and being no longer in the listing with "fdisk -l."  That may have nothing to do with this bug.

My Windows7 partition on a BIOS system works well, but my hardware is virtually obsolete.

The automatically generated menu.lst produces multiple copies of the Windows option, but that is nothing new.
Comment 22 Martin Whitaker 2015-03-04 22:48:33 CET
Created attachment 5990 [details]
Patch to add nofail option when diskdrake writes /etc/fstab

This patch to fs.pm fixes this bug for me. I've tested it with a Windows-8 system partition with fast boot enabled and with a removable USB flash memory drive.
Marja Van Waes 2015-03-04 22:55:15 CET

Keywords: (none) => PATCH

Comment 23 Thierry Vignaud 2015-03-05 06:12:31 CET
Looks OK. Though:
- "$options = $options . ',nofail';" is better written:
  "$options .= ',nofail';
- "'ntfs', 'ntfs-3g'" can be written:
  "qw(ntfs ntfs-3g)"
  (which shows better it's a list)
Comment 24 Mageia Robot 2015-03-05 08:48:11 CET
commit 745849cdace7ed86ce12a9a7564bffb42edf0ef3
Author: Anne Nicolas <ennael@...>
Date:   Thu Mar 5 08:47:05 2015 +0100

    add "nofail" option to "foreign" mountpoints to avoid unwanted
    recovery mode  (Martin Whitaker) mga#10179
 Commit Link:
Comment 25 Anne Nicolas 2015-03-05 08:49:20 CET
Fixed in next version of drakx* tools. Thanks Martin and Thierry

Resolution: (none) => FIXED

Comment 26 Rémi Verschelde 2015-03-05 10:59:22 CET
stage2 does not build, there must be a typo:

cd ../.. ; perl_checker -q --generate-pot share/po/libDrakX.pot *.pm c/*.pm diskdrake/*.pm harddrake/*.pm interactive/*.pm modules/*.pm partition_table/*.pm resize_fat/*.pm security/*.pm fs/*.pm fs/remote/*.pm
File "fs.pm", line 337, character 30-672
Makefile:29: recipe for target 'libDrakX.pot' failed

Resolution: FIXED => (none)

Comment 27 Rémi Verschelde 2015-03-05 11:00:36 CET
Indeed Anne copy-pasted the double quote from Thierry's example, I'll fix.
Comment 28 Mageia Robot 2015-03-05 11:04:09 CET
commit fe78f2a38c4a9cd3d7802b0b2ee323aaaaf82a6a
Author: Rémi Verschelde <remi@...>
Date:   Thu Mar 5 11:02:00 2015 +0100

    Fix typo (mga#10179)
 Commit Link:
Comment 29 Rémi Verschelde 2015-03-05 11:12:18 CET
Now fixed in drakxtools 16.66 and drakx-installer-stage2 16.66.

Resolution: (none) => FIXED

Comment 30 Thierry Vignaud 2015-04-14 15:55:53 CEST
*** Bug 15694 has been marked as a duplicate of this bug. ***

CC: (none) => brahmbeus

Comment 31 Florian Hubold 2015-06-02 20:28:30 CEST
*** Bug 4042 has been marked as a duplicate of this bug. ***

CC: (none) => hhielscher

Note You need to log in before you can comment on or make changes to this bug.