Skip to content

Instantly share code, notes, and snippets.

@coin8086
Last active April 8, 2018 02:11
Show Gist options
  • Save coin8086/aa8408ee8a7d61a3a53ac8c70de51766 to your computer and use it in GitHub Desktop.
Save coin8086/aa8408ee8a7d61a3a53ac8c70de51766 to your computer and use it in GitHub Desktop.
Raspberry Pi

Raspberry Pi NAS Server Getting Start

Install Raspbian OS

Get the OS image file(RASPBIAN STRETCH LITE) from https://www.raspberrypi.org/downloads/raspbian/, and write it into a SD card as said by https://www.raspberrypi.org/documentation/installation/installing-images/README.md

Config for Remote Access

A wired network connection is required for headless server installation. And wireless access can be configured as said by https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md

More config options can be found here https://www.raspberrypi.org/documentation/configuration/

Update APT Source

The default source(mirrordirector.raspbian.org) for apt-get is very slow, you need to pick up a nearer one from http://www.raspbian.org/RaspbianMirrors. Update /etc/apt/sources.list as said by https://raspberrypi.stackexchange.com/questions/27479/cannot-connect-to-mirrordirector-raspbian-org/27482#27482?newreg=b684bff77e8642c39ac2b75f0a3a45a2

Backup and Restore

To backup the whole SD card into an image file, refer to https://thepihut.com/blogs/raspberry-pi-tutorials/17789160-backing-up-and-restoring-your-raspberry-pis-sd-card and https://www.raspberrypi.org/magpi/back-up-raspberry-pi/

Basically, it’s like this(on a Mac):

  1. Get the SD card device by diskutil list
  2. Backup it by sudo dd if=/dev/disk2 | zip ~/my-raspbian.img.zip -. It may take some while(10 minutes for 8GB in my case).

To restore, put the image into a SD card just like installing Raspbian OS image on a SD card.

Mount USB Disk

To mount a USB disk, do it as said by https://blog.alexellis.io/attach-usb-storage/ You don’t need to do it manually since OpenMediaVault, the NAS software will do it for us later. It’s here just for how-to.

Check Hardware Info

  • For CPU info: lscpu or cat /proc/cpuinfo
  • For USB info: lsusb
  • For memory: free -m
  • For disks: df -h

Install OpenMediaVault

OpenMediaVault is the NAS software we want. Install it as instructed by https://openmediavault.readthedocs.io/en/latest/installation/on_debian.html

Note: Put an openmediavault image in SD card is not recommended, since the auto setup requires a lot of packages to install, which is by the default slow source of APT aforementioned.

After installation, you need

  1. Make sure the default user pi has the “ssh” group, otherwise it’s disabled in ssh access.
  2. Add disk and mount
  3. Add users optionally
  4. Add share folders
  5. Enable services like SMB, etc.
  6. Add plugins optionally

OMV-Extras

OMV-Extras is a OMV(OpenMediaVault) plugin for more plugins, including the one for Bittorrent, Transmission. Install it by http://omv-extras.org/joomla/index.php/guides. This page list the plugins it includes: http://omv-extras.org/joomla/index.php/omv-plugins-4/4-stable.

Transmission

Transmission can be configured in OMV, but to use it, you need its own Web GUI, which is on the port 9091 of the same host as OMV. However, the Web GUI is disabled by default, you need to enable Transmission’s “RPC” from the OMV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment