OMV – OpenMediaVault – Tricks

Table of Contents

#mdadm #btrfs #ext4 #omv #openmediavault #raid5 #scrub #ssh #bash #shell

Thanks to Volker and Ryecoaaron from OpenMediaVault https://www.openmediavault.org/

How to find ip (3 solutions)

				
					ifconfig
ip a
ip addr
				
			

 
 

 

 


How to find your raid’s name

 

# cd /dev/
# ls

The name is md127, sometimes it’s md0, or a other one.

To reappear

To reappear the raid when it simply disappear:

# mdadm -S /dev/md0
# mdadm --assemble /dev/md0 /dev/sd[bcdef] --verbose --force

To Force a check or to rebuild (degraded array)

To force a check of the entire array while it’s online. Or to start a rebuild (recovering) when the raid is degraded.
Run as root :

# echo check > /sys/block/md0/md/sync_action

To check the Status

# mdadm -D /dev/md0

 

 

Smart Error?

 

Pour trouver le disk suivant son id (suite à un disque défectueux)

# ls -la /dev/disk/by-id

Et pour lancer un scan complet du disk : smartctl -t long /dev/sdxC

CPU speed ?

 

Pour voir la vitesse actuelle du processeur

# cat /proc/cpuinfo | grep “MHz”
ou
# lscpu | grep MHz

And if you have a error like: Impossible to mount file system : Structure needs cleaning

more precisely

Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; mount -v --source '/dev/disk/by-id/md-name-openmediavault:raid9disks' 2>&1' with exit code '32': mount: mount /dev/md0 on /srv/dev-disk-by-id-md-name-openmediavault-raid9disks failed: Structure needs cleaning

You must do this

# fsck /dev/md0

And, if needed, fix all errors. After that you can mount the file system.

If not try this

# fsck.ext4 -f /dev/disk/by-id/md-name-openmediavault:raid9disks
# mount -a

Synology (false raid) !

If you use, in OMV, disks from a Synology NAS, you ‘ll get problem when you create the raid. Example here to create a raid 5 with 3 disks (12To each of them)

So the solution is format, each disk, with the dd command

# dd if=/dev/zero of=/dev/sdb
# dd if=/dev/zero of=/dev/sdc
# dd if=/dev/zero of=/dev/sdd

After that you can create raid 5 without any problem.

Replace disk (remove / install)

You can do all this is the GUI. Raid Management -> select your raid -> select delete on the toolbar -> popup should appear displaying the 2 drives -> select the drive to remove -> click ok, the drive has now been removed from the array, you can remove the drive from the machine

Install the new drive. Storage Disks -> select the newly inserted drive, select wipe on the toolbar, short wipe should be enough

Wipe complete

Storage File Systems

Format the new drive with the same filesystem as the one you are keeping -> EXT4

Once Format has finished > Raid Management -> Recover on the toolbar -> popup box should appear -> select the new drive -> click ok

The raid should now be resyncing/rebuilding with the new drive

resize file system (btrfs - omv default)

So hard to find the correct information.

Add new disk to a raid and you can’t a change in the filesystem. So uyou must grow up your file system with the right command.

df -h

You can see the size of the raid5 which is 26T, but we have 4 disks of 14To, so the raid must be 39To…

df-at

You can see the filesystem, here is this BTRFS (default in Open Media Vault)

And copy the uuid of the raid.

 

sudo btrfs filesystem resize max /srv/dev-disk-by-uuid-daef2abf-dfa3-421b-ab23-e2e580b2e45b
Resize '/srv/dev-disk-by-uuid-daef2abf-dfa3-421b-ab23-e2e580b2e45b' of 'max'
Increase the size of the btrfs file system to the maximum. And put the uuid of the raid at the end of the command.
 
Et voilà
df -h
 
 

Install to Raspbian (Helios 4 / Helios 64)

				
					# wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/preinstall | sudo bash
# shutdown -r 0
# wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash



				
			

Add OMV Extras PlugIns

				
					sudo wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash
				
			

Archives OS (Helios 4 / Helios 64)

You can find the last and old . isos here:
https://armbian.hosthatch.com/archive/helios64/archive/

Scrub error

Sometimes you’ll receive this type of error:

				
					Errors were detected on the Btrfs file system with UUID 52ebb5b9-f475-4759-b4c4-3b8ca97245fa.

[/dev/md0].write_io_errs    0
[/dev/md0].read_io_errs     0
[/dev/md0].flush_io_errs    0
[/dev/md0].corruption_errs  243
[/dev/md0].generation_errs  0
				
			

The first thing to do is to “scrub” all your btrfs volume, and check the status. If you have “Error summary = no errors found” everything is fine. Note that the process is quite slow.

				
					#btrfs scrub start /dev/md0
#btrfs scrub status /dev/md0
UUID:             52ebb5b9-f475-4759-b4c4-3b8ca97245fa
Scrub started:    Mon Sep 25 18:22:30 2023
Status:           running
Duration:         0:12:56
Time left:        94:46:03
ETA:              Fri Sep 29 17:21:31 2023
Total to scrub:   42.19TiB
Bytes scrubbed:   98.05GiB  (0.23%)
Rate:             129.39MiB/s
Error summary:    no errors found

				
			

Fix the shell. Completion, history and prompt doesn't work

when you are connected to the shell using ssh some problems may appear

Wif you encounter problems in bash. History doesn’t work. Auto complementation also doesn’t work. To fix this you need to change bash.
Go to Users > Users. Select the user and click on Modify.

You’ll the bash for the shell. It must be /bin/bash

Log out of ssh and log in again. Magic! It works!

 
 

 

 

clean, resyncing (PENDING)

If your raid show : clean, resyncing (PENDING)

Just do this:

				
					sudo mdadm --readwrite /dev/md0
				
			

OMV 7 - How to see disk array

In OpenMediaVault 7, you must install a plugin to see your disk array.

It is the Linux MD (Multiple device) devices.

 

Notifications problems

The mdadm notification config entry is missing somehow.

Run the following command to fix it and to restart all necessary processes.

 
 

 

 

				
					sudo omv-confdbadm read --defaults "conf.system.notification.notification" | jq ".id = \"mdadm\"" | omv-confdbadm update "conf.system.notification.notification" -
sudo monit restart omv-engined