########################################################################################## PIDVR-8: Configure recordings directory ########################################################################################## Issue Type: Sub-task ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Done (2014-11-08 14:23:23) Project: PiDVR (PIDVR) Reported By: btasker Assigned To: btasker Child of: PIDVR-6 - Install and Configure TVHeadEnd Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== Setup the USB stick as the recordings directory (contingent on actually receiving the drive first) and ensure it automounts at boot. ----------------------------------------------------------------------------------------- Issue Relations ================ - blocks PIDVR-9: HTTP Egress ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2014-11-06 23:09:12 btasker ----------------------------------------------------------------------------------------- Once the stick has been received, will configure it to mount at _/mnt/recording\_cache_ ----------------------------------------------------------------------------------------- 2014-11-06 23:14:08 btasker ----------------------------------------------------------------------------------------- In the meantime, creating the directory and configuring TVHeadEnd to use it -- BEGIN SNIPPET -- root@testpi:/home/pi# mkdir /mnt/recording_cache root@testpi:/home/pi# chmod 774 /mnt/recording_cache/ root@testpi:/home/pi# chgrp video /mnt/recording_cache/ -- END SNIPPET -- In the TvHeadEnd Web UI - Configuration -> Recording - Recording System path: _/mnt/recording\_cache_ - Container: Matroska - Include Episode in filename - Remove all unsafe characters from filename - Replace whitespace in title with '-' - Tag files with metadata - Skip commercials ----------------------------------------------------------------------------------------- 2014-11-08 13:50:55 btasker ----------------------------------------------------------------------------------------- Grabbing the UUID for fstab the lazy way -- BEGIN SNIPPET -- pi@testpi ~ $ ls /dev/disk/by-uuid/ 3d81d9e2-7d1b-4015-8c2c-29ec0875f762 787C-2FD4 -- END SNIPPET -- Want the recording directory to be ext4, so -- BEGIN SNIPPET -- root@testpi:/home/pi# mkfs.ext4 /dev/sda1 root@testpi:/home/pi# ls /dev/disk/by-uuid/ 3d81d9e2-7d1b-4015-8c2c-29ec0875f762 787C-2FD4 8a4c7e0f-c379-4e2e-a7f2-15f47cd4dd94 root@testpi:/home/pi# mount /dev/disk/by-uuid/8a4c7e0f-c379-4e2e-a7f2-15f47cd4dd94 /mnt/recording_cache/ root@testpi:/home/pi# df -h | grep recording_cache /dev/sda1 57G 52M 54G 1% /mnt/recording_cache -- END SNIPPET -- Definitely got the right device node, so, update fstab -- BEGIN SNIPPET -- root@testpi:/home/pi# grep recording_cache /etc/fstab /dev/disk/by-uuid/8a4c7e0f-c379-4e2e-a7f2-15f47cd4dd94 /mnt/recording_cache ext4 defaults,noatime 0 1 root@testpi:/home/pi# mount -a root@testpi:/home/pi# chgrp video /mnt/recording_cache/ -R root@testpi:/home/pi# chown hts /mnt/recording_cache/ -R -- END SNIPPET -- Interestingly, the user _hts_ doesn't appear to be in the group _video_. Lets fix that while we're at it -- BEGIN SNIPPET -- root@testpi:/home/pi# usermod -a -G video hts -- END SNIPPET -- Test recording running at the moment, the episode being recorded should end in around 10 minutes so will check back in on it in a while ----------------------------------------------------------------------------------------- 2014-11-08 14:15:03 btasker ----------------------------------------------------------------------------------------- The recording shows as complete in the WebUI, and the filesize on disk is 323M. Plays back perfectly when requested through TVHclient ----------------------------------------------------------------------------------------- 2014-11-08 14:23:17 btasker ----------------------------------------------------------------------------------------- Checking that the setup will survive a reboot -- BEGIN SNIPPET -- root@testpi:/home/pi# reboot -- END SNIPPET -- *Following the Reboot* -- BEGIN SNIPPET -- pi@testpi ~ $ mount | grep recording /dev/sda1 on /mnt/recording_cache type ext4 (rw,nosuid,nodev,noexec,noatime,data=ordered) pi@testpi ~ $ ls -ld /mnt/recording_cache/ drwxr-xr-x 3 hts video 4096 Nov 8 13:46 /mnt/recording_cache/ -- END SNIPPET -- Started a quick test recording, file created on disk. Looks like we're good. ----------------------------------------------------------------------------------------- 2014-11-08 14:23:23 ----------------------------------------------------------------------------------------- btasker changed status from 'Open' to 'Resolved' ----------------------------------------------------------------------------------------- 2014-11-08 14:23:23 ----------------------------------------------------------------------------------------- btasker added 'Done' to resolution ----------------------------------------------------------------------------------------- 2014-11-08 14:23:27 ----------------------------------------------------------------------------------------- btasker changed status from 'Resolved' to 'Closed'