Documente Academic
Documente Profesional
Documente Cultură
Revision History
9/09/16
JG
Table of Contents
1. Hardware ............................................................................................................... 2
2. Copy Debian 8 on a micro SD card and initial setup ............................................ 3
2.1. Download image ......................................................................................... 3
2.2. Copy image on SD-card ............................................................................. 3
2.3. Login ........................................................................................................... 4
2.4. Console stuff ............................................................................................... 4
3. Install OpenMediaVault ......................................................................................... 4
3.1. Login in ....................................................................................................... 5
3.2. Install plugins (optional) .............................................................................. 6
3.3. Enable ssl/tls connections (https:) ........................................................... 6
3.4. Change passwords ..................................................................................... 6
4. Migrate a single disk to encrypted Raid1 ............................................................. 7
4.1. Prepare empty degraded Raid 1 with one disk ........................................... 7
4.2. Copy data onto the new disk ...................................................................... 9
5. Start and stop the system .................................................................................. 12
5.1. Stop ........................................................................................................... 12
5.2. Start ..........................................................................................................
5.3. Sample startscript .....................................................................................
5.4. Troubleshooting ........................................................................................
6. Install a DNLA/UPnP media server ....................................................................
6.1. NAS configuration .....................................................................................
6.2. Firewall on NAS ........................................................................................
6.3. Set up a video/music player client ............................................................
7. References ..........................................................................................................
12
13
13
16
16
17
17
18
This note explains how to set up a cheap Raid 1 NAS with an Odroid or Rasbperry
board and two USB-harddisks using OpenMediaVault. Only very cheap and largely
1. Hardware
1
Any Rasbperry like development board will do as long as Armbian supports it. I prefer
Odroid-C2 over Rasbperry 3 because of the better performance, larger memory (2GB)
and Gigabit-Ethernet. As neither Odroid-C2 nor Rasbperry-3 have USB3 ports cheap
USB2 hard-disks will do perfectly.
For optimal speed it is recommended to use the separated USB host port for the
second HDD via USB OTG host port on C2.
http://www.armbian.com/documentation/
4
http://mirror.igorpecovnik.com/Armbian_5.14_Odroidc2_Debian_jessie_3.14.71.7z
5
http://www.armbian.com/odroid-c2/
2.3. Login
Login as root on console or via SSH and use password 1234. Change default password.
I will call it "naspassword" later.
apt-get update
apt-get upgrade
dpkg-reconfigure tzdata
apt-get install mc aptitude cryptsetup keyboard-configuration
dpkg-reconfigure keyboard-configuration
service keyboard-setup restart
update-initramfs -u
3. Install OpenMediaVault
7
3. Install
> apt-get update
> aptitude install openmediavault openmediavault-keyring
> omv-initsystem
5. Reboot
> reboot
3.1. Login in
web interface
> firefox https://bucketnas.lan # <- replace with your NAS ip here
username = root
password = naspassword
openmediavault web-gui -> general settings -> Web administration -> secure
connection
2. Root password
> slogin -l root bucketnas.lan # <- replace with your NAS ip here
5. Create filesystem
2. Copy
> cd /mnt/from
> cp -vur * /mnt/raid1
Figure 2. Copying
3. Unmount
Mount the Raid via the Web-GUI. It will leave an entry in /etc/fstab . From
now on the filesystem should be mounted automatically as soon as you decrypt.
11
10
As you can see on the following screenshot the synchronisation of 1.36 TB takes
19h and the speed is approx. 20MB/sec which is a very good value for writing USB
2 disks.
11
Encryption does not have any impact on the speed with our chosen hardware.
5.2. Start
1. Assemble raid, decrypt and mount
Login as root:
> mdadm -A --scan
mdadm: /dev/md1 has been started with 2 drives.
> cryptsetup open --type luks /dev/md1 md1-crypt
Enter passphrase for /dev/md1
>
you will be asked your encryption password and the disk should mount
automatically under /media/. . If not then open it once via Web-GUI it will leave
12
an entry in /etc/fstab
. Next time it should be automatic.
12
12
5.4. Troubleshooting
Logical volume is not available
Problem
One Raid member device is a logical volume and it is not available.
> lvdisplay
--- Logical volume --LV Path
/dev/vg-sdb1-sdc1/lv-combined
LV Name
lv-combined
(rw,noexec,relatime,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group)
(your UUID is different).
13
vg-sdb1-sdc1
LV Write Access
read/write
LV Status
NOT available
LV Size
Current LE
Segments
Allocation
Read ahead sectors
2.73 TiB
715347
2
inherit
auto
available
# open
LV Size
Current LE
Segments
Allocation
Read ahead sectors
- currently set to
Block device
0
2.73 TiB
715347
2
inherit
auto
256
252:0
14
:
:
:
:
:
a92b4efc
1.2
0x1
8 sectors
before=262056 sectors, after=8 sectors
State : clean
Internal Bitmap : 8 sectors from superblock
Update Time : Tue Aug 16 23:00:46 2016
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 8c9eaaac - correct
Events : 64898
2. Stop Raid.
> mdadm -S /dev/md1
mdadm: stopped /dev/md1
15
Devices
Devices
Devices
Devices
Events
Number
:
:
:
:
:
2
2
0
0
64905
Major
Minor
RaidDevice State
252
active sync
/dev/dm-0
active sync
/dev/sda1
Do not change the default settings, just define some shares on the tab
OpenMediaVault -> Services -> DNLA -> Shares
16
13
Debian
I recommend the vlc media-player.
vlc -> local network -> Universal Plug'n'Play ->
It may take a minute until_MiniDNLA_ appears in the main window. Please be patient.
Firewall configuration
A simple firewall configuration tool is gufw .
13
http://forums.openmediavault.org/index.php/Thread/6411-Help-setting-up-firewall-iptables/
17
Action
From
8200/tcp
ALLOW
Anywhere
1900/udp
ALLOW
Anywhere
8200/tcp
ALLOW
Anywhere (v6)
1900/udp
ALLOW
Anywhere (v6)
7. References
Migration Raid 1 to Raid 5 howto
Prepare disks fr Raid
14
15
14
https://wiki.archlinux.org/index.php/Convert_a_single_drive_system_to_RAID
15
https://wiki.archlinux.org/index.php/RAID
18