Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NVRAID, LVM, dm-crpyt, selfcompiled kernel, initramfs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Baarn
n00b
n00b


Joined: 02 Mar 2011
Posts: 17

PostPosted: Sat Jul 23, 2011 3:49 pm    Post subject: NVRAID, LVM, dm-crpyt, selfcompiled kernel, initramfs Reply with quote

Hey, I think the title tells what I want to do, but some advice so I won't forget anything.
I already read through those guides:
http://en.gentoo-wiki.com/wiki/RAID/NVRAID_with_dmraid
http://en.gentoo-wiki.com/wiki/Root_filesystem_over_LVM2,_DM-Crypt_and_RAID

ok, so my plan is simple:
I have a group of two 74GB drives and another group of two 2TB drives both mirrored with RAID1.
my partition table should look something like this:
on 74GB drives:
pri1 - /boot - unencrypted 100M
pri2 - dm-crypt-vg with lvm
- /root 15GB
- /swap 5GB
- /tmp 5GB
- /var 10GB
- /usr 100%left
/home wont get its own partition for now, it can stay under /root and i will move it to the 2TB drives when i have a running system.

so what i did till now:
i was able to find the raid-arrays and to partition them, in the next step i will build the complete cryptostuff on top.
my fear is remounting the partitions after reboot wont work, i have little to zero knowledge about init ramfs and i really don't know what to do here especially because the nvraid guide is from 2006.
are there any other guides, any recommendations? do i really need grub2?

(edit: i confused initscripts with initramfs ...)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21706

PostPosted: Sat Jul 23, 2011 5:32 pm    Post subject: Reply with quote

Your choice of bootloader is independent of what kernel you run or what initramfs, if any, it uses. You can use Grub Legacy, Grub2, LILO, or Syslinux to load your kernel. Once your kernel is loaded, its initramfs will need to discover any software RAID volumes and unlock any required encrypted volumes. An optional encrypted volume would be something like /home or a private files area, which is not required to boot the system. The instructions in the LVM2 Wiki article are outdated and ask you to copy the initramfs files instead of using the kernel build system to create it. The sample init should work, but is also outdated. You can use a devtmpfs instead of a static dev in the initramfs, which avoids problems with device numbers becoming stale.

I believe the warning about Grub Legacy vs. Grub2 only applies if you intend to have /boot be on a software RAID partition. If you only RAID the main system, then you can use Grub Legacy.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sat Jul 23, 2011 6:14 pm    Post subject: Reply with quote

Baarn,

nvraid is fakeraid - the only excuse for using fake raid is that windows must share the raid set.

Kernel raid is lower latency than nvraid. nvraid will only ever read from one drive in the mirror. kernel raid positions the heads of the drives in the mirror set over different tracks the reads from whichever drive has the head closest to the needed data.

Lastly, the data layout on the drives with fakeraid determined by your chipset and BIOS. If you ever need to move the raid drives to another motherboad, it needs the *identical* chipset and BIOS.
Kernel raid sets are hardware independent.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Baarn
n00b
n00b


Joined: 02 Mar 2011
Posts: 17

PostPosted: Sat Jul 23, 2011 7:46 pm    Post subject: Reply with quote

awww damn, i read in the guide that nvraid is slower than software raid, but some guy told me, that that was only the case for older chipsets.
is there an easy way to unsync the discs and apply software raid to them, or do i have to repartition (and install) everything?

@Hu
i only get half of what you're saying. whats the kernel build system? i mean i built some kernels, but never needed an initramfs, or is that always built into the kernel in some way?
and i think, after what NeddySeagoon said its better to use software-raid, which of course means that my /boot is on the software-raid as well.

can i just stick to this
http://en.gentoo-wiki.com/wiki/Root_filesystem_over_LVM2,_DM-Crypt_and_RAID
then and it will work?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21706

PostPosted: Sat Jul 23, 2011 8:08 pm    Post subject: Reply with quote

Baarn wrote:
is that always built into the kernel in some way?
The kernel build system always incorporates an initramfs, but if you have not configured one, the default initramfs will be empty and the kernel will fall back to the legacy behavior of mounting a root filesystem based on the kernel command line.
Baarn wrote:
and i think, after what NeddySeagoon said its better to use software-raid, which of course means that my /boot is on the software-raid as well.
You do not need to place /boot inside a software RAID. You could arrange the drives as so:
Code:
sda1: /boot
sda2: swap
sda3: md member
sdb1: alternate /boot (normally unused)
sdb2: swap
sdb3: md member
You would then create your DM-Crypt, LVM, and filesystems inside the MD created from sda3 and sdb3. The /boot on sdb1 would normally be unmounted and unused, but would be kept in place so that if sda dies, you can boot from sdb in degraded mode. You would need to take care to manually propagate any changes of /boot into sdb1.
Baarn wrote:
can i just stick to this
http://en.gentoo-wiki.com/wiki/Root_filesystem_over_LVM2,_DM-Crypt_and_RAID
then and it will work?
You could, but be aware that its instructions for preparing the initramfs encourage you to do it the hard way.
Back to top
View user's profile Send private message
Baarn
n00b
n00b


Joined: 02 Mar 2011
Posts: 17

PostPosted: Sat Jul 23, 2011 9:30 pm    Post subject: Reply with quote

OK, thanks for the help

I think I try to go with Grub2 and do it the hard way. The main purpose of that computer is to get as much nasty stuff onto it as possible, if I wanted the easy way I could just install Ubuntu ;)
At least i will learn something.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sat Jul 23, 2011 11:22 pm    Post subject: Reply with quote

Baarn,

grub 1 works fine on software raid1. Its simply ignores the raid structure but ...
You must create the /boot raid set with version 0.90 metadata, or grub won't boot.

Fakeraid is another version of software raid. Its just not as mature or hardware independent as kernel raid.
The speed you get is down to the software, not the hardware.

IF you want to be first into the future, rather than last out of the past, use parted and GPT partition tables, not fdisk and MSDOS Partition tables.
Watch out for the 4k phyisical sectors on your 2T drives. Properly aligned partitions are essential.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Baarn
n00b
n00b


Joined: 02 Mar 2011
Posts: 17

PostPosted: Sun Jul 24, 2011 1:01 am    Post subject: Reply with quote

my small drive is now allready partitioned with sfdisk (sounds like its fdisk too)
I think I will repartition with parted then ;)

Are there any true downsides on using grub2? I never had problems with it on my Xubuntu laptop, so I really don't see a reason why I shouldn't use it with gentoo.
how can I change the block size, and how can I take care of correct alignment? (or is that what parted will do?)

I was just recompiling the kernel (3.0.0) and i stumbled over some options:
Code:

Device Drivers ---> Multiple device drivers ->
< >  RAID support
[ ] Autodetect RAID arrays during kernel boot
...
[ ] RAID-1 (mirroring) mode


does this really mean what I think it means, or do i still have to create my initramfs? or is this what @Hu was talking about?
Back to top
View user's profile Send private message
Baarn
n00b
n00b


Joined: 02 Mar 2011
Posts: 17

PostPosted: Tue Jul 26, 2011 12:51 pm    Post subject: Reply with quote

Ok, i did a lot the last few days and learned some stuff.
But now i encounter another problem

Grub2 mkconfig wrote a config after some tweaking, and wrote it to the disks.
my problem now is, that grub2 used the UUID of the RAID-map /dev/md1
when booting, Grub tells me that there is no such device, of course not, RAID has not been initialized.

so how should i do this?
easies way (which i dont like)
drop raid on /dev/md1 and get UUID of /dev/sdc2 /dev/sdd2 respectively and write each grub with a modified grub.cfg onto the disks.

hard way
keep raid, and get the "before raided UUID" of each disks, modify grub.cfg and write to disk.
problem is: how to get the UUID of the non raided disks when in raid? or is there a way to get the UUID if the are not mounted?
next problem: there ist ext2 on the disks, but mount and parted tell me its a pseudo-raid filesystem, would this be a problem for grub to understand and find stuff?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum