# ICH10R Laptop HDD Layout Suggestions: RAID, LVM2, etc.

## jasn

I'm going to be installing Gentoo on a, the Clevo D900F, which is a Core i7,  X58 + ICH10R chipset, based laptop, next week. It has 3 HDD bays, and I'm installing 3 - 500gb SATAII HDDs. The laptop is advertised as supporting RAID-0 or RAID-1 with a minimum of 2 HDDs, and RAID-5 with a minimum of 3 HDDs and I realize that this is by using the "fakeraid" capabilities of the ICH10R chipset, as explained in this thread by NeddySeagoon, among others.

If I understand the options of Linux software RAID correctly, my plan is create identical partitions on all 3 drives of, 64mb, 2gb, and the remainder. I would then setup a RAID-1 set of the 3 - 64mb partitions, and make that /boot, another RAID-1 set of the 3 - 2gb partitions and make that swap, and finally make a RAID-5 set of the 3 - remainder partitions for root.

Does anyone see any issues or problems with doing this? Also please feel free to suggest an alternative layout.

Thanks.

----------

## aceFruchtsaft

If you're doing this for performance reasons, I would rather get an Intel SSD than use 3 HDDs in RAID 5 (especially if those are 5400 RPM drives). It will be faster, quieter and use less power.

If you want RAID, I suggest you look at how to align partitions to the MD device stripe boundaries to reduce the number of reads/writes you need to perform. For example, by default MD uses 64k chunk size, so you will want to align LVM partitions on 128k boundaries. This is a little tricky with LVM due to it's metadata. Additionally, you can also align file systems such as XFS and ext4. Check the man pages for mke2fs and mkfs.xfs.

This has been discusses several times on the XFS, linux raid and LVM mailing lists, look for information there.

Some more links which might be useful:

http://www.linuxfoundation.org/news-media/blogs/browse/2009/02/aligning-filesystems-ssd%E2%80%99s-erase-block-size

http://www.socalsysadmin.com/2008/10/15/optimizing-xfs-on-raid-arrays/

Also you might want to experiment with read ahead values for block devices to optimize performance (you can set read ahead separately on the disk, partition, md and lvm devices, but I haven't yet found a definitive answer to what settings are optimal.)

----------

## jasn

Thanks for the tips Ace.

The links you referenced are welcome reading/education for me. My main reason for configuring this system in this way, is for learning. I wanted to see if I could build a laptop config with a single file system on a RAID-5 array, which can continue to operate through the replacement of a drive.

A second question I had was, what are the main benefits to using LVM on top of a RAID array? I ask because I assume that with RAID-5, I have the ability to replace a drive in the array, without stopping the system. With LVM, if I replaced drives in the array with bigger drives, would LVM allow me to dynamically expand the volume size, without stopping the system as well?

----------

## aceFruchtsaft

The main benefit from using LVM that I see is ease of administration, even though LVM adds an additional layer and makes things more complex. If you have many partitions and want to resize them on demand, LVM is much more comfortable than messing around with the partition table directly. I think this is great because I always use many partitions and do not need to worry about initial partition size or waste disk space on partitions that currently don't need it.

If you want to add larger disks you will have to first grow the MD array (I've never done this, but see man mdadm and the "grow" option), then resize the LVM physical volume with pvresize and then you can allocate additional space to single logical volumes using lvresize. Finally, you will have to resize the file system on the logical volume with xfs_grow or resize_reiserfs or resize2fs, which can be done online.

----------

## Mad Merlin

When you see reference to growing RAID 5 arrays with mdadm, they're really referring to a reshape, which is the process of seamlessly adding an additional disk to the array (and obviously gaining the space associated with the additional disk). AFAIK, you cannot grow a RAID 5 array by enlarging the underlying partitions and performing some magic. (You can, however, swap out the drives one by one for larger drives, provided you let the array resync between each swap, leaving you with the extra unused space on each drive which can then be used as you see fit.)

----------

