Ubuntu 18.04 OS on SSD-Home directory on HHD
Added by Mike Garcia over 5 years ago
I recently installed a 250 gig SSD for my desktop running Ubuntu 18.04 operating system, and moved the home directory to the 3 terabyte HHD. I have HDHomerun for the local tuner and a file of several working .m3u addresses. I use Kodi for watching TV. I installed TVheadend and noticed the install was on the SSD and the folder holding the recordings was also on the SSD. I wanted the recordings to be in the home/Videos directory where I created a folder named TVheadend. Then I located the recording profile. I changed the path the recordings to /home/Videos/TVheadend. Unfortunately the instant recording test opened and immediately closed, and the same happened when I used a timer. When I tried to remove the TVheadend files from the SSD I could not, even when using the terminal as sudo su and root nautilus. I finally removed the SSD, and used an usb adapter on my laptop to remove all of the TVheadend files.
Has anyone successfully installed TVheadend on a desktop using a SSD for the operating system and have the recordings go to the larger HHD ?
Unless I can find a solution, I think I will open a Virtualbox machine and install TVheadned on that.
Replies (16)
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by saen acro over 5 years ago
Just mount old HDD to some folder on new SSD.
I do this with raid massive without problem.
Use Webmin to be more easy.
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Mike Garcia over 5 years ago
Thank you for the reply saen acro. I want my setup exactly how I have it. I looked at few ways to set up the SSD and HHD, having the home directory on the larger drive works great for me. My only question is has anyone successfully installed TVheadend on a desktop using a SSD for the operating system, and have the recordings go directly to the larger HHD ?
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by saen acro over 5 years ago
In my case my raid storage is mounted in
/media/raid0
/etc/fstab
/dev/md0 /media/raid0 ext4 defaults 0 0
You can do same for your needs.
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Paraic McDonagh over 5 years ago
Hi Mike,
I have a very similar setup. I have an Ubuntu 18.04 PC with the OS on an 125Gb SSD and a 3Tb internal drive for my TV Recordings.
There should be no need to move your home directory over. Just create a directory for your recordings on the 3Tb drive and point tvheadend to the directory. E.g. Create a directory called "RecordedTV"
In my case, the 3Tb drive is called "Multimedia". So in tvheadend - Configuration - Recording - Recording system path, I have "/mnt/Multimedia/RecordedTV" (without quotes).
Also, I'd highly recommend that the drives partition is ext4 format. Windows formats NTFS etc.can cause issues. Maybe take a backup copy of the home directory and use the graphical application "disks" to wipe and change the partition to ext4.
Then copy back your home folder.
A gotcha, (and I suspect that this is your problem) is that tvheadend accesses your folders as the user hts. If hts doesn't have access to the folder, it won't be able to record there and the recordings will fail.
To verify access, open terminal and type:
sudo -i
Followed by your password.
Then type this at the root prompt (#):
su hts
You should now be logged in as hts.
Then verify that you can navigate to the folder. In my case:
cd /mnt/Multimedia/RecordedTV
Also ensure that hts can navigate to the drive root also.
cd /mnt/Multimedia
If you have a problem with either, you must grant read/write privileges to the user hts for both the drive and folder.
Hope this helps!
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Paraic McDonagh over 5 years ago
P.S. you can use
mount | grep /sd
to list your drive allocation, showing mount points and formats.
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by saen acro over 5 years ago
Paraic McDonagh wrote:
P.S. you can use
mount | grep /sd
to list your drive allocation, showing mount points and formats.
more simple is to use command
df -h
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Paraic McDonagh over 5 years ago
It may be simpler but that's because it's not equivalent.
The (almost) equivalent would be:
df -h | grep /sd
Hardly an improvement. More importantly, this gives no info about the drive format type which is why I opted for mount.
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by saen acro over 5 years ago
Paraic McDonagh there is other storage devices types then devices connected to onbord serial ata directly.
ex.
devices connected to external pci-e sata/raid/jbod controllers
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Mike Garcia over 5 years ago
Thank you very kindly Paraic McDonagh and saen acro for your excellent replies and information. If and when I upgrade my HTPC setup, I will refer to this page before I build. I use this computer for several things beyond the HTPC duties. The SSD is new while HHD has some years on it. I may want to swap it out in the next year and that is one reason I want to keep the Home directory on the large drive. Swap it out and copy the files from the back up, no muss no fuss.
One of the issues I had regarding the TVheadend install was the folder for the recordings was not in a home/hts or a .hts folder. In fact the folder for the recordings was in the root snap, and named "19". It was for that (and other reasons), I decided to delete and purge the install. I used the synaptic package manager to delete the files, and ran apt get delete and purge on top of that. Much to my surprise, when I turned on Kodi, the TVheadend was still producing a guide and channels. I can only imagine the look on my face when I saw the TVheadend working as if nothing happen, lol. Then when I put localhost:9981 in my favorite browser. OMG this thing just won't DIE! And as I said in the opening post, I literally had to pull the drive from the rig and plug it into my laptop to remove all of the TVheadend files.
As for your answers to my questions, as good as they are, and they are quite good, I have decided to put the TVheadend on a Virtualbox machine. This way if something goes buggy, and I can't fix it, I can just delete the Virtualbox machine no harm no foul. I did that yesterday and it's working perfectly. I installed Linux Mint Mate on the Virtualbox. I have never used Linux Mint but I've heard great things about it. I didn't want to spend much time configuring at the start like I did with my Ubuntu setup, since this virtual machine was only going to do one job. Then I used the install instructions on this site https://lintut.com/install-tvheadend-on-ubuntu-18-04-server/. And so far (knocking on my wooden head), so good. However... and there always seems to be a but lol...
My Kodi looses its connection the the TVheadend when I use the VPN. I didn't think about the network aspect of having this setup. If you have any suggestions on a fix for this issue, well I would love to see them. For now I'm okay with the way the system is functioning so no hurries, and thank you both again.
M.G.
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Paraic McDonagh over 5 years ago
Hi Mike. OK, it seems a bit extreme to change to virtual box as a solution. Virtualization has it's own issues. I think you were very close to achieving your goal with Ubuntu and we could have helped you to get there. But hey, if the solution works for you, then go for it.
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Ruud Zuijdevelt over 5 years ago
Hi,
I've got the same problem with changing the recording path to something else then /root/snap/tvheadend/19
My goal is to record TV on another mounted partition and not my SSD drive.
Tried everything I know: set everything up to automatically mount my partition at boot (/etc/fstab) with full access for root user.
Then tried adding a symbolic links to the /root/snap/tvheadend folder.
No luck. The instant recording test opened and immediately closed. Just like Mike Garcia described above.
Has anyone manage to fix this (without using a virtual machine)
Ruud
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by saen acro over 5 years ago
how simple is to use user with run tvheadend to test is destination is writable ~777
sudo chmod 777 directory
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Ruud Zuijdevelt over 5 years ago
Hurray!! finally got it to work.
Looked at it again, I realized it might also have to do with the fact that just the recording-path just needs to be the way it is. (maybe hardcoded somewhere)
So, I've added a line in /etc/fstab telling it to mount my partition as /root/snap/tvheadend/19
/dev/sda4 /root/snap/tvheadend/19 auto defaults 0 0
Voila!!
No more trouble, as It does recordings just fine now :-)
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by stultus Strebor over 5 years ago
If you installed tvh with snap it would be running in a sand box??
Did you use snap for any reason other than simplicity of installation?
Bonne chance..S
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Paraic McDonagh over 5 years ago
For anyone else experiencing issues. There are 2 main gotchas.
1. The path you have set up in tvheadend as the recording location, must be set up to automatically mount when you boot into Ubuntu.
It may well be that the drive will become accessible when you browse it with the gui file manager (nautilus), but this is because the system is mounting the drive on demand. This is NOT the same as automatic mounting at boot time.
If you don't set this up, you may run into issues if your box reboots and can't access the drive as a result.
You can find instructions how to do this here : https://www.binarytides.com/ubuntu-automatically-mount-partition-startup/
2. The second common issue is that tvheadend does not have the necessary privileges to access the mount and it's sub-directories.
This is the default for Ubuntu, so if you haven't set this up, tvheadend will fail to record, list completed recordings, timeshift, display logos etc.
My personal preference would be to have the entire drive dedicated to tvheadend or if you need other stuff on there, then it should have it's own dedicated partition. It's not mandatory, but it makes things more logical. Tvheadend needs folders for recording, timeshift and channel logos (or picons), so a dedicated tvheadend partition with a folder for each of these makes things nice and neat.
Whatever you decide, you need to give full access to tvheadend. There is a user account called hts (tvheadend's account). This is the account that needs to have access. You can do this via the command line as root, but if you are more comfortable using the file manager, you can do it graphically.
Type this in terminal to launch the file manager as root.
sudo nautilus
In the file manager, navigate to, then right click on the desired drives or folders and then select 'properties'. There is a tab where you can set permissions. You can set the owner and group as 'hts'.
I would do both. Give full read write and delete permissions to at minimum hts. Do this for the drive, all of the sub-folders and their 'contained files'. Changes made should take place when you close the dialog (there's no save button). Verify the changes have stuck by reopening the permissions dialog again, and check that they are as you set them.
To be 100% sure that you have given hts the needed access (don't just trust file manager), open a terminal, log in as hts and navigate into each directory. If you are unable to access the directories, you need to revisit above.
I am not aware that there is a password for the hts user, but you can work around this by logging in as root and using su (switch user) to get to the hts user prompt.
To do this, elevate to root by doing this in terminal:
sudo -i
Then switch user to hts:
su hts
You should now have a hts user prompt.
In this example, my mount is called '/media/Multimedia' and I have folders called 'RecordedTV', 'Timeshift' and 'TVLogos'.
Try all of the following from the hts user prompt:
cd /media/Multimedia
cd /media/Multimedia/RecordedTV
cd /media/Multimedia/Timeshift
cd /media/Multimedia/TVLogos
'hts' should be able to browse into every folder in order for tvheadend to operated as expected. If not, change the necessary permissions.
Note: You can also change permissions in terminal as root using the chown and chmod commands instead of in file manager, if you are comfortable to do so.
Hope this helps someone! Any issues, just ask.
RE: Ubuntu 18.04 OS on SSD-Home directory on HHD - Added by Mike Garcia over 5 years ago
Thank you Paraic McDonagh for adding the detailed information. If you recall I choose to use a Virtualbox machine dedicated just for TVheadend. This solution is working reasonably well. It ran for about a month with no problems. Today I did have to delete the Virtualbox machine due to an odd behavior. I found several working .mu3 links I wanted to add to the few I have on the TVHeadend. After I added them to the file, the TVHeadend stopped working. I restarted the TVHeadend via the command line, then restarted the machine it self. Neither worked so I saved my time and frustration by simply deleting the machine, then plugging in the backup clone that I made. No muss no fuss. However, I'm back in the forum to see how to re-scan the channels, or re-map the services, because two local network stations are not showing up in my channels. One of the network channels (local CBS) is not being picked up by the HDHomerun antenna. I don't know why that is. The other network (local FOX) is coming in on the HDHomerun, but not found by the TVHeadend. I hope a re-scan will restore that channel back into the channel lineup on my Kodi.
Now that I have seen your configuration, I think I might look for a rig on Craigslist, or the local thrift store, add a larger drive, and have it just for the TVheadend. I really don't want to make changes to fstab, as that is a bit above my skill level. I did change the fstab to put my home directory on a lager drive, so I could do it with the correct instruction.
Having a machine, or dedicated partition for TVheadend is definitely the way to go.
Cheers Mate!