HOWTO: Move Kodi's data to external memory on an Amazon Fire TV
#46
your quotes are incorrect and you should use absolute paths instead of relative

xbmc_env.properties = C:\path\to\xbmc_env.properties

mnt/sdcard = /mnt/sdcard/

each quoted text is treated as a single command parameter so putting the whole thing in quotes it thinks you passed 1 parameter where 2 are required

you can see this in the help that was shown <> bracketed parameters are required [] bracketed are optional

so from that you can reformat to

adb push "C:\path\to\xbmc_env.properties" "/mnt/sdcard/"


further notes for future reference in general

quoted parameters are good practice but typically only required to encapsulate spaces and special characters

linux is filesystems are case sensitive where windows is not, so for windows WINDOWS=windows=WinDows and it does not care, linux will require case so only linux=linux - android is linux based and will follow this
Reply
#47
Absolutely outstanding help!!!! Thank you. I will finish reviewing this and following your instruction later today as it is now 0342 hours here right now. VERY tired. Thank you so much!!!
Reply
#48
youre welcome
Reply
#49
I completed everything ALMOST successfully!! However, when I try to launch Kodi now, it re-adds the org.xbmc.kodi file structure back into root and internal storage. Thus, I believe it to still be running off of internal storage.

How do I keep it from doing so? I have the xbmc_env.properties in:
mnt/sdcard/

So shouldn't it be reading to go to external storage from there? The file is:
(Titled)
xbmc_env.properties

(1 line of code)
xbmc.data=/storage/B42A-0A12/Android/data/org.xbmc.kodi/files
Reply
#50
i have never set this up in kodi so i will need to in order to be of any help, i dont have the time just now but as soon as i do
Reply
#51
No worries at all. No rush. I've got alternates and backups I can work off of until you get a chance. Thank you!!
Reply
#52
i dont think this works any longer

i set it up on my cube gen3 per instructions - https://kodi.wiki/view/HOW-TO:Change_dat...or_Android

/sdcard/xbmc_env.properties

with contents -
xbmc.data=/storage/<usbid>/kodi_data

/storage/<usbid>/kodi_data is a copy of /sdcard/Android/data/org.xbmc.kodi/files/.kodi

kodi seems to recognize and try to use the usb drive but just crashes

so i tried an empty kodi_data so it would generate a new set of default files - still crashes

i am using Kodi 21.0-ALPHA1 (20.90.101) Git:20230522-3481dd7e7b

-----

edit:

multiple more attempts with clean install still fail, might try 'format as internal storage' later if i find a usb drive in my drawer i dont mind dedicating to the firetv

seems to be kodi doesnt have permission to the usb drive
Reply
#53
more testing and this feature is inop for standard users

i formatted a usb drive as "internal storage" from the firetv settings

it is then formatted as ext4 by fire os and mounted to /mnt/expand/<usb-uuid>/

at that point you lose access to the drive, permission denied to both adb and apps including kodi

here it is listed under mount - /dev/block/dm-2 on /mnt/expand/<usb-uuid> type ext4 (rw,dirsync,seclabel,nosuid,nodev,noatime)

trying to have xbmc_env.properties route the userdata to the /mnt/expand/ location will fail and kodi will default back to internal storage where it usually is

-----

if you use move to external storage from the app management settings it will move the kodi Installation folder to the usb drive but kodi will continue to use the internal folder under /sdcard/Android for userdata


-----

as a root user only i can copy the kodi folder to the external location and give the folder the correct owner and group permissions

at that point xbmc_env.properties is able to route the userdata folder to /mnt/expand/<usb-uuid>/kodi_data

most people do not have root so anything requiring it will be unusable (if you are curious use google or duckduckgo it is not for this forum)

-----

now, with all that being said i did find a workaround

after moving kodi to external storage from firetv settings, kodi then had a location on the external storage that it did have access to so i was able to route there

this location then becomes special://xmc/kodi_data


this gets a bit advanced but here's how

  1. format a usb to 'internal storage' from settings -> my fire tv -> usb drive (wipes drive if you are not aware!)
  2. move kodi to external storage from settings -> applications -> managa installed applications -> click kodi from the list -> move to external storage
  3. open kodi, open file manager from settings, add source "special://xbmc" then from within kodi make a new folder here "kodi_data" (this way it is created with the right permissions and it's the only way to access the folder anyway)
  4. exit kodi
  5. issue the command "adb shell mount" from your pc or from within the adb shell it is just "mount"
  6. note the path that the usb drive is mounted to f.e. /mnt/expand/<long id here>
  7. put that path in xbmc_env.properties with the following structure xbmc.data=/mnt/expand/<usb uuid>/user/0/org.xbmc.kodi/cache/apk/assets/kodi_data
  8. put xbmc_env.properties into /sdcard/
  9. optional; remove the folder "/sdcard/Android/data/org.xbmc.kodi/files/.kodi" so you know it is in the new location

tested on FireOS 7.6.4.6

since the usb drive is now formatted ext it may be possible to do some things directly to the usb drive from a linux desktop - i didnt try

caveats -
copying existing data folder will be difficult
no access to new data folder outside of kodi
Reply
#54
WOW! That's a lot. lol I'll look into everything you shared and see if I can get it to work. I really appreciate it!!! At the end of the day, it could very well be worth it for me to do this.
Reply
#55
i actually like having kodi now wholly stored on the usb drive with the benefit both the installation folder and the data folder are in the same location - its sort of a portable install now


if nothing else you can use this as "brain push-ups", i saw it that way - just a nice workout routine for the brain
Reply
#56
Wink 
Nice! Exactly. That's how I'm viewing it and if I get success out of it that is awesome! I'm starting IT classes in the fall and am stoked! This has been quite the journey and only the tip of the iceberg. Take care and if I am able to remember, I'll be happy to report back with my results!
Reply
#57
Wink 
just a quick note, I've read everywhere about Firestick not liking anything beyond I think it was 128gb usb drive, maybe 256gb? I have a 512gb in there now and its reading it. If I can get all of this to work, that's a lot of storage for apps.
Reply
#58
indeed quite a bit of storage for this

i used an old 32GB Samsung FIT for this exercise, it probably cost $8-$12 whenever i bought it

also to note i am on FireTV Cube Gen 3 but i expect this to be OS specific rather than device

you take care as well
Reply
#59
Sorry it's taken me this long to get back. I still have some things I am working on to make sure Kodi is exactly how I want it before making the change, since you mentioned it might be difficult to access the data folders. I noticed that only Kodi and X-Plore out of all my apps have the option to move to external storage. Is this where I would follow the steps provided by Troypoint, to use Remote ADB Shell to force the apps over to external? Appreciate it. Hoping to be ready to run through the steps you gave me within the next 24 hours or less! <fingers crossed>
Reply
#60
im not aware of the instructions provided by troypoint but in regards to the overall question -

i am aware not all apps are intended to be moved so android wont offer the option, i am also aware those apps can be forced to move

i cannot comment on whether or not the instructions you are following are correct or that it is a good idea to force the apps to move
Reply

Logout Mark Read Team Forum Stats Members Help
HOWTO: Move Kodi's data to external memory on an Amazon Fire TV2