PDA

View Full Version : How to setup raid for more/several disks on Hetzner InstallImage



Fli
05-23-2014, 03:15 PM
Im amateur and i ran into problems but it got solved. And i will tell how there. I had these 3 disks:


Disk /dev/sda: 120 GB (=> 111 GiB)
Disk /dev/sdb: 120 GB (=> 111 GiB)
Disk /dev/sdc: 750 GB (=> 698 GiB)

Total capacity 922 GiB with 3 Disks

2 SSD and one big SATA. SO i wanted to use raid only on 2 SSDs and SATA use as a backup space or something. So how to do it?

One get Hetzner server and after SSH login one is in Rescue mode.
Then do command:

installimage

select operating system of choice and then one is in configuration file editting.

There one comment out disk that should be excluded from RAID.

Example:

#Onboard: Corsair CSSD-F120GB2
DRIVE1 /dev/sda

#Onboard: Corsair CSSD-F120GB2
DRIVE2 /dev/sdb

#Onboard: SAMSUNG HD753LJ
#DRIVE3 /dev/sdc

SWRAID 1

SWRAIDLEVEL 1
(that should mean that software raid will be used for DRIVE1 and DRIVE2 and RAID level will be 1 (while i have two 120GB disks, in system i will see 120gb "virtual" drive. The Raid1 is that data is mirrored, so are on two places/disks and if one disk fail, there should not be data loss.)

One can also set hostname

After hit F10 key or click the F10 button and save config. the installation begins. Once completed in like 5 minutes, one do "
reboot" command.

After reboot, root password is same like one used to access server in Rescue mode.

If one have "REMOTE HOST IDENTIFICATION HAS CHANGED!" issue accessing newly installed server, here is how to overcome that (http://internetlifeforum.com/linux-forums/1961-fix-remote-host-identification-has-changed/). If not, its ok.

After loged in into newly installed server, one can do "
df -h" commands to see mounted disk filesystems.

IF it appears disks missing, one might need to "add disk/s to fstab (https://wiki.archlinux.org/index.php/fstab) or mount it manually via mount command".

this can show filesystems on drive: parted /dev/sda print all
this can show disk device partitions: fdisk -l
this can show fstab content: cat /etc/fstab
this can show disk devices: ls -l /dev | grep sd

Following is not veriffied, try at your risk:

So if some device (/dev/sd*) is not visible in command "df -h", and i see it is in /dev by doing command "ls -l /dev | grep sd", it might be possible to mount it.

Example /dev/sdb1 is not outputted by "df -h" and by command "parted /dev/sda print all" i see it has ext3 filesystem, i try to mount it like this:

create folder for new device like:


mkdir /disk2
mount -t ext3 /dev/sdb1 /disk2

then add it to the fstab to make it mount at boot:


/dev/sdb1 /disk2 ext3 defaults,errors=remount-ro 0 1

(sdb1 is name of the disk that is not mounted and not visible under df -h; ext3 is filesystem of that disk that we got from command )