You are not logged in.

#1 2012-07-18 16:39:52

uzsolt
Member
Registered: 2012-06-13
Posts: 56

Rescue system with mkinitcpio

Hello everybody!

I want to create a simple rescue system with the base commands and I think it would be most simplier to create an initramfs similar at Wiki/Archboot.
I've created one but it doesn't work: kernel can't find the root device.
The concerning part of syslinux.cfg:

LABEL rescue                                                                                                                                                            
    MENU LABEL Rescue System                                                                                                                                            
    LINUX ../rescue/vmlinuz_x86_64                                                                                                                                      
    INITRD ../rescue/initramfs_x86_64.img

LABEL rescue2                                                                                                                                                           
    MENU LABEL Own Rescue System                                                                                                                                        
    LINUX ../rescue/vmlinuz-rescue                                                                                                                    
    INITRD ../rescue/initramfs-rescue.img

The "rescue" works (it's official from archboot wiki) without any plus parameter to kernel but the own version doesn't work.

What I've missed?

Last edited by uzsolt (2012-07-18 16:40:29)

Offline

#2 2012-07-18 21:57:46

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Rescue system with mkinitcpio

You're missing the APPEND line, that's what.

https://wiki.archlinux.org/index.php/Sy … nux_Config


Here's another example:

LABEL arch
        MENU LABEL Arch Linux
        LINUX ../vmlinuz-linux
        APPEND root=UUID=978e3e81-8048-4ae1-8a06-aa727458e8ff ro quiet vga=current loglevel=3
        INITRD ../initramfs-linux.img

"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#3 2012-07-19 07:50:12

uzsolt
Member
Registered: 2012-06-13
Posts: 56

Re: Rescue system with mkinitcpio

Hm, sorry, I wasn't clear. I know that need to add a root option but what I know what will the root device. Initramfs will extract into memory but what is its device?
And when you see the rescue works without plus APPEND root=rootdevice - why? How can I do this in my case? How does "know" the kernel what is the root device?

Offline

#4 2012-07-19 08:11:55

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Rescue system with mkinitcpio

I think you need to read the documentation from syslinux.org or visit #syslinux on irc.freenode.net and ask there if you plan on using a non-standard .cfg. It was designed to work with at the very least 4 parameters: LABEL, KERNEL (or "LINUX"), APPEND and INITRD:

LABEL arch
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sda2 ro
        INITRD ../initramfs-linux.img

If you use a graphical interface, MENU LABEL should also be added.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#5 2012-07-19 08:22:52

uzsolt
Member
Registered: 2012-06-13
Posts: 56

Re: Rescue system with mkinitcpio

Yes, I know. But what will be the parameter "root"? This question isn't syslinux-depend.

APPEND root=ROOTDEVICE

What will the ROOTDEVICE in this case?
My syslinux.cfg:

LABEL arch
	MENU LABEL Arch Linux
	LINUX ../vmlinuz-linux
	APPEND root=/dev/sda6 ro init=/sbin/e4rat-preload ro elevator=deadline
	INITRD ../initramfs-linux.img

LABEL rescue
    MENU LABEL Rescue System
    LINUX ../rescue/vmlinuz_x86_64
    INITRD ../rescue/initramfs_x86_64.img

LABEL rescue2
    MENU LABEL Own Rescue System
    LINUX ../rescue/vmlinuz-rescue
    INITRD ../rescue/initramfs-rescue.img

LABEL archfallback
	MENU LABEL Arch Linux Fallback
	LINUX ../vmlinuz-linux
	APPEND root=/dev/sda6 ro
	INITRD ../initramfs-linux-fallback.img

At the installed archlinux ROOTDEVICE is /dev/sda6, I know (I've set it long time ago). But what should I do with initramfs? I don't want to boot from sda6 because it's the main system.
But when the main system goes wrong I can boot a rescue system which is in an initramfs so I don't update/install/... in the rescue system so I can boot it everytime (if I don't have hardware error smile ).

Offline

#6 2012-07-19 13:32:09

guelfi
Member
From: /home/guelfi
Registered: 2011-07-01
Posts: 111

Re: Rescue system with mkinitcpio

Do I understand you correctly that your rescue system is just a initramfs? Then just copy the whole "archfallback"-label, give it a new name and add the parameter "break=premount" to the "APPEND" line. This will drop you to a recovery shell in the initramfs.

Offline

#7 2012-07-19 13:41:19

uzsolt
Member
Registered: 2012-06-13
Posts: 56

Re: Rescue system with mkinitcpio

Thanks, guelfi, this is a good idea too, but not perfect.
I want some settings from my host system (the most important is the wifi-passwords) and network so this is the main reason why isn't enough the "break=premount" (and the challenge and the "geek factor" smile).

Offline

#8 2012-09-18 06:29:54

uzsolt
Member
Registered: 2012-06-13
Posts: 56

Re: Rescue system with mkinitcpio

I did it with ArchIso, works well and I've only ONE file. Thanks for helping!

Offline

Board footer

Powered by FluxBB