In this post i will show you what steps  I followed to adapt RAID1 on an existing installation of Debian Squeeze.

Step1. Make sure you have the following packages are installed:

apt-get update && apt-get upgrade
apt-get install mdadm rsync initramfs-tools grub-pc

Step2.  Partitioning the new drive:

First connect the new drive (/dev/sdb) and boot into your sistem.
Then use fdisk to display the partition informations for the existing drive (/dev/sda).

root@srv:~# fdisk -l /dev/sda

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007384e

Device Boot Start End Blocks Id System
/dev/sda1 * 1 9330 74936320 83 Linux
/dev/sda2 9330 9730 3212289 5 Extended
/dev/sda5 9330 9730 3212288 82 Linux swap / Solaris

Now create partitions of the same size on the new drive.

NOTE:If the new drive is bigger leave the rest of the drive unpartitioned.

Step3. Create new degraded RAID1 arrays:

Continue Reading…

Fixing an unbootable computer after a failed grub installation can be a bit tricky.
Here’s what I ended up doing.

First of all, boot the machine up and get access to the root partition:

Step 1. Get a Debian installation CD for the same architecture
The distro version doesn’t matter too much: a lenny CD will boot squeeze just fine.

Step 2.Boot the install CD and select Rescue mode under Advanced options.

Step 3. Answer the language, keyboard and network questions any way you want and provide the decryption passphrases for any of the encrypted partitions you need to mount.

Step 4.When prompted, request a shell on the root partition:
If you need to upgrade the version of the grub package

a) Make sure that the network interface is up (ifup eth0).
b) Make sure that /etc/resolv.conf has at least one nameserver line, otherwise add one.
c) Install the latest version using apt-get or dpkg.

Step 5.Now that you have the right grub version, run the following


grub-install /dev/hda


Step 6.Finally, reboot.


Page 1 of 11