Archive for 8 October 2008

Installing Debian Etch on RAID + LVM

2 commenti » Debian , Open Source , System , Tips & Tricks 2 Comments »

In this post I describe with the utmost brevity and without any pretense of completeness how to implement a RAID 1 (software) when you install Debian Etch and how to properly configure the LVM.

On one of my workstation I have two identical 320GB hard drives. I decided to installarci yet another Debian Etch and put the two disks in RAID. I started the installation and in a couple of minutes I got to the step in which the settings are made for disk partitioning. Since the S-ATA disks, the debian-installer I recognized them as follows:

  • SCSI1 (0,0,0) (sda)
  • SCSI2 (0,0,0) (sdb)

The same goes for IDE drives, however, in that case they would see the debian-installer like this:

  • IDE1 (hda)
  • IDE2 (hdc)

At this point I have created a first partition booting, the minimum size (512MB only):

  1. select the first disk SCSI1
  2. choose as a method of partitioning the "Manual"
  3. select "FREE SPACE" below SCSI1
  4. choose "Create a new partition"
  5. select "Start" as the location of the new partition
  6. Select "Primary" as the type of the new partition
  7. insert the new partition size as 512M
  8. choose "physical volume for RAID" as a way to use the new partition
  9. Select "Done setting up partition completed"

Then I created the partition to contain the actual filesystem:

  1. select the first disk SCSI1
  2. choose as a method of partitioning the "Manual"
  3. select "FREE SPACE" below SCSI1
  4. choose "Create a new partition"
  5. select "Start" as the location of the new partition
  6. Select "Primary" as the type of the new partition
  7. enter 95% as the size of the new partition
  8. choose "physical volume for RAID" as a way to use the new partition
  9. Select "Done setting up partition completed"

Why I chose to step 7 to use only 95% of the disk? Simply because, if I have to replace one of two discs, I'll never have absolute certainty that the new drive has exactly the same number of cylinders etc.. compared to the original disk, even if I buy the same brand and the same cut. I then need to put a gap tolerance is safe from data loss or inconsistencies during the reconstruction of the volumes. Sure, you waste of space that will never be used, but with no records of this size we can well afford.

Now you must repeat the steps above for the second disc (SCSI2) ensuring that we have done exactly the same choices for the first.

Without this, we can configure the software RAID 1. First, create the Multidisk device designed to contain the boot partition:

  1. choose "Configure software RAID"
  2. confirm "Write the changes on the devices ..."
  3. choose "Create a Multidisk Device (MD)"
  4. select "RAID1" as the type of device Multidisk
  5. confirm "2" as the number of active devices for the RAID1 array
  6. confirm "0" as the device number "spare"
  7. only enable / dev/sda1 and / dev/sdb1 as active devices
  8. click "Finish"

Then we create the Multidisk device designed to contain the actual filesystem:

  1. choose "Configure software RAID"
  2. confirm "Write the changes on the devices ..."
  3. choose "Create a Multidisk Device (MD)"
  4. select "RAID1" as the type of device Multidisk
  5. confirm "2" as the number of active devices for the RAID1 array
  6. confirm "0" as the device number "spare"
  7. only enable / dev/sda2 and / dev/sdb2 as active devices
  8. click "Finish"

Now we can move on to creating logical volumes. First I create the volume intended to provide the system swap:

  1. choose "Configure the Logical Volume Manager"
  2. confirm "Write the changes to the disks and ..."
  3. choose "Create volume groups"
  4. write "vg00" as the name of volume group
  5. only enable / dev/md/1 as devices for the new volume group
  6. choose "Create a Logical Volume"
  7. select the volume group "vg00"
  8. write "swap" as the name of the logical volume
  9. write "4GB" as a logical volume size (at least double the RAM)

Then I create the volume for the actual filesystem:

  1. choose "Create a Logical Volume"
  2. select the volume group "vg00"
  3. write "filesys" as the name of the logical volume
  4. confirm the value proposed as the maximum available size of the logical volume
  5. click "Finish"

At this point I can create partitions:

  1. select the No. 1 under "LVM VG vg00 LV filesys"
  2. create the partition normally (choosing "ext3" as the profile and "/" as mount point)
  3. click "Finish"
  4. select the No. 1 under "LVM VG vg00 LV swap"
  5. create the swap partition as normal (selecting "swap area" as a way of use)
  6. confirm "Write the changes to the disks and ..."

Without this, simply proceed with the installation of Debian as usual.

Repliee R-1, the robot child

Nessun commento » Various No Comments »