Jump to content

External USB not visible on Ubuntu after upgrade


corien
Go to solution Solved by corien,

Recommended Posts

corien

I've upgraded Emby  (big mistake, apparently) and spent about 2 hours hunting down forum threads to figure out how to restart the server (systemctl start emby-server did not do it, also had to chmod some Emby folder before the Home page would load. It would be really useful to add that to your documentation on the download page...)

 

I went from 4.5.x to 4.8.3 I think.

 

When I finally had Emby running on localhost again, it was showing the thumbnails of my 2 Libraries (TV and Movie), and the history of what I watched 2 hours earlier, but it suddenly can't see my external harddisk anymore. It saw that same harddisk and ask the files on it perfectly fine on the previous Emby version.

 

And whatever I did trying to change permissions or add emby to some user group (?) , my Sonarr can't now see the external HDD anymore either.

 

I can access the USB harddisk and play the files on it through Ubuntu's file manager without any issues. If I right-click and check permissions, it's owned by corien group corien. Adding emby to group corien did not help. If I try to chmod -R emby:emby /media/corien/diskname I get an Operation not permitted error.

I've already restarted Ubuntu several times.

Any suggestions before I give up and just reinstall Ubuntu (or some other Linux distro, suggestions welcome) and start fresh?

Edited by corien
emby version edited
Link to comment
Share on other sites

TMCsw

Was the USB drive auto-mounted ? if so that wont work for emby or anything running under systemd, you need to make sure it is properly mounted usually in /etc/fstab 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

corien

Thanks for the reply!

 

I just plugged it in and clicked it in Dolphin file manager after each boot so it was "active".

This worked perfectly up to when I updated emby.

  • Thanks 1
Link to comment
Share on other sites

corien

Found a 1TB spare SSD in a drawer - switching everything over to internal storage. I'm done with trying to fix this. Thanks for trying to help!

  • Thanks 1
Link to comment
Share on other sites

  • Solution
corien
Posted (edited)

Did a fresh install (switched to Linux Mint from Xubuntu too in case that would help). It did not fix any of my permission issues.

I did find a solution though:

My setup is a local PC that's connected to my TV. Emby plays files from a folder on the PC.

Install Emby according to the instructions.

Then run this in a Terminal.

It stops the emby server so you can edit the config file (emby-server.service) so that it will run as a User:  You .
(change mint in the code to what your username in Linux is, it's the same one you log in with).
 

> systemctl stop emby-server
> sudo nano /usr/lib/systemd/system/emby-server.service

This opens the file. Change the line with User=

User=mint

CTRL+O to save the file. CTRL+X to close the file.

Then re-read the changed config file, and restart emby. You can check with 'status' in  the last line if it's actually running, or you can open it in your browser.

> sudo systemctl daemon-reload
> sudo systemctl start emby-server
> sudo systectl status emby-server  

After this, Emby will see all your user folders and will have the right permissions to read.

With SABDNZBD you can do something similar, this one does have quotes around the username.
 

> sudo nano /etc/default/sabnzbdplus 
> USER="mint"
> sudo systemctl daemon-reload
> sudo /etc/init.d/sabdnzbdplus restart  

And for Sonarr it will ask 'run as user' and you can enter your username there (for me mint).

Then all three services run as if they are you, so you can create a folder in for example /home/username/Sonarr that Sonarr organizes files in, and that Emby can read and play.

Hope this saves someone a few hours of troubleshooting.


 

Edited by corien
  • Thanks 1
Link to comment
Share on other sites

Thanks for following up with the solution !

Link to comment
Share on other sites

corien

I'm not sure if the emby service is auto-starting correctly after a reboot.. Will check next time I have to restart my system (just reinstalled emby this time and readded the folders) but for now I can watch TV again.

> sudo systemctl start emby-server

did not actually start the emby-server yesterday after a..'reboot' (accidentally unplugged the PC while it was running ;D)

Link to comment
Share on other sites

corien
Posted (edited)

So Emby indeed was not starting correctly after reboot.

 

 

sudo systemctl start emby-server did not restart it

sudo systemctl status emby-server keeps saying it's dead.

○ emby-server.service - Emby Server is a personal media server with apps on just about every device
     Loaded: loaded (/lib/systemd/system/emby-server.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Wed 2024-03-06 18:57:09 CET; 11s ago
    Process: 4508 ExecStart=/opt/emby-server/bin/emby-server (code=exited, status=0/SUCCESS)
   Main PID: 4508 (code=exited, status=0/SUCCESS)
        CPU: 96ms

Mar 06 18:57:09 mint-ESPRIMO-Q510 emby-server[4508]:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Ope>
Mar 06 18:57:09 mint-ESPRIMO-Q510 emby-server[4508]:    at System.IO.Strategies.OSFileStreamStrategy..cto>
Mar 06 18:57:09 mint-ESPRIMO-Q510 emby-server[4508]:    at System.IO.Strategies.FileStreamHelpers.ChooseS>
Mar 06 18:57:09 mint-ESPRIMO-Q510 emby-server[4508]:    at System.IO.FileStream..ctor(String path, FileMo>
Mar 06 18:57:09 mint-ESPRIMO-Q510 emby-server[4508]:    at Emby.Server.Implementations.Logging.FileLogger>
Mar 06 18:57:09 mint-ESPRIMO-Q510 emby-server[4508]:    at Emby.Server.Implementations.Logging.SimpleLogM>
Mar 06 18:57:09 mint-ESPRIMO-Q510 emby-server[4508]: InnerException: System.IO.IOException: Permission de>
Mar 06 18:57:09 mint-ESPRIMO-Q510 emby-server[4508]: Source:
Mar 06 18:57:09 mint-ESPRIMO-Q510 emby-server[4508]: TargetSite:
Mar 06 18:57:09 mint-ESPRIMO-Q510 systemd[1]: emby-server.service: Deactivated successfully.

 

## Solution:

 

When I set the user back to ' emby'  in the config file (and not User=mint) the service is starting again

(? No clue why..but at least Emby is working now and I can watch TV)...

Edited by corien
Link to comment
Share on other sites

Lessaj

I can see a permission denied error but you'll have to get more information from the unit because it's cut off.

journalctl -b 0 -u emby-server

Would show you all the unit logs for emby-server since current boot.

journalctl --since "2024-03-06 18:55:00" --until "2024-03-06 18:58:00"

Would show you any journal messages in a small time range before and after the messages above.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...