Boot into failsafe mode

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

Re: Boot into failsafe mode

Postby gohlip » Dec 6th, '14, 21:57

It is very very late here but hey it's Saturday night. So I am going to log off soon. But really, we can't do much in dracut shell. In systemd doc, it is mentioned we can add "fstab=no" in grub line to ignore fstab entries. I think I tried this when i was having problems and it didn't work in mageia. (Works for other os ) you can try if you like.

Good night.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Boot into failsafe mode

Postby doktor5000 » Dec 6th, '14, 22:45

ohmysql wrote:I changed the swap id in both Mageia's fstab and /etc/dracut.conf/51-etc. Actually, in the latter I just removed the line... are you suggesting I put in the new UUID? In any case, I doubt that will help. The faulty UUID is clearly embedded somewhere in initrd because after changing fstab and 51-etc., it's still calling the faulty UUID and crashing.


It doesn't matter if you remove the line or put a new UUID into there - if you don't run dracut to regenerate a new initrd, the changes in that file are not taken into account.
And as you seem to have issues completing the boot, this is somewhat of a chicken-egg problem.
FWIW, in the emergency shell, can you simply press SysRQ+E, does it continue then? Or did you try to press Ctrl+D to continue?

I'll have a look if I find another of the other bugreports for this, where a workaround is included.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18037
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Boot into failsafe mode

Postby jiml8 » Dec 6th, '14, 23:33

Well, I told you how to rebuild your initrd. But go ahead and knock yourself out fiddling with grub, and systemd, and whatever else. Even reinstall if you feel like it.

But if you want to solve your problem, do what I told you.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: Boot into failsafe mode

Postby ohmysql » Dec 7th, '14, 02:16

^^Easy for you to say ;) If I run dracut through Mint and try to rebuild dracut for Mageia do you think that'll work? I don't have a cd writer nor does my system pick up my USB drive for some reason... I've had a terrible time installing Mageia--I installed an ISO on my hard drive and had to figure out how to boot grub to the ISO, which wasn't easy and is now broken :)

But I'll try the .iso route again if this doesn't work.

Anyway, I agree with doktor's comment about the chicken & egg problem here! I'll try the resume options you mentioned!
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby doktor5000 » Dec 7th, '14, 02:20

What Jim mentioned, and what's pretty easy to do is to chroot into Mageia environment (from Mint or from any other linux, live media or whatever) and then run dracut inside the chroot. As an example, have a look here: viewtopic.php?p=53058#p53058

Further explained in viewtopic.php?f=7&t=8111 and viewtopic.php?f=7&t=6561
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18037
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Boot into failsafe mode

Postby ohmysql » Dec 7th, '14, 02:24

^^ Oh ok, that's prob the missing link in my brain then. I did most of the steps he mentioned but then I got confused at the dracut part, since it's not native to Mint. Sorry Jim!

PS Ctrl-D & SysRQ didn't work! CTRL-D just tried to load the kernel again and dropped back down to the shell.

I'll install dracut now and let you know how it goes!
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby doktor5000 » Dec 7th, '14, 02:30

ohmysql wrote:I'll install dracut now and let you know how it goes!

No need to install dracut. Please, do yourself a favour and first read a little bit about chroot.
The abovementioned threads provide sufficient information and also further links for explanation and context information. Then continue.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18037
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Boot into failsafe mode

Postby gohlip » Dec 7th, '14, 03:22

gohlip wrote:If it don't work, I don't think I can help further, but try jiml8 chroot too. please let us know.

Morning. Yep. Consensus is to try chroot. But, if your Mageia is really messed up to its neck in er....well, excrement, you really should consider reinstalling.
Yes, understand your earlier install issues but it is often not only the cleanest but the easiest way.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Boot into failsafe mode

Postby ohmysql » Dec 7th, '14, 03:42

Oh shizer, weird, for some reason, my posts aren't coming through?

Just saying, watch your assumptions! I did read about chroot, but that doesn't mean as a newbie I figured out you were creating a Mageia environment nor did I understand this could be done in Mint. Nothing wrong with that and do what you want, and I don't intend any criticism--I did want to warn that I've seen posts be dangerous for the health of online communities and I've found it wise to ask questions rather than make assumptions when I can.

Anyway, this dracut -f thing didn't seem to work. I'll post the results, let me know if there's a crucial error?

Agreed, I'll just reinstall if this keeps up.

Code: Select all
# Entry for /dev/sda7 :
UUID=894e96b8-etc. / ext4 relatime,acl 1 1
# Entry for /dev/sda3 :
UUID=89fe673b-etc. /media/Data ext4 acl,relatime 1 2

none /proc proc defaults 0 0
# Entry for /dev/sda5 :
#UUID=7137669c-etc. swap swap nofail 0 0
/dev/sda5 swap swap nofail 0 0


This file is blank:

/etc/dracut.conf.d/51-mageia-resume.conf

Code: Select all
dracut -f
WARNING: Activating non-hostonly initrd due to distro upgrade.
         Your initrd will be larger than needed for compatibility.

         You can disable this by setting DRACUT_SKIP_FORCED_NON_HOSTONLY=1
Executing: /usr/bin/dracut -f
dracut module 'network' will not be installed, because it's in the list to be omitted!
dracut module 'network' will not be installed, because it's in the list to be omitted!
dracut module 'cifs' depends on 'network', which can't be installed
dracut module 'systemd' will not be installed, because it's in the list to be omitted!
*** Including module: bash ***
*** Including module: dash ***
*** Including module: modsign ***
*** Including module: i18n ***
*** Including module: ifcfg ***
*** Including module: drm ***
*** Including module: plymouth ***
*** Including module: crypt ***
*** Including module: dm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 60-persistent-storage-dm.rules
Skipping udev rule: 55-dm.rules
*** Including module: kernel-modules ***
*** Including module: resume ***
*** Including module: rootfs-block ***
*** Including module: terminfo ***
*** Including module: udev-rules ***
Skipping udev rule: 91-permissions.rules
*** Including module: usrmount ***
*** Including module: base ***
*** Including module: fs-lib ***
*** Including module: shutdown ***
*** Including modules done ***
Failed to install module ahci
*** Installing kernel module dependencies and firmware ***
*** Installing kernel module dependencies and firmware done ***
*** Resolving executable dependencies ***
*** Resolving executable dependencies done***
*** Stripping files ***
*** Stripping files done ***
*** Creating image file ***
*** Creating image file done ***


THANKS!

OMS!
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby doktor5000 » Dec 7th, '14, 11:59

ohmysql wrote:Anyway, this dracut -f thing didn't seem to work. I'll post the results, let me know if there's a crucial error?


Code: Select all
dracut -f
WARNING: Activating non-hostonly initrd due to distro upgrade.
         Your initrd will be larger than needed for compatibility.

         You can disable this by setting DRACUT_SKIP_FORCED_NON_HOSTONLY=1
Executing: /usr/bin/dracut -f
dracut module 'network' will not be installed, because it's in the list to be omitted!
dracut module 'network' will not be installed, because it's in the list to be omitted!
dracut module 'cifs' depends on 'network', which can't be installed
dracut module 'systemd' will not be installed, because it's in the list to be omitted!
*** Including module: bash ***
*** Including module: dash ***
*** Including module: modsign ***
*** Including module: i18n ***
*** Including module: ifcfg ***
*** Including module: drm ***
*** Including module: plymouth ***
*** Including module: crypt ***
*** Including module: dm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 60-persistent-storage-dm.rules
Skipping udev rule: 55-dm.rules
*** Including module: kernel-modules ***
*** Including module: resume ***
*** Including module: rootfs-block ***
*** Including module: terminfo ***
*** Including module: udev-rules ***
Skipping udev rule: 91-permissions.rules
*** Including module: usrmount ***
*** Including module: base ***
*** Including module: fs-lib ***
*** Including module: shutdown ***
*** Including modules done ***
Failed to install module ahci
*** Installing kernel module dependencies and firmware ***
*** Installing kernel module dependencies and firmware done ***
*** Resolving executable dependencies ***
*** Resolving executable dependencies done***
*** Stripping files ***
*** Stripping files done ***
*** Creating image file ***
*** Creating image file done ***




Looks good to me - did you try booting again, how does it fail?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18037
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Boot into failsafe mode

Postby ohmysql » Dec 7th, '14, 21:57

Same exact thing--it calls the wrong UUID (old swap starting with 7) and crashes into dracut debug shell.
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby doktor5000 » Dec 7th, '14, 22:14

Can you please show your grub configuration ( /boot/grub/menu.lst ) from Mageia and also the output of
Code: Select all
lsinitrd /boot/initrd.img | grep -i by-uuid

You should adapt the path if you do this from Linux Mint, you would first have to mount the Mageia partition for that. Or do it when in Mint from inside a chroot, whatever is easier for you. Also make sure you run that command on the initrd image that is configured in your grub configuration for the default Mageia entry.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18037
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Boot into failsafe mode

Postby ohmysql » Dec 8th, '14, 01:34

Thanks, hmm!

Pretty sure this is the grub entry that calls Mageia now:

Code: Select all
menuentry 'Mageia 4 latest tip' {
   insmod part_msdos
   insmod ext2
        search --no-floppy --fs-uuid --set=root   894e96b8-etc.
   linux   /boot/vmlinuz-desktop root=UUID=894e96b8-etc. ro   nokmsboot systemd.unit=multi-user
   initrd  /boot/initrd-desktop.img
   #systemd.unit=multi-user is to prevent a fail
}

Here is the result from the command you suggested:

Code: Select all
lsinitrd /boot/initrd-desktop.img | grep -i by-uuid

-rw-r--r--   1 root     root          146 Sep 13 15:23 usr/lib/dracut/hooks/emergency/80-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f7137669c-etc.sh
-rw-r--r--   1 root     root           64 Sep 13 15:23 usr/lib/dracut/hooks/initqueue/finished/devexists-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f7137669c-.etc.sh


lsinitrd is a very useful command, thanks!

And as you can see, initrd is calling the problematic old swap UUID twice!

Just to be sure, I ran dracut -f again and got the same result with lsinitrd. So weird! Any ideas where it's getting the idea to build initrd with that old swap file UUID? I have a feeling we're really close. And getting this would probably make it a lot easier for the next person whose system changes their swap UUID to keep using mageia, so it would be lovely if we get this.

Thanks again,
OMS!
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby gohlip » Dec 8th, '14, 05:34

Any ideas where it's getting the idea to build initrd with that old swap file UUID? I have a feeling we're really close.

One suggestion, can you do it for the real initramfs, not the symlink?
Code: Select all
lsinitrd /boot/vmlinuz-3.xx.x-desktop-x.xxmgax |grep -i by-uuid

If the uuid is the correct one, then just peform a "ln -sf" on it
Code: Select all
# ln -sf /boot/initrd-3.xx.x-desktop-x.xxmgax.img /boot/initrd-desktop.img

For completeness, do also on vmlinuz
Code: Select all
# ln -sf /boot/vmlinuz-3.xx.x-desktop-x.xxmgax /boot/vmlinuz-desktop


Ah good, glad you stick with it, ohmysql. :)

[edit] - Note much much earlier in my posts, I tried booting with actual vmlinuz and initrd, not sym-links. Still failed.
Much later on, I asked where dracut keeps its hooks. There is a 'pre-mount' hook somewhere which could cause this failure, I think.
(Of course I am not sure, as I am not that sure that systemd is the cause of this - ah ... the joys and perils of certitude)
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Boot into failsafe mode

Postby ohmysql » Dec 9th, '14, 00:25

Ya, good question, but looks like no luck?

Code: Select all
lsinitrd /boot/initrd-3.12.25-desktop-3.mga4.img | grep -i by-uuid
-rw-r--r--   1 root     root          146 Sep 13 15:23 usr/lib/dracut/hooks/emergency/80-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f7137669c-6e62-4f68-ade2-a010207ac3c7.sh
-rw-r--r--   1 root     root           64 Sep 13 15:23 usr/lib/dracut/hooks/initqueue/finished/devexists-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f7137669c-6e62-4f68-ade2-a010207ac3c7.sh


I didn't bother doing the syslinks you suggested because it looks like the UUIDs are still wrong. But let me know if I misunderstood.

Yeah, I'd be willing to look into the Hooks if that's helpful!

I hope this is an interesting and relevant problem!

OMS!
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby gohlip » Dec 9th, '14, 04:00

ohmysql wrote:Ya, good question, but looks like no luck?
I didn't bother doing the syslinks you suggested because it looks like the UUIDs are still wrong. But let me know if I misunderstood.
No. you're right. No point to do symlinks if uuid still wrong.
ohmysql wrote:Yeah, I'd be willing to look into the Hooks if that's helpful!

Yes. If you can find where the hooks are, it will be great. I tried to find where there are, but I couldn't find them.
ohmysql wrote:I hope this is an interesting and relevant problem!
OMS!
I think so too.
Cheers.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Boot into failsafe mode

Postby ohmysql » Dec 9th, '14, 05:42

If you couldn't find them, I'm not sure how I could... !
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby doktor5000 » Dec 9th, '14, 07:58

gohlip wrote:
ohmysql wrote:Yeah, I'd be willing to look into the Hooks if that's helpful!

Yes. If you can find where the hooks are, it will be great. I tried to find where there are, but I couldn't find them.


ohmysql wrote:-rw-r--r-- 1 root root 146 Sep 13 15:23 usr/lib/dracut/hooks/emergency/80-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f7137669c-6e62-4f68-ade2-a010207ac3c7.sh
-rw-r--r-- 1 root root 64 Sep 13 15:23 usr/lib/dracut/hooks/initqueue/finished/devexists-\\x2fdev\\x2fdisk\\x2fby-uuid\\x2f7137669c-6e62-4f68-ade2-a010207ac3c7.sh


Uhmm, you already found them. I'd look into those scrips, and adjust the UUID if it's inside there, and also the filename part that consists of the UUID.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18037
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Boot into failsafe mode

Postby ohmysql » Dec 9th, '14, 08:28

Thanks for the suggestion--I didn't think of that. That said, the usr/lib/dracut/hooks/ directory doesn't exist. I searched for a hooks directory. I see two:

/usr/share/doc/git-core/contrib/hooks

and:

/usr/share/git-core/templates/hooks

And there is certainly no "emergency" directory there, or sign of anything too useful. I can ls those if you like, or I'm open to other suggestions.

The file x2f7137669c-6e62-4f68-ade2-a010207ac3c7.sh doesn't exist on that partition.

Other thoughts?
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby doktor5000 » Dec 9th, '14, 21:10

Uhmm, that was the output you posted from lsinitrd, hence the contents of your initrd.

To extract it, use e.g. the following as root:

Code: Select all
mkdir -p /tmp/initrd && cd /tmp/initrd
gzip -dc /boot/initrd.img | cpio -iv


Then edit in there to your liking, after that create a new initrd from that working folder:
Code: Select all
find . | cpio -o -H newc | gzip > /boot/new-initrd.img


Hint: you have to adjust /boot/initrd.img and /boot/new-initrd.img to what you use for booting, and afterwards adjust grub configuration to point to the new initrd. Or put the new one in place of the old one, whatever is easier for you.

----

Totally apart from that, can you try if booting Mageia with the kernel option "rd.hostonly=0" (without quotes) helps without doing any other changes?
Taken from https://www.kernel.org/pub/linux/utils/ ... racut.html

Another approach would be to simply boot from any Mageia 4 non-live install media, select "Upgrade" and your existing Mageia installation,
and let it run - it will not do anything apart from setting up bootloader again.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18037
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Boot into failsafe mode

Postby ohmysql » Dec 12th, '14, 05:23

Woohoo!!

I'm writing you from in mageia! I'll do a test and let you know if it was rebuilding initrd that did it or if it was the kernel line you suggested!

I'll also try to remember to repair the boot file before I restart.

But anyway, this isn't my thread but my problem is (I think) resolved!
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby ohmysql » Dec 15th, '14, 19:49

This part seems to have worked, even with a faulty UUID:

systemd.unit=multi-user rd.hostonly=0

Here's my full entry. I assume this will be much appreciated by anyone with the same problem:

Code: Select all
menuentry 'Mageia 4 latest tip' {
   insmod part_msdos
   insmod ext2
        search --no-floppy --fs-uuid --set=root   894e96b8-etc.
   linux   /boot/vmlinuz-desktop root=UUID=894e96b8-etc. ro   nokmsboot systemd.unit=multi-user rd.hostonly=0
   initrd  /boot/initrd-desktop.img
   #systemd.unit=multi-user is to prevent a fail
   #rd.hostonly=0
}


I'm going to try pointing it to the new initrd next, and remove "systemd.unit=multi-user rd.hostonly=0". I'll post results!
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby doktor5000 » Dec 15th, '14, 20:37

ohmysql wrote:systemd.unit=multi-user

[...]
linux /boot/vmlinuz-desktop root=UUID=894e96b8-etc. ro nokmsboot systemd.unit=multi-user rd.hostonly=0

#systemd.unit=multi-user is to prevent a fail


systemd.unit=multi-user does not prevent a fail in any way, and you can shorten that by simply putting a "3" at the end of the kernel command line, as this is the old runlevel 3.
Either it fails already for single-user mode and drops to an emergency shell as it cannot mount some filesystem or it will boot all the way through.
So either use "1" or "failsafe", shouldn't change the result in any way.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18037
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Boot into failsafe mode

Postby ohmysql » Dec 18th, '14, 21:08

Cool! Seems to be working, I tried the rebuilt initrd and it worked.

Should I rebuild dracut -f within Mage? As I recall that wasn't rebuilding initrd correctly previously, perhaps because I was shelling into Mageia?

Obviously its native grub is still broken! (I was able to chainload into that as well). But ya, this is largely fixed, so thanks!
ohmysql
 
Posts: 39
Joined: Nov 8th, '12, 16:59

Re: Boot into failsafe mode

Postby doktor5000 » Dec 18th, '14, 23:29

Yes you should rebuild the initrd, and also verify the grub configuration and reinstall it to where it should be installed ( MBR? root partition? didn't read through your setup for that )
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18037
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

PreviousNext

Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron