Jump to content


Photo

Linux noob needs help. (Path for external drive)

path linux

  • Please log in to reply
27 replies to this topic

#1 heciruam OFFLINE  

heciruam

    Advanced Member

  • Members
  • 62 posts
  • Local time: 10:57 AM

Posted 09 February 2018 - 04:22 PM

Hello everyone,

 

I'm new to linux, so new that I just installed it(mint 18.3) today. I installed Emby like the wiki suggests. No trouble so far. My media is on external hard drives that use ntfs.

 

The problem where I am stuck right now is finding the media thrugh emby while setting up the libraries. I can access the media through mint where it is located at /media/(myuser)/hard drive name/movies.

If I try to set up a library though emby I can only see paths like /sys , /proc , /run, ... and so on.

 

Do I need to give emby special permission to acces the files. What do I need to do?

Please forgive me for my uneducated linux question. Maybe someone knows exactly what I'm doing wrong or where I went wrong.

 

Thank you.



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 131347 posts
  • Local time: 04:57 AM

Posted 09 February 2018 - 04:43 PM

Hi, have you tried typing the path into the emby folder selection dialog?



#3 dcrdev OFFLINE  

dcrdev

    Advanced Member

  • Members
  • 846 posts
  • Local time: 09:57 AM
  • LocationUK

Posted 09 February 2018 - 04:57 PM

Hello everyone,

 

I'm new to linux, so new that I just installed it(mint 18.3) today. I installed Emby like the wiki suggests. No trouble so far. My media is on external hard drives that use ntfs.

 

The problem where I am stuck right now is finding the media thrugh emby while setting up the libraries. I can access the media through mint where it is located at /media/(myuser)/hard drive name/movies.

If I try to set up a library though emby I can only see paths like /sys , /proc , /run, ... and so on.

 

Do I need to give emby special permission to acces the files. What do I need to do?

Please forgive me for my uneducated linux question. Maybe someone knows exactly what I'm doing wrong or where I went wrong.

 

Thank you.

 

You can't rely on automounts generated by the desktop environment - that path has user specific acls that prevent access from other user accounts; removing those acls will not persist through reboots. You need to specify a hard mount in /etc/fstab and specify that you want to allow pseudo unix permissions.

 

Run through the following - replacing the information where apropriate:

sudo apt-get install ntfs-3g
groupadd movies
usermod -aG movies emby
sudo mkdir -p /mnt/<drive_name>
echo "UUID=$(lsblk -no UUID /dev/<device_name>) /media/<drive_name> ntfs-3g permissions,nofail,auto 0 0" | sudo tee --append /etc/fstab
sudo reboot
sudo chown -R root:movies /media/<drive_name>
sudo chmod -R u+rwX /media/<drive_name>
sudo chmod -R g+rwX /media/<drive_name>
sudo chmod -R o+rX /media/<drive_name>
sudo systemctl restart emby-server

@Luke I don't know how many times this needs to be mentioned before it gets sticked.


  • heciruam and EODCrafter like this

#4 mastrmind11 OFFLINE  

mastrmind11

    Advanced Member

  • Members
  • 2690 posts
  • Local time: 04:57 AM
  • LocationLong Island, NY

Posted 09 February 2018 - 06:53 PM

^^ this.  plus, get used to dropping into the command line.  It's more fun.



#5 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 131347 posts
  • Local time: 04:57 AM

Posted 09 February 2018 - 09:47 PM

Thanks for the info! Yes we should work on guides for this sort of thing.

#6 heciruam OFFLINE  

heciruam

    Advanced Member

  • Members
  • 62 posts
  • Local time: 10:57 AM

Posted 10 February 2018 - 10:06 AM

Thank you. I'll see if I can make it work.



#7 unrly OFFLINE  

unrly

    Newbie

  • Members
  • 4 posts
  • Local time: 08:57 AM

Posted 10 February 2018 - 04:42 PM

You can't rely on automounts generated by the desktop environment - that path has user specific acls that prevent access from other user accounts; removing those acls will not persist through reboots. You need to specify a hard mount in /etc/fstab and specify that you want to allow pseudo unix permissions.

 

Run through the following - replacing the information where apropriate:

 

So I actually came here to post the same exact thing. I had it figured out at one point, but had to completely reinstall after the new installation procedure because it messed up my old installation. I recall having major issues getting my secondary drive, but at some point got it figured out and never wrote down notes.

 

I followed your instructions, but it still can't see past "/media/kyle". This is what I entered:

sudo apt-get install ntfs-3g
groupadd movies
usermod -aG movies emby
sudo mkdir -p /mnt/media/kyle/media
echo "UUID=$(lsblk -no UUID /dev/sdb1) /media/kyle/media ntfs-3g permissions,nofail,auto 0 0" | sudo tee --append /etc/fstab
sudo reboot
sudo chown -R root:movies /media/kyle/media
sudo chmod -R u+rwX /media/kyle/media
sudo chmod -R g+rwX /media/kyle/media
sudo chmod -R o+rX /media/kyle/media
sudo systemctl restart emby-server

Thank you for your help, I appreciate it! And I'm going to be sure to bookmark this for the future :)



#8 dcrdev OFFLINE  

dcrdev

    Advanced Member

  • Members
  • 846 posts
  • Local time: 09:57 AM
  • LocationUK

Posted 10 February 2018 - 10:20 PM

So I actually came here to post the same exact thing. I had it figured out at one point, but had to completely reinstall after the new installation procedure because it messed up my old installation. I recall having major issues getting my secondary drive, but at some point got it figured out and never wrote down notes.

 

I followed your instructions, but it still can't see past "/media/kyle". This is what I entered:

sudo apt-get install ntfs-3g
groupadd movies
usermod -aG movies emby
sudo mkdir -p /mnt/media/kyle/media
echo "UUID=$(lsblk -no UUID /dev/sdb1) /media/kyle/media ntfs-3g permissions,nofail,auto 0 0" | sudo tee --append /etc/fstab
sudo reboot
sudo chown -R root:movies /media/kyle/media
sudo chmod -R u+rwX /media/kyle/media
sudo chmod -R g+rwX /media/kyle/media
sudo chmod -R o+rX /media/kyle/media
sudo systemctl restart emby-server

Thank you for your help, I appreciate it! And I'm going to be sure to bookmark this for the future :)

 

What's the output of:

cat /etc/fstab

Then:

sudo mount -a

Also I wouldn't mount it under /media/username because that's part of the problem.


  • unrly likes this

#9 unrly OFFLINE  

unrly

    Newbie

  • Members
  • 4 posts
  • Local time: 08:57 AM

Posted 11 February 2018 - 12:14 AM

Also I wouldn't mount it under /media/username because that's part of the problem.


That was definitely the problem. Edited fstab and just removed the username. All good now, thank you!!

#10 heciruam OFFLINE  

heciruam

    Advanced Member

  • Members
  • 62 posts
  • Local time: 10:57 AM

Posted 11 February 2018 - 11:49 AM

Ok I completely trashed my system. My computer didn't start after "sudo reboot". For my second attempt I want to be a little more cautious. Can you guys guide me to where I can do some reading up on the matter?

 

Will I run into the same problem if I use a docker instance?

 

Thanks


Edited by heciruam, 11 February 2018 - 11:52 AM.


#11 mastrmind11 OFFLINE  

mastrmind11

    Advanced Member

  • Members
  • 2690 posts
  • Local time: 04:57 AM
  • LocationLong Island, NY

Posted 11 February 2018 - 03:52 PM

Ok I completely trashed my system. My computer didn't start after "sudo reboot". For my second attempt I want to be a little more cautious. Can you guys guide me to where I can do some reading up on the matter?

 

Will I run into the same problem if I use a docker instance?

 

Thanks

No.  A benefit of running inside a container is that it only trashes the container, not your whole box.  But several of the active members here are running docker.  Works great.


  • EODCrafter likes this

#12 unrly OFFLINE  

unrly

    Newbie

  • Members
  • 4 posts
  • Local time: 08:57 AM

Posted 11 February 2018 - 04:16 PM

Ok I completely trashed my system. My computer didn't start after "sudo reboot". For my second attempt I want to be a little more cautious. Can you guys guide me to where I can do some reading up on the matter?

Will I run into the same problem if I use a docker instance?

Thanks


I would check fstab to see if something funky is going on there. I've screwed up many times there, and wasn't able to boot back in to the OS because I didn't set up my devices properly. Perhaps delete the line you just added and retry it.

#13 dcrdev OFFLINE  

dcrdev

    Advanced Member

  • Members
  • 846 posts
  • Local time: 09:57 AM
  • LocationUK

Posted 12 February 2018 - 05:14 AM

Ok I completely trashed my system. My computer didn't start after "sudo reboot". For my second attempt I want to be a little more cautious. Can you guys guide me to where I can do some reading up on the matter?

 

Will I run into the same problem if I use a docker instance?

 

Thanks

 

That's very strange - considering the above will create an entry in fstab that isn't required to boot the system i.e. it has the nofail option. My guess is you chose the wrong device name (maybe the root fs) and that has been mounted first.

 

If you post the ouput of:

lsblk -o name,uuid

Then we can help you with the exact entries that should be added.



#14 heciruam OFFLINE  

heciruam

    Advanced Member

  • Members
  • 62 posts
  • Local time: 10:57 AM

Posted 12 February 2018 - 12:49 PM

This is what I get:

 

 

 

 

heciruam@Z230 ~ $ lsblk -o name,uuid
NAME   UUID
sdd    
├─sdd2 A04A15444A15189C
└─sdd1
sdb    
├─sdb2 fc9e19fc-8e3a-447f-b819-bb1b0adf191e
├─sdb3 e5320df3-7637-4d8e-8936-5445ecd21454
└─sdb1 BA51-3593
sr0    
sdc    
├─sdc2 C8FC8DF0FC8DD8D8
└─sdc1
sda    
└─sda1 ff97d280-ee59-4ddb-89b4-743f1c0dc0e1
 

 

sdd2 and sdc2 should be the external ntfs drives.

 

sda1 is an internal drive formated as ext4

 

I would like to access these trhough emby.


Edited by heciruam, 12 February 2018 - 01:24 PM.


#15 tdiguy OFFLINE  

tdiguy

    Advanced Member

  • Members
  • 1129 posts
  • Local time: 04:57 AM

Posted 12 February 2018 - 04:44 PM

Personally I do not like to edit fstab or put drives in fstab that might not always be there on boot.

I know there are ways to work with fstab to get those conditions resolved but I am a linux newb with enough knowledge to seriously screw up my system lol.

So, what i have done is i have edited my /etc/rc.local to run a script that mounts drives for me.

This way if i screw things up with mount commands or if a drive is not there my base system will boot anyway. Really handy on a headless system so i dont have to go fishing for a monitor to borrow and a keyboard / mouse.

The same effect can be had by making an entry in crontab that is @reboot /dir/dir/script

Those are my 2 favorite ways of working with non essential drives and mounting them.

Ok turns out i lied about my rc.local, i pulled the changes out of there for whatever reason. This is an example from my system. My crontab is:

@reboot /home/<me>/Scripts/drivemount.sc
:
:
Then the script is:
mount UUID=7e615a2d-088b-4800-8bee-b58b2835d621 /media/emby
sleep 1
chown -R emby.MEDIA /media/emby/
sleep 1
mount UUID=4ec27b2b-2a18-4890-b430-0b245c2b3cfc /Movie-Backup
I also greatly prefer to mount based on uuid, the uuid normally will not change unless you force it to change ( I believe but i could be wrong ) where the /dev/sda or sdb can change and the why that changes i am not really versed on if its order that things are plugged in or slot plugged in to.
Anyway i hope someone also finds this useful.

Edited by tdiguy, 12 February 2018 - 04:49 PM.


#16 dcrdev OFFLINE  

dcrdev

    Advanced Member

  • Members
  • 846 posts
  • Local time: 09:57 AM
  • LocationUK

Posted 13 February 2018 - 05:31 AM

sudo apt-get install ntfs-3g
sudo groupadd movies
sudo usermod -aG movies emby
sudo mkdir -p /mnt/media/disk1
sudo mkdir -p /mnt/media/disk2
echo "UUID=A04A15444A15189C /mnt/media/disk1 ntfs-3g permissions,nofail,auto 0 0" | sudo tee --append /etc/fstab
echo "UUID=C8FC8DF0FC8DD8D8 /mnt/media/disk2 ntfs-3g permissions,nofail,auto 0 0" | sudo tee --append /etc/fstab

# Verify that "cat /etc/fstab" has the following at the end:
# UUID=A04A15444A15189C /mnt/media/disk1 ntfs-3g permissions,nofail,auto 0 0
# UUID=C8FC8DF0FC8DD8D8 /mnt/media/disk2 ntfs-3g permissions,nofail,auto 0 0

# Also make sure that /mnt/media, /mnt/media/disk1 and /mnt/media/disk2 are all empty directories.

sudo reboot
sudo chown -R root:movies /mnt/media
sudo chmod -R u+rwX /mnt/media
sudo chmod -R g+rwX /mnt/media
sudo chmod -R o+rX /mnt/media
sudo systemctl restart emby-server

  • heciruam likes this

#17 heciruam OFFLINE  

heciruam

    Advanced Member

  • Members
  • 62 posts
  • Local time: 10:57 AM

Posted 13 February 2018 - 06:24 AM

Thank you very much. This time it worked without any trouble.

 

I have one more question. Do I have to mount drives(internal) that are not ntfs the same way, to be able to access them in emby?

If where are they in the file tree when I look for them in emby?



#18 dcrdev OFFLINE  

dcrdev

    Advanced Member

  • Members
  • 846 posts
  • Local time: 09:57 AM
  • LocationUK

Posted 13 February 2018 - 07:03 AM

Thank you very much. This time it worked without any trouble.

 

I have one more question. Do I have to mount drives(internal) that are not ntfs the same way, to be able to access them in emby?

If where are they in the file tree when I look for them in emby?

 

Yes, but presuming since you can see them in Emby because they are already in fstab...

 

Double check:

cat /etc/fstab

But in general - you always want to define hard mount points using the UUID of the disk, for reliability-sake - otherwise you run the risk of the disk coming up under a different name / device node.


  • heciruam likes this

#19 Simca OFFLINE  

Simca

    Newbie

  • Members
  • 7 posts

Posted 14 February 2018 - 06:05 PM


But in general - you always want to define hard mount points using the UUID of the disk, for reliability-sake - otherwise you run the risk of the disk coming up under a different name / device node.

 

oh.... not really, i'm labeling my drives and mounting them using my custom, nice and readable labels, just like that: 

 

LABEL=btrfs_anime_s1 /mnt/storages/storage9 btrfs defaults 0 0 (rw,relatime,data=ordered)

 

While UUID may be changed on a re-formated volume, i can re-label any disk and be safe :) 



#20 dcrdev OFFLINE  

dcrdev

    Advanced Member

  • Members
  • 846 posts
  • Local time: 09:57 AM
  • LocationUK

Posted 14 February 2018 - 06:17 PM

oh.... not really, i'm labeling my drives and mounting them using my custom, nice and readable labels, just like that: 

 

LABEL=btrfs_anime_s1 /mnt/storages/storage9 btrfs defaults 0 0 (rw,relatime,data=ordered)

 

While UUID may be changed on a re-formated volume, i can re-label any disk and be safe :)

 

Equally one could assign the same label to several disks, whereas uuids are unique - there's merits and reasons for both for instance my storage volume is a zfs array and hence I use the label (or pool name there) .

 

That wasn't the point I was trying to make - what I was emphasising is that you should create permanent mount points always instead of relying on desktop auto mounting solutions, which is what cause the OPs problem.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users