Jump to content

Emby Android Server USB Drive Can't Read Directory


jscheeren

Recommended Posts

On 3/16/2024 at 2:12 AM, kakashi55 said:

Hi, is there any update to this issue ? 

I am running Emby Server 4.9.0.4 on Android 12 phone. Emby can't access USB OTG hdd/ssd.

Thanks.

 

Can you install XPlore? Are you able to locate the usb with that?

Link to comment
Share on other sites

kakashi55
On 3/19/2024 at 11:10 AM, Luke said:

Can you install XPlore? Are you able to locate the usb with that?

All file managers can locate USB Storage. The problem lies with the server.

'Emby Server for Android' lacks MANAGE_EXTERNAL_STORAGE permission. I gave this permission to Emby server by editing AndroidManifest.xml  and using a adb command. Now, Emby Server can also access USB Storage.

I request Emby team to add this permission in upcoming updates. Thanks. 

Link to comment
Share on other sites

2 hours ago, kakashi55 said:

All file managers can locate USB Storage. The problem lies with the server.

'Emby Server for Android' lacks MANAGE_EXTERNAL_STORAGE permission. I gave this permission to Emby server by editing AndroidManifest.xml  and using a adb command. Now, Emby Server can also access USB Storage.

I request Emby team to add this permission in upcoming updates. Thanks. 

Hi, what version of android is your device on?

Link to comment
Share on other sites

kakashi55
10 minutes ago, Luke said:

Hi, what version of android is your device on?

I am on Android 12. Emby has Read_External_Storage and Write_External_Storage permissions. But on newer Android versions, it also needs Manage_External_Storage permission. 

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

  • 3 weeks later...
nmh.1994@gmail.com
On 3/20/2024 at 11:52 PM, kakashi55 said:

All file managers can locate USB Storage. The problem lies with the server.

'Emby Server for Android' lacks MANAGE_EXTERNAL_STORAGE permission. I gave this permission to Emby server by editing AndroidManifest.xml  and using a adb command. Now, Emby Server can also access USB Storage.

I request Emby team to add this permission in upcoming updates. Thanks. 

can you share your apk file please, I have 1TB NTFS HDD usb and i want to use my old pixel 4xl phone as emby server too, the hard part is to get emby see my USB and add it to library

i can downgrade pixel from android 13 to 10 or install custom rom

but seem ntfs need to mount through paragon app,

please help me sir

 

Link to comment
Share on other sites

kakashi55
1 hour ago, nmh.1994@gmail.com said:

but seem ntfs need to mount through paragon app,

Paragon app won't work because it doesn't actually mount usb drives. Paragon app works as document provider and emby server doesn't use 'Storage access Framework'. So it won't work.

Solution ---

You have to root your phone using Magisx and install NTFS-3g Magisx Module.

https://github.com/woa-vayu-archive/Port-Windows-11-POCO-X3-Pro/releases/download/ntfsdroid/ntfs3g.zip

Use a file manager to navigate to /dev/block/ and have a look at all your hdd partitions. They will be listed as sda1, sda2, sda3 etc.

Make a folder in internal storage where you will mount your partitions such as partition1, partition2, partition3 etc..

Use termux app and enter below command to mount the desired partition of your hdd:

su -mm -c "mount.ntfs /dev/block/sd*1 /storage/emulated/0/partition1"

Use sd*2, sd*3 , partition2, partition3 in above command as per your need.

Enter below command to unmount:

su -mm -c umount /storage/emulated/0/partition1

I used * because sda can also change to sdb, sdc etc, if you unplug and replug your hdd.

Since you are mounting hdd to internal storage i.e. /storage/emulated/0,  you don't need to modify Emby server apk to add 'Manage_External_Storage' permission. Emby server already has r/w access at that location.

Extra Tip: use a Powered USB hub.

Stock Android doesn't support NTFS. But many phones such as Mi, Samsung , OnePlus already have NTFS support built-in. So, no need to root these phones. In that case, Emby server only requires 'Manage_External_Storage' permission to access USB drives and SD cards.

@LukeTherefore, I would request emby team to add 'Manage External storage' permission in Emby server for Android. All file managers have this permission in Android 11 and above. With this permission, emby server will be able to access all files in SD cards and USB drives. No need to implement SAF(storage access framework).

I don't think It would take more than 30 minutes to implement this permission.

Thanks.

 

Edited by kakashi55
Link to comment
Share on other sites

nmh.1994@gmail.com
9 hours ago, kakashi55 said:

enter below command to mount the desired partition of your hdd:

su -mm -c "mount.ntfs /dev/block/sd*1 /storage/emulated/0/partition1"

 

thanks you so much for helping, mount ntfs is the best method 

i tried that command but it says "failed to access mount point /storage/emulated/0/partition1: No such file or directory"

then i create a folder named Movies then try              su -mm -c "mount.ntfs /dev/block/sdg1 /storage/emulated/0/Movies"                it does mount my hdd to a Movies file, total commander can see my hdd in this file but when go to emby it does not accept that /storage/emulated/0/Movies (the path could not be found)

 

i think maybe need to add some mount option to android accept my hdd as a folder

Link to comment
Share on other sites

nmh.1994@gmail.com

ahha i get it worked

Firstly, SElinux must be set to permissive

su

setenforce 0

su -mm -c “mount.ntfs /dev/block....

Link to comment
Share on other sites

kakashi55
5 hours ago, nmh.1994@gmail.com said:

failed to access mount point /storage/emulated/0/partition1

Did you create partition1 folder ?

 

32 minutes ago, nmh.1994@gmail.com said:

SElinux must be set to permissive

I didn't have to set SElinux to permissive.

 

5 hours ago, nmh.1994@gmail.com said:

mount.ntfs /dev/block/sdg1

Use sd*1 instead of sdg1. And make scripts such as mount.sh and unmount.sh and put your commands inside these scripts and use termux-widget app, then you can just click on home screen icons to mount, unmount the hdd. 

Cheers !

  • Like 1
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...