Update: Boot from USB with HP Microserver Gen8 and OpenMediaVault

Only usable if you use OMV with HP Microserver Gen8 where you cannot boot from a ODD disk (connector) and inserted HDDs in RAID)
Today, a day before my holiday (murphys law). I noticed that suddenly a samba share was not responsive anymore and that OMV was running in read-only mode.

A quick scan showed first a 2,5″ HDD failure (the disk where OMV is on) and a second scan showed that the USB flash drive with grub (this starts OMV) was not accessible anymore.  (probably caused due too high temperatures last week).

The RAID installation with 4 HDDs was expected to be ok.

So I grabbed a new flash drive, and a new 2,5″ 500GB disk (I had those laying around especially for this purpose). a bootable SD card with OMV 4 was also present

Steps:
1. change the 2,5″ disk (remove the failed one and connect the new disk)
2. insert the SD card, boot and OMV splash screen should be shown, install OMV on the 2,5″
3. After reboot insert the USB flash drive after OMV is booted
4. my USB drive is /dev/sdb
5. clean the flash drive
dd if=/dev/zero of=/dev/sdb bs=512 count=1
6. fdisk the flash drive as a bootable linux drive:
I believe the sequence as:
fdisk /dev/sdb
> n
> p
> 1
<enter this>
> a
(toggles boot flag)
>w
write this 

7. format the drive: mkfs.ext3 /dev/sdb1 (please notice the 1 !!, not using this issues with grub !! (Message to self)
8. mount the drive with mount /dev/sdb1 /mnt
9. grub-install –no-floppy –root-directory=/mnt /dev/sdb
Please notice that it is used: dash dash no-floppy dash dash root-directory
10. grub-mkconfig -o /mnt/boot/grub/grub.cfg

Message to self: if there is any issue reported in the screen about ext2, or about blocks .. no correct installation and usage of grub and your system will not boot

 

 

Backup MIAB (Mail in a Box) through Rsync towards Openmediavault Server

Mail in a box (MIAB) has a backup feature available. It stores full and incremential backups on the mailserver and it is possible to store the backup also on another device through RSYNC. In my situation I am saving the data to an OpenMediaVault NAS

Here I write my own: How I did it (quick and dirty cause I expect you to know things).

In short:
rsync over port 5678 to backup your data to the OpenMediaVault NAS

  1. Make sure you have a hostname available where rsync can be connected to, the hostname must point to the IP where the OMV (OpenMediaVault) is connected
  2. Rsync over SSH is being used.
  3. if you do not want to use port 22 with Rsync, you need to modify /root/mailinabox/management/backup.py line 19: change -p 22 to -p 5678
  4. Enable Rsync Server in the GUI (Grapical User Interface) of openmediavault.

Please note that it is not possible to use the ~/.ssh/config file where you can add the port as well. The reason is that the verification process needs in the backup.py a -p setting which is not overridden bij de config file.

  • SSH standard port 22, this we will change. (ie. port 22 is already in use towards another server)
  • In the router go to your portforwarding section and open port 5678 towards port 22 to your device (with OpenMediaVault).
  • MIAB and RSYNC needs to have the full path where to store the backup. In my situation: /media/a925efd7-ada5-48b5-80e6-383cc6274bcd/Backup (the folder must available and writable
  • Make sure that a user can login with SSH and can access OpenMediaVault
  • MIAB is providing a public key for auto-login needed for rsync. this key must be available in OpenMediavault. You can put the public key in: ~/.ssh/authorized_keys or in a folder in /var/lib/openmediavault/ssh/authorized_keys where you create a file with the name of the user
  • within MIAB you can use from /root/mailinabox/ the following: sudo management/backup.py –verif

to test if your public key is accepted: from MAIB ssh with the following command:  ssh -p 5678 -i /root/.ssh/id_rsa_miab user@domain.name

If this is giving you a direct login to your OpenMediaVault NAS you can use Rsync ;)

Missing something? Reply and ask