Linux System Administration Recipes A Problem-Solution Approach
Linux System Administration Recipes A Problem-Solution Approach
Linux System Administration Recipes A Problem-Solution Approach
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
CHAPTER 5 ■ WORKING WITH FILESYSTEMS■ Note To avoid having to do this, allow more room than you think you’ll need when creating / on new machines!Disk space is cheap these days, so you can be generous with it.5-6. Using RAID Arrays and mdadmRAID arrays offer a way of using multiple disks underneath your filesystems. Any kind of filesystem(journaled or otherwise) that you can run on a regular disk, you can also run on a RAID array. Thefilesystem will see the array as a single disk space, and the RAID hardware or software (hardware vs.software RAID is discussed later in this recipe) handles the physical details of what data is written whereand how it is accessed.There are two basic options with RAID arrays: mirroring and striping. (RAID0 also offersaggregation, where you just add two disks together.) With mirroring, you have one disk with yourcontent and another disk or disks providing an exact mirror of that. With striping, you have multipledisks acting in effect as one disk, with the content being “striped” across both of them. Striping willimprove performance; mirroring may give some performance improvement if you have multipleprocessors. Both striping and mirroring provide increased redundancy. They both also have a disk spacecost, in that you can’t use all the theoretically available space on your disks because some is used forimplementing the redundancy. Mirroring is more expensive in this sense than striping is. You can alsocombine both, which gives you the following options:• RAID0, aka striping only: The data is split across multiple disks (usually two)to speed up access. In the event of one disk failing, all the data is lost becausethere’s no fault tolerance or redundancy. The striping is optional. If you prefer,you can just concatenate multiple disks so they are seen by the filesystem as onebig disk. However, without striping, there’s no speed increase. The only gain is thedisk size.• RAID1, aka mirroring only: The data is mirrored across multiple disks (usuallytwo). There’s slight speedup if using multiple processors, and data redundancy; ifone disk fails, all the data is still available from the other one.• RAID5, aka striped set with distributed parity: The data is split across multipledisks, but if a single drive is lost, the missing data can be calculated from the dataon the remaining drives (this is the parity), so no data is lost. A second drive failurewill lose all the data, so it’s important to replace a failed disk immediately.• RAID6, aka striped set with dual distributed parity: Like RAID5, but you can loseup to two disks before data is lost.• RAID10, aka RAID1+0 or RAID0+1: This offers striping and mirroring. In RAID0+1,you use two sets of disks, each of which are striped, with one of the striped setsmirroring the other. If drives fail only on one side, then you lose no data; if drivesfail on both sides, then you lose all the data. With RAID1+0, you create a stripedset from a series of mirrored drives. The fault tolerance is higher, because you canafford to lose any single disk in one of the mirrored sets and an entire mirrored set,before data is lost. The performance is also better than RAID5; however, you getless usable space from your total purchased disk space (losing space to bothmirroring and striping).128Download at WoweBook.Com