OVH Setup server hybrid second disk array

As OVH doesn’t provide a guide to install the second disk array, which is sold optionally, I will publish my solution.

Please be careful, only try these on test configurations and without any disks containing critical data. Some commands can destroy all of your data.

There seems to be soon a solution within the manager – but for now this isn’t working:

Tested on Ubuntu 14.04

Some commands to detect your actual configuration:

    fdisk -l
    lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
    df -h -x devtmpfs -x tmpfs

Delete sdb1/sda1 with parted:

    parted /dev/sdb
    (parted) print
    Model: ATA HGST HUS726040AL (scsi)
    Disk /dev/sdb: 4001GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
 
    Number  Start   End    Size   File system  Name     Flags
     1      1049kB  537MB  536MB               primary  boot
 
    (parted) rm 1
    (parted) quit
 
 
    parted /dev/sda
    (parted) print
    Model: ATA HGST HUS726040AL (scsi)
    Disk /dev/sda: 4001GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
 
    Number  Start   End    Size   File system  Name     Flags
     1      1049kB  537MB  536MB               primary  boot
 
    (parted) rm 1
    (parted) quit

Add new raid partition (needs to be done for sdb and sda):

    # Create raid 1 in live linux system
    parted -a optimal /dev/sdb
    # Place a flag gpt or mbr
    mklabel gpt
    # Create partition
    mkpart primary ext4 0% 100%
    # Mark partition as software raid partition
    set 1 raid on
    # Verify its alligned
    align-check
    optimal
    # Show results
    print
 
    # Create raid 1 in live linux system
    parted -a optimal /dev/sda
    # Place a flag gpt or mbr
    mklabel gpt
    # Create partition
    mkpart primary ext4 0% 100%
    # Mark partition as software raid partition
    set 1 raid on
    # Verify its alligned
    align-check
    optimal
    # Show results
    print

Create new raid configuration (‘level’ can be used for RAID0/1/5 …):

    mdadm --create --verbose /dev/md4 --level=0 --assume-clean --raid-devices=2 /dev/sdb1 /dev/sda1
    cat /proc/mdstat

In case of renaming:

    # Delete all and rescan
    mdadm -Ss
    mdadm --assemble --verbose /dev/md4 /dev/sdb1 /dev/sda1

Update mdadm configuration:

    # NOT NECCESSAIRE MAYBY USEFUL
    # mdadm --monitor --daemonise /dev/md4
 
    # Capture output
    mdadm --detail --scan
    # Something like: 'ARRAY /dev/md4 UUID=7d45838b:7886c766:5802452c:653f8cca'
    # Needs to be added to the end of file:
    /etc/mdadm/mdadm.conf
 
    # Update initramfs (ignore errors):
    update-initramfs -v -u
 
    # Create file system: 
    mkfs.ext4 -F /dev/md4
 
    # Mount fs:
    mount /dev/md4 /opt/
 
    # Update fstab:
    /etc/fstab
    /dev/md4 	/opt	ext4	defaults 	0	1

Could look something like that:

    lsblk
 
    NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
    sdb           8:16   0   3.7T  0 disk
    `-sdb1        8:17   0   3.7T  0 part
      `-md4       9:4    0   7.3T  0 raid0 /opt
    nvme1n1     259:0    0 419.2G  0 disk
    |-nvme1n1p3 259:3    0   5.4G  0 part  [SWAP]
    |-nvme1n1p1 259:1    0   511M  0 part
    `-nvme1n1p2 259:2    0 413.3G  0 part
      `-md2       9:2    0 413.3G  0 raid1 /
    sda           8:0    0   3.7T  0 disk
    `-sda1        8:1    0   3.7T  0 part
      `-md4       9:4    0   7.3T  0 raid0 /opt
    nvme0n1     259:4    0 419.2G  0 disk
    |-nvme0n1p3 259:7    0   5.4G  0 part  [SWAP]
    |-nvme0n1p1 259:5    0   511M  0 part  /boot/efi
    `-nvme0n1p2 259:6    0 413.3G  0 part
      `-md2       9:2    0 413.3G  0 raid1 /

Now you can reboot the server and verify your configuration.

https://doc.ubuntu-fr.org/raid_logiciel
https://www.psylogical.org/node/198
https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu-16-04
https://github.com/etalab/etalab-support/tree/master/procedures
https://docs.ovh.com/fr/dedicated/raid-soft/

Preseed apt_get for unattended_installs

Installation of some packages require user input, which breaks the entire concept of “unattended” installs. Here’s a quick fix to get around that.

First, on a setup computer, install the following:

sudo apt-get install debconf-utils

Now, install whatever packages you wish to later install in an unattended mode. Answer the questions for installation appropriately when prompted. Next we will export those answers into a “seed” file that we can use when installing the package on a new machine. For instance, I’ve installed several ldap authentication packages, so I might want to grab all of the settings those packages ask for.

sudo debconf-get-selections | grep ldap > ldap.seed

If you remember from yesterday, we created an archive that included a setup script and several config files. Place the ldap.seed file inside that archive along with the other scripts, and just before doing the apt-get install add the following line to the add2network.sh file:

debconf-set-selections ./ldap.seed

And there you have it – your apt-get won’t ask for details anymore.

Source: ossramblings

Showerloop

REAL-TIME FILTRATION, PURIFICATION & RECYCLING  SYSTEM FOR SHOWER WATEROPEN SOURCE – OPEN HARDWARE – ECOLOGICAL – ECONOMICALShowers are great, but pouring hot and almost drinkable water down the drain is not. Besides the obvious costs to the environment and your bills, there is also a conscious on unconscious psychological cost any time you create waste. To solve this problem we created Showerloop. It’s a shower that collects, cleans and reuses the water in real time while you are showering. So now you can shower for as long as you like without wasting precious resources.SHOWERLOOP VS NORMAL SHOWERNormal ShowerShowerloop90% reduction in water usage and 70-90% in energy reduction for a 10 minute shower with a flow rate of 10 l/min. Savings are dependant on user behaviour and can vary. Use Just one bucket of water for a shower of any length.  See the savings section for more information.

Source: Showerloop