PIDVR-8: Configure recordings directory



Issue Information

Issue Type: Sub-task
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: PiDVR (PIDVR)
Resolution: Done (2014-11-08 14:23:23)

Created: 2014-11-06 20:00:19
Time Spent Working
Child of: PIDVR-6: Install and Configure TVHeadEnd


Description
Setup the USB stick as the recordings directory (contingent on actually receiving the drive first) and ensure it automounts at boot.


Issue Links

Toggle State Changes

Activity


Once the stick has been received, will configure it to mount at /mnt/recording_cache
In the meantime, creating the directory and configuring TVHeadEnd to use it

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/


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
Grabbing the UUID for fstab the lazy way

pi@testpi ~ $ ls /dev/disk/by-uuid/
3d81d9e2-7d1b-4015-8c2c-29ec0875f762  787C-2FD4


Want the recording directory to be ext4, so

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


Definitely got the right device node, so, update fstab

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


Interestingly, the user hts doesn't appear to be in the group video . Lets fix that while we're at it

root@testpi:/home/pi# usermod -a -G video hts


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
The recording shows as complete in the WebUI, and the filesize on disk is 323M. Plays back perfectly when requested through TVHclient
Checking that the setup will survive a reboot

root@testpi:/home/pi# reboot



Following the Reboot

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/


Started a quick test recording, file created on disk. Looks like we're good.
btasker changed status from 'Open' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'