In this post describe as brevity without any pretense of completeness how we can create a RAID 1 (software) during the installation of Debian Etch and how to properly configure the LVM.
On one of my workstation I have two identical hard disk from 320GB. I decided to install yet another Debian Etch and put two drives in RAID. I started the installation, and a couple of minutes I arrived at the step where the settings are made for the partitioning of the disks. Since the S-ATA disks, the debian-installer has recognized me as follows:
- Scsi1 (0,0,0) (sda)
- SCSI2 (0,0,0) (sdb)
The same is true, however, for IDE disks, then the debian-installer vederebbe them thus:
Then I created a partition booting the first, smallest size (only 512MB):
- select the first disk scsi1
- choose as a method of partitioning "Manual"
- select the "Free Space" under scsi1
- click "Create a new partition"
- select "Start" as the location of the new partition
- select "Primary" as a new type of partition
- 512M insert size of the new partition
- click "physical volume for RAID" as the profile of the new partition
- click "Preparation of this partition completed"
Then I created the partition will contain the file itself:
- select the first disk scsi1
- choose as a method of partitioning "Manual"
- select the "Free Space" under scsi1
- click "Create a new partition"
- select "Start" as the location of the new partition
- select "Primary" as a new type of partition
- insert size as 95% of the new partition
- click "physical volume for RAID" as the profile of the new partition
- click "Preparation of this partition completed"
Why in paragraph 7 I chose to use only 95% of the disk? Simply because, if I have to replace one of the two discs, I will not ever absolute certainty that the new disc has exactly the same number of cylinders etc. compared with the original disc, even if you buy the same brand of the same denomination. I need then a gap of tolerance to get safe from possible data loss or inconsistencies during the reconstruction of the volumes. Of course, is wasted space that will never be used, but with discs of this size we can well afford.
Now you must repeat the operations described above for the second disc (SCSI2) ensuring that we have done exactly the same choices made in the first.
Once that's done, we can configure the software RAID 1. First we create the multidisk device intended to contain the boot partition:
- click "Configure Software RAID"
- confirm "Writing changes on devices ..."
- click "Create a multidisk device (MD)"
- select "RAID1" as the type of device multidisk
- confirm "2" as the number of active device for the RAID1 array
- confirm "0" as the number of devices "spare"
- only enable / dev/sda1 and / dev/sdb1 as active device
- click "Finish"
Then we create the multidisk device intended to contain the file itself:
- click "Configure Software RAID"
- confirm "Writing changes on devices ..."
- click "Create a multidisk device (MD)"
- select "RAID1" as the type of device multidisk
- confirm "2" as the number of active device for the RAID1 array
- confirm "0" as the number of devices "spare"
- only enable / dev/sda2 and / dev/sdb2 as active device
- click "Finish"
Now we can move to the creation of logical volumes. First you create the volume is intended to act as the swap system:
- click "Setting up Logical Volume Manager"
- confirm "Writing changes to the disks and ..."
- click "Create volume group"
- write "VG00" as the name of the group of volumes
- only enable / dev/md/1 as drive for the new volume group
- click "Create a logical volume"
- select group of volumes "VG00"
- write "swap" as the name of logical volumes
- write "4GB" as the size of the logical volume (at least twice the RAM)
Then create the volume for the file itself:
- click "Create a logical volume"
- select group of volumes "VG00"
- write "filesys" as the name of logical volumes
- confirm the maximum available size of the proposed logical volume
- click "Finish"
You can create partitions:
- select the No. 1 under "LVM VG VG00 LV filesys"
- create the partition normally (choosing "Ext3" as the profile and "/" as a mount point)
- click "Finish"
- select the No. 1 under "LVM VG VG00 LV swap"
- create the swap normally (choosing "swap area" as a way of use)
- confirm "Writing changes to the disks and ..."
Once that's done, just go ahead with the installation of Debian as usual.