articles
index
spamassassin
>> config
>> faq
patches
pmmail
Hetzner RAID1
feedback
tell me
Copyright © Per Jessen, 2003-2006.
per@computer.org
Unless otherwise indicated, verbatim
copying and distribution of this entire
article is permitted in any medium,
provided this notice is preserved.

apache Apache/2.2.17 (Linux/SUSE)

How to enable RAID1 on your Hetzner server

I've been renting dedicated servers from Hetzner AG in Nürnberg, Germany for a few years now. Hetzner has, to my experience, always provided exceptional value-for-money - the Hetzner staff are friendly, knowledgeable and helpful. If you're thinking of renting a dedicated server, check out Hetzner.

This article is about installing openSUSE on a RAID1 filesystem on your Hetzner server. It's quite likely that a similar procedure can be used with other distributions, but I've only tried it with openSUSE.

The default Hetzner setup does not include any RAID setup, but given the current default configuration of e.g. a DS3000, it is not overly complicated to set it up for using RAID1.

This is the step-by-step guide to installing openSUSE on a Hetzner server with software RAID. It assumes you are familiar with the various Hetzner facilities, in particular the Hetzner rescue system. It also assumes that you have another server, probably also at Hetzner where you can host your install-server.

  • Activate the rescue system for your server via www.hetzner.de/robot, and reboot it. Can also be done via the web interface.
  • Using fdisk, create a small partition /dev/sda1. It does not need to be very big, 16M is more than plenty.
  • Create a filesystem on /dev/sda1; I used ext2, but I think any filesystem should be fine.
  • Mount /dev/sda1 on e.g. /mnt.
  • Create directories: "mkdir /mnt/boot /mnt/etc /mnt/dev /mnt/proc"
  • Retrieve the installation system kernel and initrd from the install-server:
    wget http://<yourinstallserver>/opensuse102/x86_64/boot/x86_64/loader/linux
    wget http://<yourinstallserver>/opensuse102/x86_64/boot/x86_64/loader/initrd
    
  • move linux and initrd into /mnt/boot
  • Create /mnt/etc/lilo.conf with the following contents:
    lba32
    compact
    change-rules
    reset
    read-only
    boot = /dev/sda
    
    image = /boot/linux
        label = install
        append = "usessh=1 sshpassword=<yourpassword> hostip=<server-ip> netmask=<netmask> gateway=<gateway>
        nameserver=<nameserver> install=http://<yourinstallserver>/opensuse102/x86_64"
        vga = normal
        initrd = /boot/initrd
        root = /dev/sda1
    
  • In the above, you'll need the IP-address of your server (which you'll have ready anyway), the netmask (typically 255.255.255.224), the default gateway and the name-server. You can get these from the running rescue-system.
  • Now we need to provide access to /dev and /proc: mount --bind /dev /mnt/dev, mount --bind /proc /mnt/proc
  • Run lilo: "lilo -r /mnt"
  • Reboot and you're ready to install openSUSE, where it is straight forward to create a couple of RAID1 arrays (for swap and root) to install onto.

There is no reason why the procedure should not work (with appropriate modifications) with one of the standard Hetzner system images, but I have not investigated it in any detail. Maybe one of these days in my copious sparetime ...

Booting: to get the full use of the RAID1 redundancy created, you also need to be able to boot off the array. This requires a minor modification to /etc/lilo.conf:

  • Correct the boot= statement to read "boot = /dev/mdN"
  • Add "raid-extra-boot = mbr-only"

The install-server

This is also not very difficult.

  • Configure apache to serve <yourinstallserver> from some directory.
  • Retrieve the ISO DVD image of e.g. 10.2 or 10.3 (currently available in RC1, but careful, lilo doesn't work).
  • Put it in the directory from above, then create a mount-point - in the example above, I've used "opensuse102/x86_64".
  • Mount the ISO-image using a loop-device: mount -o ro,loop <iso> <mount point>
  • Done.

Of course you could choose to install over NFS or FTP, but I found using HTTP with apache was the easiest.

I already have an active install server at Hetzner. I've got openSUSE 10.2 and 10.3RC1 available - if you wish to use one of these, send me an email listing the IP-addresses you need access from, and I'll set it up for you.

td#changed2 { font-size: 80%; font-style: italic; border-style: solid none none none; border-width: 1px; vertical-align: top; } table#changed1 { clear: both; width: 100%; }