How many disks?For raid5 you need at least 3. You can go up from there, and every additional drive adds that much more space. You need to do a little pre-planning as it is not necessarily easy to add drives to the array after it is constructed. LVM also adds to this problem. There exists a utility raidreconf, but it is not well supported, and cannot operate while the drive is mounted. It’s also doubtful that you can resize the lvm physical volume. As such to add drives, you will have to copy the data off, and re-create the array. Keep this in mind before you store 600 Gb of data, and then will need to copy it off somewhere.
[edit]
The AnswerDo both
![]()
* Create a raid5 array and add it to our ‘box’.
* Then we make a filesystem from the space in the box.
* In the future we can add another array and add that to the box too.
* Then we can ‘grow’ the filesystem.Oh yes - that’s another thing. You must use a filesystem that can grow - so either Reiser or XFS. XFS can’t shrink so (despite having worked for SGI myself) I’d use Reiser. (You need to set data=sorted as kernel parameter on pre 2.6.6 kernels so a power outage wont cause data loss). [Later edit: I changed my mind after having had a few corruptions - I now have pure XFS]
Reiser is not a good choice for myth, as it is good for small files, not very large files. XFS is the best choice.
Linux Logical Volume Manager (LVM) on Software RAID
If you plan on using LVM, I really recommend doing so on a RAID system, either hardware or software. Disks are dirt cheap nowadays, so there’s really no excuse not to have mirroring (or RAID 5 if that’s better for your usage). The RedHat installer will let you create LVM volumes on top of RAID volumes (it’s a bit confusing, but it works), or you can do it later. Also remember that raid is not a substitute for regular and reliable backup!Before we get to how you’d do this, let’s go over what LVM gives you. First, LVM combines physical devices (partitions on disks in this case) into what it calls Volume Groups. Filesystems are then built on the Volume Group or groups. You can have a Volume Group that has only one disk partition in it, or several partitions on one or more disks. Each Volume Group can contain multiple filesystems. With this, you gain a lot of new capabilities.
* Increase or decrease filesystem size
Decreasing the size of a filesystem returns space to the Volume Group. Increasing draws space from it. If you have too much space allocated for a file system, you can decrease it, and use that space somewhere else that needs it.
Yes, you can do that with “parted”, but it’s not at all the same. You aren’t dealing with contiguous disk blocks with LVM - all you need is free space in the Volume Group.
* Add more physical storageYou can add more physical drives to an existing Volume Group, which of course immediately gives you more room to extend file systems.
* Create “snapshots” of filesystems.This is a great feature, but it requires a bit of explanation, so we’ll leave the details for later. The use of snapshots is to freeze a filesystem in time, and let you go on using it while you leisurely back up the frozen data. What’s wonderful about this is that it is NOT necessarily a full copy of your original file system - more on that later.
* Move Volume Groups to new physical storageI’m not going to cover this here, but it’s a great feature, and you can even do it while the filesystems are in use!
* StripingI’m not going to cover that here (there are some references at the bottom of this article that do cover it), but you can get the performance benefit of striping as part of LVM. If you do this, it is even more critical that you mirror your drives. If you used RAID 5, there wouldn’t be any point in striping in LVM as you already would have that benefit (see Raid if you don’t understand that).
Managing RAID and LVM with Linux
What is RAID and LVM
RAID is usually defined as Redundant Array of Inexpensive disks. It is normally used to spread data among several physical hard drives with enough redundancy that should any drive fail the data will still be intact. Once created a RAID array appears to be one device which can be used pretty much like a regular partition. There are several kinds of RAID but I will only refer to the two most common here.The first is RAID-1 which is also known as mirroring. With RAID-1 it’s basically done with two essentially identical drives, each with a complete set of data. The second, the one I will mostly refer to in this guide is RAID-5 which is set up using three or more drives with the data spread in a way that any one drive failing will not result in data loss. The Red Hat website has a great overview of the RAID Levels.
There is one limitation with Linux Software RAID that a /boot partition can only reside on a RAID-1 array.
Linux supports both several hardware RAID devices but also software RAID which allows you to use any IDE or SCSI drives as the physical devices. In all cases I’ll refer to software RAID.
LVM stands for Logical Volume Manager and is a way of grouping drives and/or partition in a way where instead of dealing with hard and fast physical partitions the data is managed in a virtual basis where the virtual partitions can be resized. The Red Hat website has a great overview of the Logical Volume Manager.
There is one limitation that a LVM cannot be used for the /boot.