[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
Problem statement

The Amazon Fire TV has a limited memory sotrage of less than 5GB.

FolderMount allows for moving App data/obb to a USB device. Remaining components of the App, which sometimes are the larger part of the app, can't be transfered using

These remaining components can be 100s of MB and even above 1GB (Sine Mora is 292MB, Walking Dead is 1.14GB)

Solution

Link2SD allows for moving these components to an external SD card in the phone world. Below I'll describe how to do this on the Amazon Fire TV with a USB device.

This post heavily relies on tweaking a post by sashavasko. Major kudos to him. Up to finding his post I was not successful in mounting in a way that Link2SD could see the mount. This was due to a change in Android 4.2+ where one App's mounting isn't seen by others.

Below is a step by step guide for running this. I've posted a script for automating this here : http://xdaforums.com/showpost.php?p=54601505&postcount=33

Requirements

: Root, Mouse, Terminal Application

Step 0 - Preparations : Format a USB device to the Ext4 File system and install Link2SD

Ext4

Link2SD refers to parititoning your SDcard to both Ext4 and FAT, this is not required on our USB device. All we need is an Ext4 partiton we can mount for Link2SD.

I had a high end USB device I used for FolderMount. For testing, I got a 16GB Lexar Jump Drive, which got decent reviews. $8 at Staples ( even less with the right coupon. Other sizes are also cheap). Both went into my Powered USB hub.

You can also partition a single FAT32 USB device to two partitons - FAT32 and Ext4. I have verified both options. Please note that for this second option, if you already have files on your FAT32 USB device, you'd have to first copy them to a backup, as the partitioning trashes your data. You will then need to restore the backed up files to the FAT partition.

Format/Partition your USB device to Ext4 using free MiniTool Partition Wizard Home Edition on your Desktop/Laptop. Below is a nice post on this (Refer only to step 1), you can find others. Please note that this refers to an SDCard. We will be doing this on a USB device.

http://xdaforums.com/showpost.php?p=37405779&postcount=1

In partitioning, please verify the partitions are created as Primary. Also, not sure is this is required, but I didn't name my partitions.

There are also linux commands to do this - I didn't investigate these.

Stick the Ext4 partitoned USB device into your Amazon Fire TV and power it up. We will need the device in for Step 2.

Link2SD

Download Link2SD from the Google Play store, or sideload it

Make the directory Link2SD requires

su
mkdir /data/sdext2
exit

Step 1 - Fix adb localhost

Follow step 1 in sashavasko's post

http://xdaforums.com/showpost.php?p=45102645&postcount=1

Note1:

You will need a terminal app for this

Note2:

This step should only be run once. Running multiple times can mess the /data/misc/adb/adb_keys file as the key values will concatenate with sashavasko's method. This will cause mounting at boot not to work. If you did this or not sure if you've done this, just erase the duplicate keys from the /data/misc/adb/adb_keys file (the end of a single key is "unknown@localhost ). Or, better yet, if you aren't seeing any other different keys there - simply su and copy /sdcard/.android/adbkey.pub onto this file.

Step 2 - Install scripts

Follow step 2 in sashavasko's post

http://xdaforums.com/showpost.php?p=45102645&postcount=1

Note 1

Look for your Ext4 partitoned device after running:

adb shell cat /proc/partitions

You should find the Ext4 device under /device/block starting with sd.

For example: My first USB device is sda1, the Ext4 partitoned one was sdb1 (sdb2 when the Lexar drive was partitoned to FAT32 and Ext4).

You should be able to recognize the devices according to their partition sizes.

Note 2

The msd2.sh file should be changed to be:

#!/system/bin/sh

mount -t ext4 [COLOR="Purple"]/dev/block/[/COLOR][COLOR="Red"]sdb1[/COLOR][COLOR="purple"] /data/sdext2 [/COLOR]&& sleep 5 && /system/bin/vold

where the sdb1 device should be replaced by the device you located in Note 1.

Step 3 - Test the script and grant su permissions

Run this (no su command required, no path to the sd.sh file is required)

sd.sh

Verify you aren't seeing any errors. You will be granting SU permissions.

Run Link2SD. Go to the menu at the top right. Select "Storage Info" - Verify Link2SD recognizes the Ext4 partiton in the third line (under SD Card 2nd Part. ).

Step 4 - Auto Mount at initialization

For this I'm using the /system/etc/install-recovery.sh script which you should already have. This script loads at boot and calls /system/etc/install-recovery-2.sh (a non existent file).

Create a file at /sdcard/install-recovery-2.sh which contains

#!/system/bin/sh

/system/xbin/sd.sh

Now move the file to its place:

su
mount -o rw,remount /system
cp /sdcard/install-recovery-2.sh /system/etc/
chmod 755 /system/etc/install-recovery-2.sh
mount -o ro,remount /system
exit

Now Reboot (Long press remote Select + Play)

Step 5 - Link2SD ready to go

Open Link2SD to verify (as you verified before) that after boot Link2SD sees the Ext4 partiton.

Start moving files using Link2SD :

Select an App

Go to "Create Link" - You will be asked which file types to move. Check them all (not the paid option if you haven't paid).

Link2SD will show "Creating Link...", then an advert (in the non payed version) and then: Application files linked and moved to SD card

Note the expected storage change in the Amazon Fire TV's "About" menu option will be seen after Rebooting.

"Remove Link" works properly

"Move to SD card" is not relevant

Final Words

Don't use this to move system apps, or system-like apps

Responsibly for running this is solely on you. I am only describing what works for me.