Re: [gentoo-user] RAID 1 on /boot

2014-02-22 Thread J. Roeleveld
On Sat, February 22, 2014 06:27, Facundo Curti wrote:
 Hi all. I'm new in the list, this is my third message :)
 First at all, I need to say sorry if my english is not perfect. I speak
 spanish. I post here because gentoo-user-es it's middle dead, and it's a
 great chance to practice my english :) Now, the problem.

First of all, there are plenty of people here who don't have English as a
native language. Usually we manage. :)

 I'm going to get a new PC with a disc SSD 120GB and another HDD of 1TB.
 But in a coming future, I want to add 2 or more disks SSD.

 Mi idea now, is:

 Disk HHD: /dev/sda
 /dev/sda1 26GB
 /dev/sda2 90GB
 /dev/sda3 904GB

 Disk SSD: /dev/sdb
 /dev/sdb1 26GB
 /dev/sdb2 90GB
 /dev/sdb3 4GB

 And use /dev/sdb3 as swap. (I will add more with another SSD in future)
 /dev/sda3 mounted in /home/user/data (to save data unused)

Why put the swap on the SSD?

 And a RAID 1 with:
 md0: sda1+sdb1/
 md1: sda2+sdb2/home

 (sda1 and sda2 will be made with the flag: write-mostly. This is useful
 for
 disks slower).
 In a future, I'm going to add more SSD's on this RAID. My idea is the
 fastest I/O.

 Now. My problem/question is:
 Following the gentoo's
 dochttp://www.gentoo.org/doc/es/gentoo-x86+raid+lvm2-quickinstall.xml,
 it says I need to put the flag --metadata=0.9 on the RAID. My question is
 ¿This will make get off the performance?.

metadata=0.9 might be necessary for the BIOS of your computer to see the
/boot partition. If you use an initramfs, you can use any metadata you
like for the root-partition.

 I only found this
 documenthttps://raid.wiki.kernel.org/index.php/RAID_superblock_formats#The_version-0.90_Superblock_Format.
 This says the difference, but nothing about performance and
 advantages/disadvantages.

 Another question is, ¿GRUB2 still unsupporting metadata 1.2?

See reply from Canek.

 In case that metadata get off performance, and GRUB2 doesn't support this.
 ¿Anyone knows how can I fix this to use metadata 1.2?

 I don't partitioned more, because I saw this unnecessary. I just need to
 separate /home in case I need to format the system. But if I need to
 separate /boot to make it work, I don't have problems doing that.

 But of course, /boot also as RAID...

/boot seperate as RAID-1 and metadata=0.9 and you are safe.

 ¿Somebody have any ideas to make it work?

It is similar to what I do, except I don't have SSDs in my desktop.

I have 2 partitions per disk:
1 : /boot (mirrored, raid-1)
2 : LVM (striped, raid-0)
All other partitions (root, /usr, /home, ) are in the LVM.

I use striping for performance reasons for files I currently work with.
All important data is stored and backed up on a server.

For this, an initramfs is required with support for mdraid and lvm.

 Thank you all. Bytes! ;)

You're welcome and good luck.

Please let us know what the performance is like when using the setup you
are thinking off.

--
Joost




Re: [gentoo-user] RAID 1 on /boot

2014-02-22 Thread Stroller

On Sat, 22 February 2014, at 5:27 am, Facundo Curti facu.cu...@gmail.com 
wrote:
 ...
 I'm going to get a new PC with a disc SSD 120GB and another HDD of 1TB. But 
 in a coming future, I want to add 2 or more disks SSD.
 
 Mi idea now, is:
 
 Disk HHD: /dev/sda
   /dev/sda1   26GB
   /dev/sda2   90GB
   /dev/sda3   904GB
 
 Disk SSD: /dev/sdb
   /dev/sdb1   26GB
   /dev/sdb2   90GB
   /dev/sdb3   4GB
 
 And use /dev/sdb3 as swap. (I will add more with another SSD in future)
 /dev/sda3 mounted in /home/user/data (to save data unused)
 
 And a RAID 1 with:
 md0: sda1+sdb1/
 md1: sda2+sdb2/home
 
 (sda1 and sda2 will be made with the flag: write-mostly. This is useful for 
 disks slower).
 In a future, I'm going to add more SSD's on this RAID. My idea is the fastest 
 I/O.


I think you're thinking along the right lines, but I'd use something dedicated 
to the job:

• http://bcache.evilpiepirate.org
• https://wiki.archlinux.org/index.php/Bcache

Stroller.



Re: [gentoo-user] RAID 1 on /boot

2014-02-22 Thread Kerin Millar

On 22/02/2014 11:41, J. Roeleveld wrote:

On Sat, February 22, 2014 06:27, Facundo Curti wrote:

Hi all. I'm new in the list, this is my third message :)
First at all, I need to say sorry if my english is not perfect. I speak
spanish. I post here because gentoo-user-es it's middle dead, and it's a
great chance to practice my english :) Now, the problem.


First of all, there are plenty of people here who don't have English as a
native language. Usually we manage. :)


I'm going to get a new PC with a disc SSD 120GB and another HDD of 1TB.
But in a coming future, I want to add 2 or more disks SSD.

Mi idea now, is:

 Disk HHD: /dev/sda
/dev/sda1 26GB
/dev/sda2 90GB
/dev/sda3 904GB

 Disk SSD: /dev/sdb
/dev/sdb1 26GB
/dev/sdb2 90GB
/dev/sdb3 4GB

And use /dev/sdb3 as swap. (I will add more with another SSD in future)
/dev/sda3 mounted in /home/user/data (to save data unused)


Why put the swap on the SSD?


And a RAID 1 with:
md0: sda1+sdb1/
md1: sda2+sdb2/home

(sda1 and sda2 will be made with the flag: write-mostly. This is useful
for
disks slower).
In a future, I'm going to add more SSD's on this RAID. My idea is the
fastest I/O.

Now. My problem/question is:
Following the gentoo's
dochttp://www.gentoo.org/doc/es/gentoo-x86+raid+lvm2-quickinstall.xml,
it says I need to put the flag --metadata=0.9 on the RAID. My question is
¿This will make get off the performance?.


It has no impact on performance.



metadata=0.9 might be necessary for the BIOS of your computer to see the
/boot partition. If you use an initramfs, you can use any metadata you
like for the root-partition.


The BIOS should not care at all as it is charged only with loading code 
from the MBR. However, if the intention is to use grub-0.97 then the 
array hosting the filesystem containing /boot should:


  * use RAID-1
  * use the 0.90 superblock format

That way, grub-0.97 can read the filesystem from either block device 
belonging to the array. Doing it any other way requires a bootloader 
that specifically understands md (such as grub2).


There's also the neat trick of installing grub to all disks belonging to 
the array for bootloader redundancy. However, I'm not entirely sure that 
Code Listing 2.35 in the Gentoo doc is correct. Given that particular 
example, I would instead do it like this:-


  grub device (hd0) /dev/sda
  grub root (hd0,0)
  grub setup (hd0)
  grub device (hd0) /dev/sdb
  grub root (hd0,0)
  grub setup (hd0)

The idea there is that, should it ever be necessary to boot from the 
second disk, the disk in question would be the one enumerated first by 
the BIOS (mapping to hd0 in grub). Therefore, grub should be installed 
in that context across all disks. It should not be allowed to boot from 
any given drive and subsequently try to access =(hd1).


With grub2, it's a little easier because it is only necessary to run 
grub-install on each of the drives:


  # grub-install /dev/sda
  # grub-install /dev/sdb




I only found this
documenthttps://raid.wiki.kernel.org/index.php/RAID_superblock_formats#The_version-0.90_Superblock_Format.
This says the difference, but nothing about performance and
advantages/disadvantages.


The 0.90 superblock format is subject to specific limitations that are 
clearly described by that page. For example, it is limited to 28 devices 
in an array, with each device being limited to 2TB in size.


Also, the 0.90 format will cause issues in certain setups because of the 
way that it places its metadata at the end of the block device [1]. That 
said, the 0.90 format does allow for the kernel to construct the array 
without any intervention from userspace so it still has its uses.


The 1.2 format positions the superblock 4KiB from the beginning of the 
device. Note that this has nothing at all to do with the data, which 
usually begins 1MiB in. If you run mdadm -E on a member of such an 
array, the offset will be reported as the Data Offset. For example:


  Data Offset : 2048 sectors

So, it's not a matter of alignment. Rather, the advantage of the 1.2 
format is that it leaves a little space for bootloader code e.g. in case 
you want to create an array from whole disks rather than disk partitions.


None of this matters to me so I tend to stick to the 1.1 format. It 
wouldn't actually make any difference to my particular use case.





Another question is, ¿GRUB2 still unsupporting metadata 1.2?


See reply from Canek.


In case that metadata get off performance, and GRUB2 doesn't support this.
¿Anyone knows how can I fix this to use metadata 1.2?

I don't partitioned more, because I saw this unnecessary. I just need to
separate /home in case I need to format the system. But if I need to
separate /boot to make it work, I don't have problems doing that.

But of course, /boot also as RAID...


/boot seperate as RAID-1 and metadata=0.9 and you are safe.


¿Somebody have any ideas to make it work?


It is similar to what I do, except I don't have SSDs in my desktop.

I have 

Re: [gentoo-user] RAID 1 on /boot

2014-02-22 Thread Facundo Curti
Thank you so much for the help! :) It was very useful.

I just need wait my new PC, and try it *.* jeje.

Bytes! ;)


Re: [gentoo-user] RAID 1 on /boot

2014-02-22 Thread Facundo Curti
Please let us know what the performance is like when using the setup
you are thinking off.

Of course. I will post these here :)


2014-02-22 16:13 GMT-03:00 Facundo Curti facu.cu...@gmail.com:

 Thank you so much for the help! :) It was very useful.

 I just need wait my new PC, and try it *.* jeje.

 Bytes! ;)



[gentoo-user] RAID 1 on /boot

2014-02-21 Thread Facundo Curti
Hi all. I'm new in the list, this is my third message :)
First at all, I need to say sorry if my english is not perfect. I speak
spanish. I post here because gentoo-user-es it's middle dead, and it's a
great chance to practice my english :) Now, the problem.

I'm going to get a new PC with a disc SSD 120GB and another HDD of 1TB. But
in a coming future, I want to add 2 or more disks SSD.

Mi idea now, is:

Disk HHD: /dev/sda
/dev/sda1 26GB
/dev/sda2 90GB
/dev/sda3 904GB

Disk SSD: /dev/sdb
/dev/sdb1 26GB
/dev/sdb2 90GB
/dev/sdb3 4GB

And use /dev/sdb3 as swap. (I will add more with another SSD in future)
/dev/sda3 mounted in /home/user/data (to save data unused)

And a RAID 1 with:
md0: sda1+sdb1/
md1: sda2+sdb2/home

(sda1 and sda2 will be made with the flag: write-mostly. This is useful for
disks slower).
In a future, I'm going to add more SSD's on this RAID. My idea is the
fastest I/O.

Now. My problem/question is:
Following the gentoo's
dochttp://www.gentoo.org/doc/es/gentoo-x86+raid+lvm2-quickinstall.xml,
it says I need to put the flag --metadata=0.9 on the RAID. My question is
¿This will make get off the performance?.

I only found this
documenthttps://raid.wiki.kernel.org/index.php/RAID_superblock_formats#The_version-0.90_Superblock_Format.
This says the difference, but nothing about performance and
advantages/disadvantages.

Another question is, ¿GRUB2 still unsupporting metadata 1.2?

In case that metadata get off performance, and GRUB2 doesn't support this.
¿Anyone knows how can I fix this to use metadata 1.2?

I don't partitioned more, because I saw this unnecessary. I just need to
separate /home in case I need to format the system. But if I need to
separate /boot to make it work, I don't have problems doing that.

But of course, /boot also as RAID...

¿Somebody have any ideas to make it work?

Thank you all. Bytes! ;)


Re: [gentoo-user] RAID 1 on /boot

2014-02-21 Thread Canek Peláez Valdés
On Fri, Feb 21, 2014 at 11:27 PM, Facundo Curti facu.cu...@gmail.com wrote:
 Hi all. I'm new in the list, this is my third message :)
 First at all, I need to say sorry if my english is not perfect. I speak
 spanish. I post here because gentoo-user-es it's middle dead, and it's a
 great chance to practice my english :) Now, the problem.

 I'm going to get a new PC with a disc SSD 120GB and another HDD of 1TB. But
 in a coming future, I want to add 2 or more disks SSD.

 Mi idea now, is:

 Disk HHD: /dev/sda
 /dev/sda1 26GB
 /dev/sda2 90GB
 /dev/sda3 904GB

 Disk SSD: /dev/sdb
 /dev/sdb1 26GB
 /dev/sdb2 90GB
 /dev/sdb3 4GB

 And use /dev/sdb3 as swap. (I will add more with another SSD in future)
 /dev/sda3 mounted in /home/user/data (to save data unused)

 And a RAID 1 with:
 md0: sda1+sdb1/
 md1: sda2+sdb2/home

 (sda1 and sda2 will be made with the flag: write-mostly. This is useful for
 disks slower).
 In a future, I'm going to add more SSD's on this RAID. My idea is the
 fastest I/O.

 Now. My problem/question is:
 Following the gentoo's doc, it says I need to put the flag --metadata=0.9 on
 the RAID. My question is ¿This will make get off the performance?.

 I only found this document. This says the difference, but nothing about
 performance and advantages/disadvantages.

I don't know the performance differences, if any, but in my tests
everything worked with the default metadata (1.2).

 Another question is, ¿GRUB2 still unsupporting metadata 1.2?

No, GRUB2 supports it just fine. You just need to use the mdraid1x GRUB2 module.

 In case that metadata get off performance, and GRUB2 doesn't support this.
 ¿Anyone knows how can I fix this to use metadata 1.2?

It's not necessary.

 I don't partitioned more, because I saw this unnecessary. I just need to
 separate /home in case I need to format the system. But if I need to
 separate /boot to make it work, I don't have problems doing that.

It works fine; I tested it in a virtual machine (and I used systemd,
but it should not be significantly different with OpenRC). You can
check my steps in [1] and [2] (with LUKS support).

 But of course, /boot also as RAID...

It works even with boot being on LVM over RAID.

 ¿Somebody have any ideas to make it work?

I didn't tested in a real life machine (I've never been a fan of
neither RAID nor LVM), but in a VM it worked without a hitch. Again,
check [1] and [2].

Hope it helps.

Regards.

[1] http://article.gmane.org/gmane.linux.gentoo.user/269586
[2] http://article.gmane.org/gmane.linux.gentoo.user/269628
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] RAID 1 on /boot

2014-02-21 Thread Canek Peláez Valdés
On Sat, Feb 22, 2014 at 12:41 AM, Canek Peláez Valdés can...@gmail.com wrote:
[ snip ]
 [1] http://article.gmane.org/gmane.linux.gentoo.user/269586
 [2] http://article.gmane.org/gmane.linux.gentoo.user/269628

Also, check [3], since the solution on [2] was unnecessarily complex.

Regards.

[3] http://comments.gmane.org/gmane.linux.gentoo.user/269628
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México