WildWayz Share Posted June 23, 2018 Hi guys I have a remote dedicated server which has the following drives: 2 x 480GB SSD 2 x 6TB HDD It is with the company Hetzner, so they have a Recovery System which allows you to remotely reload OS. I am using Ubuntu 18.04LTS - but same on 16.04.4 LTS. Anyway, it is using software RAID, and installed the 2 x SSDs as RAID0 and I am wanting to have the 2 x HDDs also as RAID0, different array. Here is what I am doing, with the SSDs already in RAID0: View existing RAID arrays: cat /proc/mdstat Show your drives and mounts: lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT NAME SIZE FSTYPE TYPE MOUNTPOINT sda 447.1G disk ├─sda1 32G linux_raid_member part │ └─md0 64G swap raid0 [SWAP] ├─sda2 512M linux_raid_member part │ └─md1 511.4M ext3 raid1 /boot └─sda3 414.6G linux_raid_member part └─md2 829G ext4 raid0 / sdb 447.1G disk ├─sdb1 32G linux_raid_member part │ └─md0 64G swap raid0 [SWAP] ├─sdb2 512M linux_raid_member part │ └─md1 511.4M ext3 raid1 /boot └─sdb3 414.6G linux_raid_member part └─md2 829G ext4 raid0 / sdc 5.5T disk ├─sdc1 32G linux_raid_member part ├─sdc2 512M linux_raid_member part └─sdc3 414.6G linux_raid_member part sdd 5.5T disk ├─sdd1 32G linux_raid_member part ├─sdd2 512M linux_raid_member part └─sdd3 414.6G linux_raid_member part if md3 exists already do: mdadm --stop /dev/md3 sdc and sdd will need their partitions killing first Remove the RAID configuration from sdc and sdd mdadm --zero-superblock /dev/sdc1 mdadm --zero-superblock /dev/sdc2 mdadm --zero-superblock /dev/sdc3 mdadm --zero-superblock /dev/sdd1 mdadm --zero-superblock /dev/sdd2 mdadm --zero-superblock /dev/sdd3 Will now show: NAME SIZE FSTYPE TYPE MOUNTPOINT sda 447.1G disk ├─sda1 32G linux_raid_member part │ └─md0 64G swap raid0 [SWAP] ├─sda2 512M linux_raid_member part │ └─md1 511.4M ext3 raid1 /boot └─sda3 414.6G linux_raid_member part └─md2 829G ext4 raid0 / sdb 447.1G disk ├─sdb1 32G linux_raid_member part │ └─md0 64G swap raid0 [SWAP] ├─sdb2 512M linux_raid_member part │ └─md1 511.4M ext3 raid1 /boot └─sdb3 414.6G linux_raid_member part └─md2 829G ext4 raid0 / sdc 5.5T disk ├─sdc1 32G part ├─sdc2 512M part └─sdc3 414.6G part sdd 5.5T disk ├─sdd1 32G part ├─sdd2 512M part └─sdd3 414.6G part Remove the left over partitions: fdisk /dev/sdc press d press 3 press d press 2 press d press w Then the 2nd drive fdisk /dev/sdd press d press 3 press d press 2 press d press w Now reboot: reboot Once it has rebooted, it will look like this: moneysings@UniHosting-HELS:~$ lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT NAME SIZE FSTYPE TYPE MOUNTPOINT sda 447.1G disk ├─sda1 32G linux_raid_member part │ └─md0 64G swap raid0 [SWAP] ├─sda2 512M linux_raid_member part │ └─md1 511.4M ext3 raid1 /boot └─sda3 414.6G linux_raid_member part └─md2 829G ext4 raid0 / sdb 447.1G disk ├─sdb1 32G linux_raid_member part │ └─md0 64G swap raid0 [SWAP] ├─sdb2 512M linux_raid_member part │ └─md1 511.4M ext3 raid1 /boot └─sdb3 414.6G linux_raid_member part └─md2 829G ext4 raid0 / sdc 5.5T disk sdd 5.5T disk You will then need to use Parted - enter each one of these seperately: You need to use following options inside parted: parted /dev/sdc mklabel gpt unit TB mkpart primary 0 -1 and then "q" for exit from the parted. parted /dev/sdd mklabel gpt unit TB mkpart primary 0 -1 and then "q" for exit from the parted. Then just create md3 array: mdadm --create /dev/md3 --verbose --level=0 --raid-devices=2 /dev/sdc1 /dev/sdd1 Now you will able to format md3: mkfs.ext4 -m1 /dev/md3 It'll then show as RAID0 :D root@UniHosting-HELS ~ # lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT NAME SIZE FSTYPE TYPE MOUNTPOINT sda 447.1G disk ├─sda1 32G linux_raid_member part │ └─md0 64G swap raid0 [SWAP] ├─sda2 512M linux_raid_member part │ └─md1 511.4M ext3 raid1 /boot └─sda3 414.6G linux_raid_member part └─md2 829G ext4 raid0 / sdb 447.1G disk ├─sdb1 32G linux_raid_member part │ └─md0 64G swap raid0 [SWAP] ├─sdb2 512M linux_raid_member part │ └─md1 511.4M ext3 raid1 /boot └─sdb3 414.6G linux_raid_member part └─md2 829G ext4 raid0 / sdc 5.5T disk └─sdc1 4.6T linux_raid_member part └─md3 9.1T ext4 raid0 sdd 5.5T disk └─sdd1 4.6T linux_raid_member part └─md3 9.1T ext4 raid0 Now, let's mount it as /home mkdir -p /home mount /dev/md3 /home Let's see how it all looks: moneysings@UniHosting-HELS:~$ df -h -x devtmpfs -x tmpfs Filesystem Size Used Avail Use% Mounted on /dev/md2 815G 3.9G 770G 1% / /dev/md1 488M 207M 256M 45% /boot /dev/md3 11T 61M 11T 1% /home Sweeeeeeeeeeeeeet! Save all the work we've done so it maintains it mdadm --detail --scan | tee -a /etc/mdadm/mdadm.conf update-initramfs -u echo '/dev/md3 /home ext4 defaults,nofail,discard 0 0' | tee -a /etc/fstab fstab should look like this: pico /etc/fstab proc /proc proc defaults 0 0 /dev/md/0 none swap sw 0 0 /dev/md/1 /boot ext3 defaults 0 0 /dev/md/2 / ext4 defaults 0 0 /dev/md3 /home ext4 defaults,nofail,discard 0 0 Reboot When I reboot, the system won't come back up. I have to then go into Hetzners OS Installer and re-install the OS again... exactly as before. When it comes up, the system boots up and both RAID arrays are working and all I need to do is mount the 2nd RAID array as /home rm -Rf /home mkdir -p /home mount /dev/md3 /home echo '/dev/md3 /home ext4 defaults,nofail,discard 0 0' | tee -a /etc/fstab then rebooted Now it works perfectly - but what am I doing wrong that I need to re-install the OS to actually get it to work? I'm obviously missing a step. Any help is appreciated Link to post Share on other sites
Mindovermaster Share Posted June 23, 2018 @BudMan, he can help here. Link to post Share on other sites
Ready2018 Share Posted June 24, 2018 Software RAID 0 is never a good idea at the best of times. Not sure why you would want to do this anyway? I'm not sure that any internet connection is going to saturate the speed of the SSD, so having RAID 0 seems pointless and does not allow any redundancy considering it's a dedicated server. Link to post Share on other sites
WildWayz Author Share Posted June 24, 2018 Just now, Ready2018 said: Software RAID 0 is never a good idea at the best of times. Not sure why you would want to do this anyway? I'm not sure that any internet connection is going to saturate the speed of the SSD, so having RAID 0 seems pointless and does not allow any redundancy considering it's a dedicated server. It's a 1Gbit link - purely for storage. Plus RAID0 is faster than Raid 1/5/6 etc Sure, no redundancy - but I can usually re-set up the server in a few hours - probably faster than re-building a RAID array... Link to post Share on other sites
Ready2018 Share Posted June 24, 2018 44 minutes ago, WildWayz said: It's a 1Gbit link - purely for storage. Plus RAID0 is faster than Raid 1/5/6 etc Sure, no redundancy - but I can usually re-set up the server in a few hours - probably faster than re-building a RAID array... As it's only 1Gbit link and purely for storage then it does not warrant RAID0 at all. It's more likely it give you issues (as you've already found out). You don't use RAID for it's quickness in re-building, but for the safety of your data. Goodluck with your server. 1 Share Link to post Share on other sites
Recommended Posts