FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

LinkBack Thread Tools
Old 01-09-2012, 02:58 AM
Jonathan Vasquez
Default Removing initrd (For use with GRUB2, LVM, GPT)

Hello everyone,

So I've been experimenting on removing my use of initrd and using the
kernel directly.

My current setup is the following:

GPT, LVM, GRUB2 (So I can boot my partitions that are inside the LVM).

/dev/sda1 BIOS Boot Partition EF02 (GPT)
/dev/sda2 Linux LVM (named arch)

/dev/arch/boot - /boot
/dev/arch/swap - swap
/dev/arch/home - /home
/dev/arch/root - /

When I compiled my custom kernel (from upstream, and yes I did enable
device mapper support compiled into the kernel, I've also experimented
with it as a module), the kernel fails to see the / partition.

So I turn on my computer, BIOS starts, then GRUB2 starts, GRUB2 sees
the /boot partition inside of the `arch` lvm because GRUB2 has support
for it (insmod lvm), then when the kernel (which is inside the /boot
partition inside the lvm) starts, the kernel "loses" the ability to
find the partitions inside of the lvm. Which leads me to believe that
GRUB2's ability to see lvm partitions doesn't carry over to the
kernel.. rightfully so, 2 seperate applications. Then the kernel
panics and says that I need to set the correct root= parameter. The
parameter is set but the parameter is /dev/arch/root .. a partition
inside of the lvm which the kernel cannot see after GRUB2 boots the

I'm assuming this is why we need an initrd. So that the /init script
inside the initrd does what it needs (like `vgchange -a y` then
mounting /dev/arch/root as newroot and transferring control back to
the kernel with that new root parameter).

I guess what I need to do is rethink my partition layout because I
cannot see a way to boot my root LVM partition without initrd, without
doing a few things.

Here is a few drawings I've made to think about my layout:

(Current Layout)

(Pondering Sheet)

As you can see in the second sheet, my thoughts are as follows:

Scenario 1. GRUB 2 starts, it finds /boot inside of the lvm, that then
triggers the kernel to start, which then finds the root partition that
is on a regular partition on the hdd, therefore no dm-mod support
needs to be compiled directly into the kernel or to use an initrd to
set up the environment before hand, after that happens, the init
scripts (also /etc/fstab) load up dm-mod and load up /home which is
inside of the lvm as well.

Scenario 2. GRUB 2 starts, it finds /boot which is now on a normal
partition, that then triggers the kernel which also finds / on a
normal partition as well, and then the kernel triggers the systems
init scripts, and loads up all the other partitions back into the /
filesystem layout.

The point of the above set up is to minimize real partition usage, and
maximize lvm usage for the benefits of flexibility (involving
resizing, shrinking, and adding more space) without the need for
initrd. In term simplifying the entire system.

There are of course other ways to simplify the system, and I'm not
against using initrd in any way, but it's something that I would not
want to use, or learn not to be dependent on.

Jonathan Vasquez

Thread Tools

All times are GMT. The time now is 11:01 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org