PDA

View Full Version : Entered emergency mode after Optimization failure



Allan B
12th May 2013, 10:00 AM
Hi all
I tried to optimize boot of lxde fedora 18 using this guide:
http://bsriram.wordpress.com/2012/10/22/optimize-fedora-booting-process/
The guide is very good and gave me god results. But when I tried to skip RAM disk it went wrong.
I added:
root=/dev/sda1 rootfstype=ext4
To the line in grub.cfg starting with: linux /boot/vmlinuz
I did not comment the initrd line.
/dev/sda1 is an ext4 partition – it is the boot partition. The rest of my disk is lvm.

When booting I now get the message:

Dracut-initqueue[194]: Warning: Can’t mount root filesystem
Entering emergency mode. Exit the shell to continue.

How do I edit grub.cfg when in dracut emergency mode? I want to remove the added parameters.
Is there any other ways to get around this problem?

---------- Post added at 09:00 AM ---------- Previous post was at 08:27 AM ----------

Additional info:

I typed this in. I hope there's no typo.


Cat /proc/cmdline

BOOT_IMAGE=/wmlinuz-3-8-11-200.fc18.i686 root=/dev/mapper/fedora_allan—dekstop-root ro root=/dev/sda1 rootfstype=ext4 libahci.ignore_sss=1 raid=noautodetect rd.md=0 rd.md=0 rd.lvm.lv=fedora_allan-desktop/swap rd.luks=0 vconsole.keymap=dk rd.lvm.lv=fedora_allan-desktop/root rhgb quiet

/Allan B

B1ueB1aze
12th May 2013, 10:11 AM
Hello Allan B,

If you copied your additional info verbatim of your config, then I believe there is a typo. I think it should be vmlinuz, not wmlinuz in the BOOT_IMAGE.

Allan B
12th May 2013, 11:39 AM
You are right.
Cat /proc/cmdline gives me:


BOOT_IMAGE=/vmlinuz-3-8-11-200.fc18.i686 root=/dev/mapper/fedora_allan—dekstop-root ro root=/dev/sda1 rootfstype=ext4 libahci.ignore_sss=1 raid=noautodetect rd.md=0 rd.md=0 rd.lvm.lv=fedora_allan-desktop/swap rd.luks=0 vconsole.keymap=dk rd.lvm.lv=fedora_allan-desktop/root rhgb quiet

those fingers :rolleyes:

---------- Post added at 10:39 AM ---------- Previous post was at 09:14 AM ----------

blkid says there is a /dev/mapper/fedora_allan—dekstop-root

But it is not mounted

/dev/sda1 is mounted at /sysroot

But I can't find grub.cfg

This must be a simple thing to fix. I'm just new to linux, but have spend hours seeking a solution.

Gareth Jones
12th May 2013, 02:07 PM
blkid says there is a /dev/mapper/fedora_allan—dekstop-root

You need to go back to using the initramfs. Those “optimization” guides are all very well for the people who wrote them, and presumably understood the implications of what they were doing (often doubtful!), but the default Fedora configuration is what it is for a reason. There is a certain amount of irresponsibility on the part of the authors when they make these available as step-by-step guides for anyone to follow, without any consideration for the security or stability implications.

Unless your root file-system is on a raw, unencrypted, non-logical, non-RAID etc. partition, you need the initramfs. You root volume appears to be an LVM logical volume, so the LVM subsystem at least must be brought on-line before / can be mounted. This is exactly what the Fedora initramfs is for – getting the root volume into a mountable state, and as little as possible else.

Restore your kernel boot command-line and initramf image – you did keep a back-up, right? My /boot/grub/grub.cfg lines look something like:

linux /vmlinuz-3.8.11-200.fc18.x86_64 root=UUID=af6427a5-6d18-402a-9c0e-0a2e1ecacb24 ro rd.lvm.lv=crypta/root rd.dm=0 rd.lvm.lv=crypta/swap rd.md.uuid=df14ee2e:fdd10595:82dad5a0:73876645 rd.luks.uuid=luks-c87a7e03-36ab-48c1-a32e-f9de7a54f84e vconsole.keymap=uk rd.luks.uuid=luks-ba32b17d-6a09-417a-9b18-daab7b7e3691 rd.lvm.lv=cryptb/swap rd.lvm.lv=cryptb/root rhgb quiet LANG=en_GB.utf8
initrd /initramfs-3.8.11-200.fc18.x86_64.img
Obviously you’ll need to customize these for your system.

If you left /etc/default/grub well alone, then once you are into your system again, run “su -c "grub2-mkconfig -o /boot/grub/grub.cfg"” to restore the proper configuration. Good luck!

Allan B
12th May 2013, 05:35 PM
Thank you Gareth for your advice.
I finaly got it working again.
As expected it was a simple ting. I just thought I could do it from emergency mode. So if others should end up in a similar situation. Here is what I did to solve the problem.
I booted on my live-cd (pen-drive). Here I could find the boot partition. In the folder /boot/grub2 where grub.cfg can be found.
I had to use chmod to be able to edit the file.
Then I removed "root=/dev/sda1 rootfstype=ext4" where ever it was found.
Now could boot again.
I edited my etc/default/grub where I removed "root=/dev/sda1 rootfstype=ext4" again.
Finaly to reastablish grub.cfg I ran: grub2-mkconfig -o /boot/grub2/grub.cfg

As for the irresponsibility Gareth mention, It is myself that should be blamed. I'm tweeking on purpose. I'm just new in this game. Linux is huge and there is a lot to learn. If you don't try anything, you will not learn anything. So now I just have to find the right way to disable initramfs. My system is on a raw, unencrypted, non-logical, non-RAID partition. Maybe I should first find a way to get rid of LVM.

I know that the default Fedora configuration is what it is for a reason. I got other reasons.
I thought open source cumunities was advocating experimenting, tweeking and hacking. If this is not the right forum please let me know.

Thanks anyway

Gareth Jones
12th May 2013, 08:04 PM
As for the irresponsibility Gareth mention, It is myself that should be blamed. I'm tweeking on purpose. I'm just new in this game. Linux is huge and there is a lot to learn. If you don't try anything, you will not learn anything.

Agreed. If you’re learning and happy doing so, then great! We like that, and I was wrong to assume otherwise, sorry.

These guides do tend to catch out people who aren’t interested in learning, and just want faster boot-times, and it’s not much fun for anyone trying to help such users fix their systems. I’d never consider publishing anything like that without each step starting with a warning about what it could break, with links to more details.


So now I just have to find the right way to disable initramfs. My system is on a raw, unencrypted, non-logical, non-RAID partition. Maybe I should first find a way to get rid of LVM.

Yes, you need to get rid of LVM. The kernel cannot set-up LVM volumes itself, and needs the utilities on the initramfs. The Fedora installer traditionally defaults to using LVM, but for most people that doesn’t really add any useful functionality.


I thought open source cumunities was advocating experimenting, tweeking and hacking. If this is not the right forum please let me know.

Yes, and no, this is the right forum. I was just grumpy on account of not having had dinner earlier. My apologies!

DBelton
13th May 2013, 03:15 AM
Hey.. Experimenting is how you learn :)

You actually learn a lot more by experimenting and totally screwing up your system than you do if everything works properly.

But, as Gareth said, those guides are pretty good for someone that already knows a little about their system and what those changes may or may not do for them. But for the user unfamiliar with how their system works, they can be dangerous.

And there probably are ways you could tweak things around and not use a initramfs on F18, but you would spend quite a lot of time and the gains you get from it would not be much at all. They have streamlined dracut in F18 and it produces a leaner initramfs than previous versions do (or is that a new feature in F19, I can't remember for certain now)

Allan B
13th May 2013, 07:41 PM
Hello
I did it again. This time I knew what to do. Then I was experimenting with removal of LVM. This time I met the danger. Nothing could be saved. GParted was sent in as Victor the Cleaner.
Good thing is that the worst thing that can happen is you have to reinstall.
Then I could partition the disk without LVM.
I got a mini itx motherboard with a 30Gb SSD. It has to run my robot. My goal is a lightweight Linux to save battery.
/Allan B