INSTALLING DEBIAN 6.01 ON A SOFTWARE RAID1 VOLUME
 

Installing Debian to RAID1

Using Debian 6.0.1a AMD64 DVD-1 Installation Disk

Required:

-Debian 6.0.1a AMD64 DVD
-1 Installation Disk
-2x Identical Installation Drives (2x500GB in this example) Pre-formatted as Free Space

Initial Set-Up:
-Debian 6.0.1a AMD64 Installation DVD and boot server.

Installer Boot Menu
-Choose Graphical Install (Wait a 30 seconds as installer launches)

Language:
-Select your language

Location:
-Select your location

Keyboard:
-Select your keymap

Network:
-Primary Network Interface: Select the ethernet port connected to your Internet connection
-Hostname: Enter the network name for your server (i.e. debian-svr).
-Domain Name: Enter the domain your server will reside on (i.e. example.com)

Users and Passwords:
-Root Password: Enter the root password you’d like to use and verify it.
-Full Name for New User: Enter the display name for your first user (i.e. Administrator).
-Username for your Account: Enter the shortname (no caps, no spaces) name for your first user (i.e. administrator).
-Choose a password for the new user: Enter the password for your first user.

Clock:
-Select your time zone

Partition Disks:
-Partition Disks: Choose Manual.

You should now see the two disks you use to create a RAID1 boot volume: SDA and SDB

SCSI1 (0,1,0) sda
–pri/log [size]GB   FREE SPACE

SCSI1 (0,0,0) sdb
–pri/log [size]GB   FREE SPACE

Create Partions for SDA:
-Select the FREE SPACE partition on “sda”.
-Select “Automatically partition the free space”.
-Select “All files in one partition”.

This will create Primary and Swap partitions on your sda drive.

-Select the Primary partition, enter.
-Select Use As, enter. Select “Physical Volume for RAID”.
-Select Bootable Flag, enter. This will set the partition as Bootable.
-Select “Done setting up the partition”
-Select the Swap partition, enter.
-Select Use As, enter. Select “Physical Volume for RAID”, enter.
-Leave the bootable flag at OFF
-Select “Done setting up the partition”

Create Partions for SDB:
-Select the FREE SPACE partition on “sdb”.
-Select “Automatically partition the free space”.
-Select “All files in one partition”.

This will create Primary and Swap partitions on your sdb drive.

-Select the Primary partition, enter.
-Select Use As, enter. Select “Physical Volume for RAID”.
-Select Bootable Flag, enter. This will set the partition as Bootable.
-Select “Done setting up the partition”
-Select the Swap partition, enter.
-Select Use As, enter. Select “Physical Volume for RAID”, enter.
-Leave the bootable flag at OFF
-Select “Done setting up the partition”

You should now have a set of identical drives each with primary and logical partitions that look like this:

SCSI1 (0,1,0) sda
#1 primary    [size]GB B K raid
#5 logical      [size]GB    K raid

SCSI1 (0,0,0) sdb
#1 primary    [size]GB B K raid
#5 logical      [size]GB    K raid

Create RAID1 (Primary “Filesystem” Partition)
-Select “Configure Software RAID”.
-Write Changes to Storage Devices and configure RAID?:  YES
-Select “Create MD device”.
-Software RAID Type: Select RAID1.
-Number of active devices for RAID1: 2, Continue.
-Number of spare devices for RAID1:  0, Continue.

Active Devices for RAID1 Array:  Use Up and Down Arrow to highlight the partition, then use Spacebar to Select it.

-Select /dev/sda1
-Select /dev/sdb1
Click Continue.

Your Primary file system partitions are now ready to be formatted as RAID1.

Create RAID1 (Logical “Swap” Partition)

-Select “Configure Software RAID”.
-Write Changes to Storage Devices and configure RAID?:  YES
-Select “Create MD device”.
-Software RAID Type: Select RAID1.
-Number of active devices for RAID1: 2, Continue.
-Number of spare devices for RAID1:  0, Continue.

Active Devices for RAID1 Array:

Use Up and Down Arrow to highlight the partition, then use Spacebar to Select it.

-Select /dev/sda2
-Select /dev/sdb2

Click Continue.

Your Logical swap partitions are now ready to be formatted as RAID1.

NOTE: If for some reason, all of the partitions you create earlier are not available in the Active Devices selection window, delete the RAID1 set you’ve created so far, and use Go Back to get to the Partition Disks screen.  Select, double-check, and save each partition over again.  So, even if you were correct, and don’t have to change anything, recommitting the settings should make all of the partitions visible in the Active Devices window.

Once you’ve created your primary and logical RAID1 sets, Select Finish, and Continue.

This will take you back to the Partition Disks overview screen which should now look like this:

RAID1 device

#0 – [size]GB Software RAID device
#1                             [size]GB
–                                [size]kB        unuseable
RAID1 device #1 – [size]GB Software RAID device
#1                             [size]GB
–                                [size]kB        unuseable

SCSI1 (0,1,0) sda
#1 primary              [size]GB B K raid
#5 logical                [size]GB     K raid

SCSI1 (0,0,0) sdb
#1 primary              [size]GB B K raid
#5 logical                [size]GB     K raid

Assign root (/) partion:
Select partition #1 of “RAID1 device #0”, Enter.

Use As: Ext4 Journal File System
Mount Point: / – the root file system
(leave other settings at their defaults)
Select: Done setting up the partition.

Assign swap partion:
Select partition #1 of “RAID1 device #1”, Enter.
Use As: swap area
Select: Done setting up the partition.

Scroll to the very bottom of the Partition Disks screen:

Select: “Finish partitioning and write changes to disk”.
Write Changes to disk?: YES, Continue.

Boot Volume Created
You should now have a formatted RAID1 boot volume with a large Primary Filesystem partition for your OS, and a smaller Logical Swap partition for your swap space (virtual memory).

Configure the package manager
Once the formatting of the partitions is complete, answer questions regarding the software sources for Debian packages during install:

Scan Another CD or DVD?: If you have additional Debian DVDs (Disc 2, Disc 2, etc) insert it now and select YES, so the available packages can be scanned.  If not, click NO, and continue.

Use a Network Mirror: This will make additional packages available during installation, but can increase installation time. If unsure, select NO.

Participate in Package Useage Survey: Select YES or NO.

Choose Software to Install
Select…
-Graphical Desktop Environment
-DNS Server
-File Server
-SSH Server
-Standard System Utilities

Installation
The Debian Installation will begin.  Packages will be retrieved and installed based on your choices.  If you have selected a number of items that need to be downloaded first, the installation will take longer to complete.

Samba Server
Workgroup/ Domain Name: Specify a workgroup name.  If unsure, use WORKGROUP.

Install GRUB
Install the GRUB Bootloader to the master boot record: YES
This will install GRUB to one of the drives that make up your RAID1 Boot Volume.
Once the GRUB installation is complete, your installation DVD should eject automatically, and your server will reboot.

To provide true redundancy, you now need to install the GRUB bootloader on both drives so that your server can boot from either, should one drive fail.

Add GRUB to both drives in your RAID1 Volume

-After restart has finished, login to your server.
-Re-insert your Debian 6.0.1a Installation DVD, which we’ll use as a source for the GRUB installer.
-Open Terminal (Applications > Accessories > Terminal)
-Login as Root.

su –
[enter password]

-Get the GRUB components (make sure the Debian Install DVD is inserted again)
apt-get install grub

-Follow any in-Terminal instructions.
-Install GRUB to both drives in your RAID1 volume

grub-install /dev/sda
grub-install /dev/sdb

If successful, you will see: Installation finished.  No error reported.

Eject your installation DVD.

Installation Complete
And you’re done.  Once GRUB is installed on both boot drives, you’ll have a working, RAID1-protected Debian 6 server.

Sources:

https://help.ubuntu.com/10.04/serverguide/C/advanced-installation.html

http://www.texsoft.it/index.php?c=hardware&m=hw.storage.boot-raid-squeeze&l=it