Setting up storage/media server on RPi.
NextCloud suite is quite appropriate for this purpose. With symlinks we can link a big drive to the smaller data flash drive.
To do:
NextCloud storage
Ampache (link) is a music streaming server and a protocol.
NextCloud Music app (github link, store link) can be used serverside. It can read the music collection from a configurable location and serve it through Ampache API. To access, generate an API key in the NextCloud settings.
It also can serve as a web-based music player.
Audio Player can be used to play music via the web.
Power Ampache is an Android app that understands the Ampache protocol. It can cache music offline.
Set up Samba access for Windows machines on the local network.
NextCloud can be used as the main host for the files.
There are two music apps for NextCloud, allowing the creation of playlists, caching of songs, etc.
Links
Allow access from Windows machines on the network. Install samba
sudo apt-get install samba samba-common-bin
Set the drive to power off after certain period of inactivity.
Install NTFS support if sharing drive(s) with Windows:
sudo apt-get install ntfs-3g
Create a mount point and set up fstab with the drive id and mount information.
Sleep
Power down the HDD when not in use. Install "hdparm" package. Check if drive is spinning with
hdparm -C /dev/hdX
Drive can be put to sleep manually immediately with
hdparm -y /dev/sdX
Set the spindown parameters with "sudo hdparm -B127 /dev/sdX
" or edit "/etc/hdparm.conf" for permanent configuration. Configure the drive by UUID.
Eventually, set the drive to power down right after boot by creating "/etc/systemd/system/hdparm.service" end enabling it by "systemctl enable hdparm
". See "Putting a drive to sleep directly after boot" in hdparm page below, and "Enabling systemd service".
Reboot the system after configuration.
Links