DIY NAS – Installing OpenMediaVault (OMV) on a Raspberry Pi 3
NOTE: These instructions were made for Raspberry Pi 3. From my experience these will not work on a Raspberry Pi that does not have ARM7.
Have you always wanted your own NAS, but don’t want to spend the money on it? Have an old Pi laying around and don’t know what to do with it? You have many old harddrives laying around and always have to sift trough them to get the correct files?
Install OpenMediaVault, a NAS solution with a heap of services (ssh, ftp, smb, torrent clients, …) and tons of plugins. While a Pi is not designed for running a NAS, it is very well capable of doing so.
NOTE: if you are having trouble, refer to the video that explains all this in more detail.
Let’s stat with a standard installation of raspbian jessie (I choose jessie lite, without desktop environment). Flash it on your SD card as usual. With the new release of jessie, ssh is disabled by default. Put a file called “ssh” (no file-extension) on the FAT32 partition of your SD card (see here for more info).
The boot partition on a Pi should be accessible from any machine with an SD card reader, on Windows, Mac, or Linux. If you want to enable SSH, all you need to do is to put a file called
ssh
in the/boot/
directory. The contents of the file don’t matter: it can contain any text you like, or even nothing at all. When the Pi boots, it looks for this file; if it finds it, it enables SSH and then deletes the file. SSH can still be turned on or off from the Raspberry Pi Configuration application orraspi-config
; this is simply an additional way to turn it on if you can’t easily run either of those applications. – http://raspberrypi.org
Installation
NOTE: during the installation process the ssh access for the user pi will be disabled.
If you log out of your ssh session during the installation you don’t have a way of going back in over ssh. Access will be restored from the OMV GUI.
Now we can start installing OMV. Put the below scripts in 2 different .sh files in the home folder of the pi user (/home/pi). Note that you may need to add execution permission to the scripts – using chmod chmod +x one.sh
1 2 3 4 5 6 7 8 9 10 11 |
cat <<EOF >> /etc/apt/sources.list.d/openmediavault.list deb http://packages.openmediavault.org/public erasmus main # deb http://downloads.sourceforge.net/project/openmediavault/packages erasmus main ## Uncomment the following line to add software from the proposed repository. # deb http://packages.openmediavault.org/public erasmus-proposed main # deb http://downloads.sourceforge.net/project/openmediavault/packages erasmus-proposed main ## This software is not part of OpenMediaVault, but is offered by third-party ## developers as a service to OpenMediaVault users. # deb http://packages.openmediavault.org/public erasmus partner # deb http://downloads.sourceforge.net/project/openmediavault/packages erasmus partner EOF |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
export LANG=C export DEBIAN_FRONTEND=noninteractive export APT_LISTCHANGES_FRONTEND=none apt-get update apt-get upgrade apt-get --allow-unauthenticated install openmediavault-keyring apt-get update apt-get --yes --force-yes --auto-remove --show-upgraded \ --no-install-recommends \ --option Dpkg::Options::="--force-confdef" \ --option DPkg::Options::="--force-confold" \ install postfix openmediavault # Initialize the system and database. dpkg-reconfigure openmediavault omv-initsystem |
This will add the repository to your sources, install some dependencies and initialize OMV. (original source)
Execute it with:
1 2 |
sudo ./one.sh sudo ./two.sh |
NOTE: Script one should NEVER be executed again. This will cause problems in your sources file.
Now you can navigate to the IP address of your pi (ifconfig command)using a browser (no port is required, OMV runs by default on port 80).
Usage
Default login credentials are admin:openmediavault. You can now connect to the gui and experience OMV in all its glory. Format your external drives to a file format for Linux. OMV can handle this the best by default and it will increase your speed drastically. (note that only Linux based computers can read this by default.)
After OMV has picked up your drive, you have to mount the file system. If you are having issues, have OMV format your filesystem by manually unmounting the drive, creating a new filesystem via the GUI and mount it.
Once that is done you are free to create folders, configure them for samba, manage your users and so much more.
OMV-Extras
Enhance your OMV experience using a bunch of plugins. omv-extras is the best library for all of them.
Download the .deb file of OMV-extras. In the plugins section choose upload, and upload your .deb file. Install the openmediavault-omvextrasorg plugin which will allow you to have access to all the plugins you would ever need! (note that you may need to click “check” after installing to ensure the plugins are being picked up).
Conclusion
You now have a PiNAS. A Raspberry Pi running NAS software which allows you to manage your shared folders on your network, manage user access and so much more!
Excellent! Thank you. Worked a treat.
Only issue I had was that I was unable to logon as root via SSH.
If anyone has the same issue, I found the following info useful using a “Scheduled Job” to reset the root password.
https://wiki.openmediavault.org/index.php?title=Change_root_password_in_CLI
Everything works fine except for part of two.sh, it give me this error:
“Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
openmediavault : Depends: php5-fpm but it is not installable
Depends: php5-cgi but it is not installable
Depends: php5-cli (>= 5.6) but it is not installable
Depends: php5-pam but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
dpkg-query: package ‘openmediavault’ is not installed and no information is available
Use dpkg –info (= dpkg-deb –info) to examine archive files,
and dpkg –contents (= dpkg-deb –contents) to list their contents.
/usr/sbin/dpkg-reconfigure: openmediavault is not installed
./two.sh: 15: ./two.sh: omv-initsystem: not found”
when I try ” sudo apt-get install php5-pfm” it gives me: “E: Unable to locate package php5-pfm”
Why does this happen? Can someone please help?
I’ve located the problem line: “sudo apt-get install postfix openmediavault”.
The response is:
“Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
openmediavault : Depends: php5-fpm but it is not installable
Depends: php5-cgi but it is not installable
Depends: php5-cli (>= 5.6) but it is not installable
Depends: php5-pam but it is not going to be installed
E: Unable to correct problems, you have held broken packages.”
Hey
Try running the above on raspbian jessie, not on stretch. The problem is that the packages are not available for the new raspbian version.
Triplus
By far – the best video out on the Internet on getting OMV going on a Raspberry Pi 3 Model B. Only frustrating part is that you have to get get a copy of Raspbian Jessie Lite – as the Triplus pointed out – this does not work on Rasbian Stretch – which I pulled down the current NOOBs2.4 and it didnt work. I went to the following link. I assumed that the 03-03-17 version was used. http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2017-03-03/
Installing now and so far so good. Thanks for the GREAT WORK!!!
So….- I have been going at this for over 2 hours. I downloaded the 2017-03-03 image from the link above. Ran through your entire process everything looked great – until near the end I ended up running out of space on the /root partition. Was using a 32GB card so was like what the heck. Turns out that you need to run ‘sudo raspi-config’ and then expand the storage under the Advanced Options to maximize the amount of space on the /root partition, otherwise there will not be enough space.