Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Does this look right for encrypted raid10?
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
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sun Aug 19, 2012 10:02 am    Post subject: Does this look right for encrypted raid10? Reply with quote

Seeing as I have now managed to get the wife and kids on board with Linux the real fun begins moving all PC's from Windows to Linux, and seeing as we do a lot of work from home we use raid and have the drives encrypted as we have customer information on our systems.

I think I have a good idea of how to easily move over but just need to check to make sure i am on the right track.

I have 4 500GB hard drives, i will use Linux raid and not the onboard nvidia (unless others suggest otherwise)

i will take 100meg from each of the drives and make it a raid1 device - so my boot is safe should drive a drive snuff it

Then take what is left and make the raid10 partition, giving 15GB to / (this should be plenty although I could extend it) 8 - 12GB to cover swap (i am still unsure if swap is even required now a days) and the rest will be given to /home - have decided to go with Luks for the encryption as it seems to work fine on laptop.

Now comes the tricky part, I have a initramfs which i use on the laptop which should be enough to use on the wifes PC (using her's as test before I do mine :p )

Code:
#!/bin/sh
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev

rescue() {
   echo "Dropping to rescue shell" >&2
   /bin/sh </dev/tty1 >/dev/tty1 2>&1
}
/bin/cryptsetup luksOpen /dev/sda2 gentoo || rescue
/bin/lvm pvscan || rescue
/bin/lvm vgscan || rescue
/bin/lvm vgchange -ay gentoo || rescue
mount -r /dev/mapper/gentoo-root /newroot || rescue
CMDLINE=`cat /proc/cmdline`
umount /dev
umount /sys
umount /proc
exec /bin/busybox switch_root /newroot /sbin/init ${CMDLINE}


Grub2 is the issue, from googling i see i will have to load modules for what i need - does this look right?

Code:
# (0) Gentoo Linux
menuentry "Gentoo Linux" {
insmod raid
insmod lvm
set root=(gentoo-roo)
linux /boot/kernel-3.5.2-gentoo root=/dev/mapper/gentoo-root ro
initrd /boot/initramfs-3.5.2.img
}


Any and all help greatly appreciated
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
zappatized
n00b
n00b


Joined: 18 Aug 2012
Posts: 21

PostPosted: Wed Aug 22, 2012 12:03 am    Post subject: Reply with quote

There is no advantage to a "fake" hardware raid over linux software raid as all the work still gets done by the cpu. And all hardware raids have the disadvantage of requiring the same (or compatible) controller to restore the array when the controller breaks.
You mention raid 10, have you considered raid5 instead?
I don't know that you need grub to load any modules if you're using a raid1 for boot. You should be able to tell grub to load the boot partition from one disk instead of trying to get grub to build the array. The real advantage to mirroring /boot is so that linux/mdadm will transparently make backup copies for you on each disk. The gentoo wiki has some good info.
You didn't mention anything about GPT but if you are not planning on maintaining a proprietary os on these systems I would highly recommend utilizing the newer GPT format.
As far as swap goes, if you intend to suspend to disk you should maintain a swap space large enough for what is currently in system memory => ~1.25-1.5*RAM. Otherwise you would probably be fine with .25-.5GB swap space depending on how much RAM is available to the system: more RAM requires less swap.
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Wed Aug 22, 2012 4:45 pm    Post subject: Reply with quote

from what i have read Raid10 is better than Raid5 for many reasons, as to GPT I always thought it was for partitions of over 2TB or is that it will allow up to 2TB, although due to lack of replies here and elsewhere I am unsure on whether to do this now
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
zappatized
n00b
n00b


Joined: 18 Aug 2012
Posts: 21

PostPosted: Wed Aug 22, 2012 8:08 pm    Post subject: Reply with quote

GPT does allow for partitions greater than 2TB, as well as a minimum of 128 partitions per HDD. It also offers more resilience for recovering data due to the partition table being duplicated at the end of the drive. And as a bonus you don't have to mess with boot flags or extended/logical/primary partition nonsense.
As far as the raid goes it depends on your needs. If you want half of your disks devoted to duplicating your data then raid 10 might be the solution for you.
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Thu Aug 23, 2012 4:12 pm    Post subject: Reply with quote

for storage and safety raid10 is better for my needs, I did many test's on it, and both systems being raid5 had terrible performance on transferring over the LAN - 20meg/sec on a Gbit network, with raid10 80 meg/sec, and thats with them encrypted, without they get near 100meg/sec.

As for loading modules, from what i have read in order for grub2 to see raid and luks, then you have to tell it to load the modules

Just need to know that my initial setup listed above will boot and do what i require it to do, i'm not going to waste what little free time I have if its not.
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
zappatized
n00b
n00b


Joined: 18 Aug 2012
Posts: 21

PostPosted: Sun Aug 26, 2012 12:59 pm    Post subject: Reply with quote

As I said above grub2 doesn't need to load a raid module if your /boot is on a raid1 device. Just tell grub to look at /dev/sdax like normal and it will work fine. I'm pretty sure you need to use the old 0.90 raid metadata format though.
If you're planning to use luks or lvm on the /boot device then grub needs to load the appropriate modules, otherwise grub doesn't need to know about them. Just compile support for them into the kernel like normal.
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