yashsingh1/xdaforums huggingface dataset:
[Fire TV General] thrashman69:
Thanks, I'm having a problem though. I can get the flash drive to show up in link2sd, but it doesn't show up after a reboot unless I run your script again through the fire tv's terminal.

Do you know what could be causing this?

Thanks
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
thrashman69 please be clear.

Are you using the method in the original post (all stages) ?

Are you using the above AL2SD script ?

If the answer to both of the above is no, then you should. That's exactly what this thread is about, how to assure the ext4 partition is seen by Link2SD on boot and Link2SD-ed apps can run successfully on boot, all without additional intervention.

If you are using one of these methods, please define which and we'll debug from there.
[Fire TV General] glitchbit:
No problem, it's been a long time since I have wrote a sh script and even then they were simpler than that one lol. I just knew with all the powerful command line tools out there there had to be a better way to automate that step and I broke my busybox install twice because I was stupid enough to think that parted might depend on them. I am disappointed to find that whether I use a powered usb hub or not that I cannot connect more than 1 physical usb storage device at a time. I/O errors occur and one or both drives get the boot.

I wish I knew more about linux as I would love to try and tie in a mounting script to execute when the OS recognizes that a usb device has been plugged in. Short of a script polling, which I obviously do not want to do, there may not be a way as I think that might be a function of the kernel in some way to notify other processes.
[Fire TV General] thrashman69:
I used the al2sd script

The original method in the 1st post didn't work for me

Thanks
[Fire TV General] wunderdrug:
I have not tried this, but you may want to look at StickMount, which I believe

supports NTFS. Install StickMount and look in the directory:

/data/data/eu.chainfire.stickmount

There should be an executable called "ntfs-3g", which I believe is what StickMount

uses to mount NTFS filesystems.

You should also be able to modify your script to mount ExFAT filesystems.

root@android:/data/data/eu.chainfire.stickmount # ./ntfs-3g
ntfs-3g: No device is specified.

ntfs-3g 2012.1.15 integrated FUSE 27 - Third Generation NTFS Driver
Configuration type 1, XATTRS are on, POSIX ACLS are off

Copyright (C) 2005-2007 Yura Pakhuchiy
Copyright (C) 2006-2009 Szabolcs Szakacsits
Copyright (C) 2007-2011 Jean-Pierre Andre
Copyright (C) 2009 Erik Larsson

Usage: ntfs-3g [-o option[,...]] <device|image_file> <mount_point>

Options: ro (read-only mount), remove_hiberfile, uid=, gid=,
umask=, fmask=, dmask=, streams_interface=.
Please see the details in the manual (type: man ntfs-3g).

Example: ntfs-3g /dev/sda1 /mnt/windows

News, support and information: http://tuxera.com
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
Hi thrashman69

Please upload the debug_log.sh file from the below link into your adb direcory:

https://mega.co.nz/#!lENGSRyA!dQQd25UCS-IEDtzyvFQ5vTOpZPSbjhAVYLJ3JbY7D4Q

Reboot the FireTV (This is important - Just reboot as is and don't re-run the mounting script). Then connect to the FireTV from your PC's terminal and run :

adb push debug_log.sh /sdcard/Download/AllowLink2SD

adb shell su -c source /sdcard/Download/AllowLink2SD/debug_log.sh > mylog.txt

A file called mylog.txt will be generated in your PC's adb directory. Please reply back with the file + the file system for each device you are mounting with the script.
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
glitchbit - I'm using two usb sticks with a powered usb hub. Both are mounted with no issue. FolderMounted Apps on one, Link2SD Apps on the other (and yes, as I've mentioned before, this is not a must - you can use a single partitioned USB device).

Possible reasons for your hub issues:

- Powered hub not strong enough (do you connect two USB portable drives or just USB flash drives?)

- Perhaps the devices have issues - run a check for errors on them
[Fire TV General] vulturecp:
I attempted this, and for some reason it doesn't seem to be running on boot. I can run the sd.sh script manually and it works, I can also run /system/etc/install-recovery.sh and everything executes.

I added some echo statements to a log file into /system/etc/install-recovery.sh and it doesn't seem to be running on launch. Perhaps I disabled this somehow?
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
thrashman69 and vulturecp please run the below command from the FireTV terminal and report what you get. Also please reply with the results of the debug script.

grep "install-recovery.sh" /init.rc
[Fire TV General] vulturecp:
/init.rc line:

service flash_recovery /system/etc/install-recovery.sh

class main

oneshot

Here is the log file from a fresh restart "mylog-reboot.txt" and after running sd.sh from the shell in "mylog.txt".

Also, I am using the AL2SD method here. Since I was having issues I factory reset and retried with the same results. I looked at the original method and followed the steps to verify the AL2SD script did everything it should, and it appears it did.
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
Hmm...the only thing I see suspicious is the keys file is bad (has multiple appended keys which could corrupt it). But if the keys file is bad, I don't understand why running the sd.sh works.

Let's assume it is the keys file. From the FireTV consule please run

su
cp /sdcard/.android/adbkey.pub /data/misc/adb/adb_keys

Reboot, check the storage option in Link2SD and report back.
[Fire TV General] vulturecp:
That was it! Thank you much!
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
Hi,

After fixing vulturecp's issue I've updated the original post to explain to those running in the manual method the keys generation shouldn't be run more than once (See

Step1

/Note 2). I explain there how to fix this if it has occurred.

I've also updated the automated script to fix any messed up keys file which could have been created by running the keys part of the manual method multiple times before running the automated script. This would resolve any related issues where mount isn't working on boot.

In the automated script post (below) I have updated the link to point to the updated script. If you've previously downloaded this, you can unzip the updated automated script files to write over you original unzipped files, re-run the installation bat file, and then re-run AL2SD.sh (re-installation verified to work).

http://xdaforums.com/showpost.php?p=54601505&postcount=33

thrashman69 - Please update when you can with your debug data.
[Fire TV General] jadflat:
Can't find ext4 partition

Hi, I've tried to get this running using the batch file and am having an issue, when i run AL2SD.sh it can't find the ext4 partition on my usb stick.

I have a 500GB NTFS hard drive which I'm using with Folder Mount and Stick Mount, this has been working for a few weeks without issue.

I bought a 64GB usb stick to use with Link2SD and have formatted it to ext4 using mini tool partition wizard, I'm not sure what the issue is, any help would be greatly appreciated.
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
Are you meeting the Busybox installed requirement ?
[Fire TV General] jadflat:
yes, i installed busybox when i rooted my firetv

edit; actually i just checked it and it said not installed. I'll try to re-run everything now

edit2; success! thank you for everything
[Fire TV General] thrashman69:
I ran init.rc successfully. Sorry I couldn't copy and paste the result off off of my firetv.

I didn't get the same result as the other user but it ran.

How do I generate/find the log file.

Sorry I'm little newbish.
[Fire TV General] thrashman69:
It's working now After wiping my FTV and reinstalling everything. I also used your new script.

Thanks buddy

---------- Post added at 08:38 PM ---------- Previous post was at 07:44 PM ----------

The biggest spacehog GTA San Andreas only saves 106mb.

And it takes up almost 2.5 gigs.

It won't move the data for some reason
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
Post #51:

And now.

Ladies and Gentlemen.

Winner.

2014.

Understatement of the year:

Post #50:

thrashman69 - Please 1) Read the original post of this thread (first 4 lines will do) 2) Google for FolderMount FireTV usb 3) Save 2.5GB

All others - Shame on you for not helping thrashman69 till now

Me - Go back to bed and another cup of tea
[Fire TV General] thrashman69:
Oh sorry I guess folder mount is better for some apps than links2sd is? I thought it was an Either or type thing. Sorry I missed the part where u use them both lol.
[Fire TV General] dbdoshi:
This is not working for me....

I tried both the manual way as well as using the AL2SD_install.bat/AL2SD.sh way. The mount command does not show the desired result (and of course Link2SD can't see the 2nd part).

I have Busybox PRO installed and it is actually installed as well.

I tried copying the adb_keys file as well.

I can manually run ./install-recovery.sh and it mounts it correctly, which tells me that install-recovery-2.sh and all the files downstream from that works fine.

This makes me think if the process doing the mounting cannot read the "adb_keys" file due to permission issue, maybe? I checked the file properties and gave it READ access to all 3 of Owner, Group and Other (along with the containing folder "adb").

I have attached the log file...

Any ideas? Thanks.
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
dbdoshi What does this give when running from the FireTV terminal ?

su
grep "install-recovery.sh" /init.rc
[Fire TV General] dbdoshi:
I get one line of output: "service flash_recovery /system/etc/install-recovery.sh" (without double quotes).

Thank you for responding so quickly.
[Fire TV General] dbdoshi:
Ok, I tried running msd1.sh using the Script Manager application. I marked the msd1.sh as a favorite, boot and a root script. It successfully runs at boot time.

When I look at the logs of its execution, I see this over and over again:

* daemon not running. starting it now on port 5038 *

* daemon started successfully *

** daemon still not runningerror: cannot connect to daemon

* daemon not running. starting it now on port 5038 *

* daemon started successfully *

** daemon still not runningerror: cannot connect to daemon

* daemon not running. starting it now on port 5038 *

* daemon started successfully *

At this point, it stops executing...

I researched it a bit and it could be due to a conflicting version of ADB.exe from the core Android version? Not really sure how to go about debugging this error.

------------------------------------ Manual execution of msd1.sh from the Script Manager -------------------------------------

Now, if I run it manually from the Script Manager (not from the terminal emulator on FTV), it gives me this:

root@android:/ # exec /system/bin/sh '/system/xbin/msd1.sh'

* daemon not running. starting it now on port 5038 *

* daemon started successfully *

connected to localhost:5555

At this point, mount is available and usable by Link2SD.

--------------------------------------------------------------------------------------------------------------------------------------------------------

It looks like it cannot connect to the localhost during the boot time when msd1.sh is executed, but can manually after FTV is fully up and running. Any ideas?

---------- Post added at 01:23 PM ---------- Previous post was at 01:11 PM ----------

I also looked at the adb logcat and I see the daemon not running error in there as well (logcat captured when I was using the install-recovery-2.sh mechanism to auto run sd.sh at boot time).
[Fire TV General] dbdoshi:
Works!!

Changed the boot script in Script Manager to "sd.sh". Settings for this file are "Fav, Boot". Nothing else checked (no Su flag as well). Only "Is script" checked.

Odd thing is, when I rebooted FTV, the "SuperSU" gave me a prompt to grant "SManager UID" application the su rights. I did not get that with "msd1.sh" when it was marked to run at boot. Not sure what is going on. The main "SManager" app was already listed in the SuperSU app list, but not this one with "UID".

Rebooted FTV couple of more times and mount is available for Link2SD. No more prompts from SuperSU and everything goes through as intended.

I wonder if the manual way of using the "install-recovery-2.sh" gets hung up on su rights, I never get any prompt in that case.

I did uninstall Titanium Backup from FTV, read a thread about it interfering with it (I will reinstall it and update the thread).

Anybody has any insights on this? It works now, but not sure why it works now Suggestion is to change the default in SuperSU app to GRANT and check its logs to see if something is going on there app wise. I will go back to the install-recovery-2.sh way with SuperSU in GRANT mode and see if it works.

Thanks,
[Fire TV General] realtuxen:
Hi,

I'm sorry but i've read the whole thread, and a couple of thing is puzzling me:

It's pretty simple actually. :)

Why 2 partitions on the USBstick, and which one needs to be the bigger one? Let's say i create two primary partitions which one needs to be the bigger one for utlitzing all the most space on my USBstick? Does partion 1 need to be the biggest or partition 2?

Anyone have some recommended sizes?

Thanks

Best regards
[Fire TV General] mrchrister:
Thanks for your work on this!

I just installed your script and was amazed at how smoothly it worked!

I installed Link2SD (free), did the preperation with the windows script, then looged into the shell and issued the commands. My ext4 formatted USB Stick was found and mounted correctly!

After reboot, it did not automount again. Manually issuing the mount command from msd2.sh seems to work!

I wonder if it could have anything to do with me using rbox xbmc which autostarts the firetv into xbmc?

any help would be awesome!
[Fire TV General] dbdoshi:
I don't think so, I have the same issue without the XBMC launcher. Please download the Script Manager and designate sd.sh as your boot script. That setup seems to work for me.
[Fire TV General] tavery:
I'm hoping I can get a little help here...

I installed Link2SD Plus (bought it from the Play Store) and had everything running last night through a powered USB hub. I had also set Link2SD to move the internal data of those apps to USB as well as set the default install location to USB. When I checked the AFTV a couple of hours later, all the apps that I had linked were not showing, and upon further inspection, my drive wasn't mounted anymore (single EXT4 partition 32GB flash drive).

I removed the links and then reinstalled all the apps and everything seemed to be fine... my plan was to forget about Link2SD for now and just use the USB drive as storage, so I formatted it FAT32 which I could mount with Stickmount.

Today, all of the apps that I thought I had removed the links to will flash and then close to the menu when I click to run them. So, I removed Link2SD, removed the boot script for it and then removed all the problem apps and attempted to reinstall them via adb to which I received an error saying [INSTALL_FAILED_INSUFFICIENT_STORAGE]. I do still have the terminal app installed and ES File Explorer if there is some sort of way to fix this. I'm guessing that the setting to install everything to USB is still active, even though I removed it last evening. Any help is appreciated. Thanks.

Update: Reset to factory defaults and re-loaded everything. Working fine.
[Fire TV General] dbdoshi:
http://stackoverflow.com/questions/...-failed-insufficient-storage-error-on-android

Scroll down to the second answer which begins with the explanation of apk installs.

I had the same issue, I went through all my system folders like data, mnt and searched for "xbmc" (mine was giving error for this app). Make sure you search for sub folders as well. Delete your Data/sdext2 folder. Go to UsbStorage on your emulated/0 and get rid of everything inside it. There could be shortcuts (or sym links) inside these folders that need to be deleted.

IF YOU ARE NOT SURE, DON'T DELETE AND POST YOUR FILES NAMES AND LOCATIONS HERE.

To be on safe side, delete one file/folder etc and try reinstall. And keep a log of your deletes (I didn't, but all worked out with bricking the FTV)

You might need to adb shell and remount your / for rw access.

Make sure you revert back to ro after the install goes through.
[Fire TV General] tavery:
Thanks for your help.

I had already reset the FireTV to factory defaults before I had read your post and reinstalled everything (with the exception on Link2SD) and it seems to be fine, hopefully it stays that way. I think I'll hold off playing around with it too much more until such time as a recovery is available. Thanks again.
[Fire TV General] Domunus:
Hello, first I want to say thanks for this setup!

However, I'm not having any luck getting it to work. I used the AL2SD script and it ran without a hitch. I was excited to see that the USB device was recognized in Link2SD, BUT after I rebooted it was gone. And no matter what I do at this point it's not showing anymore.

I tried to the Key command posted a few pages back even though you stated the script now has a check for that. Still no luck on getting the USB device to show in Link2SD anymore.

The usb device will show up when I run the script though as a device to choose and executes fine. Please help.:confused:
[Fire TV General] tselling:
It looks to me that the install-recovery.sh script is not being called by any init script on one of my Fire TVs, so that seems to be the culprit. Not sure why since its at the same version at the other 2 in the house. So I went looking for another script in /system/etc that is called on boot. I wound up adding my mount line (you could call your mount script instead) to /system/etc/init.qcom.post_boot.sh and my usb flash drive gets mounted fine on reboot.
[Fire TV General] dbdoshi:
Can you post your mount command you use in that file? Is there a specific location to put that command within that file? I haven't looked at it yet, hence the Q. I guess I will know when you post your command, curious if you are calling vold...
[Fire TV General] tselling:
I put it last in the file. I am calling vold after the mount command.
[Fire TV General] dbdoshi:
Thank you for the info. I will try it out later.
[Fire TV General] Domunus:
Thanks for the response tselling, i'll give it a try this weekend.
[Fire TV General] vogz:
Thanks for all your work on this. I'm a bit of a newbie and I just can't seem to get this to work. Everything seems to be going fine. I'm able to link an app with Link2SD. But when I reboot the link appears to be lost and the app won't load anymore. I'm not sure, but it appears Link2SD still recognizes the USB drive after reboot. Not sure what to do. Any help would be appreciated. Thanks.

Update: I got it working. I think it had to do with also having Stickmount loaded. Once I uninstalled it everything worked fine. The other possible mistake I made was not rebooting before linking apps to the USB drive.
[Fire TV General] TriOptimum:
Hi! Thanks for the program and easy to use script! I can't get it to work fully either though. Using the install script, the storage always disappears in Link2SD after reboot unless I run the script again. I tried doing a reset and firmware update, re-rooted, then tried it on the fresh install with no other programs but the ones required, still same results. Any ideas? For now I'm just running the last script in terminal every time I boot up :P.
[Fire TV General] nyder:
I had to do this to get mine to work on boot up.
[Fire TV General] t3ch42:
Hey guys.

Anybody had problems with permissions for the ext4 partition that is used? I gave up on using stickmount for that portion as it doesn't automount. With the /data/sdext2 mount from the msd2.sh script, I found that xbmc on the firetv can't access it being in the /data folder. What I did so that I could use it as external storage for xbmctorrent is make a simple script to create a symbolic link at /storage/emulated/sdext2 that is accessible to xbmc.

The problem is that is that all the files it creates in the folder have 700 permissions for the user 0u013 or something like that. Xbmc can read them, but nothing else can. I found that if I use the fat32 mount that the permissions are readable. With Fat32 though, I had error messages as xbmctorrent didn't like writing to it and the specified store folder was disabled.

For the ext4 mount, I can change the permissions later, but that's rather frustrating to have to do manually. Anybody have similar problems?

This is about the closest I've found to be able to use external storage as a save folder with the firetv.
[Fire TV General] nyder:
Okay, screw all this other stuff (as in what i had in this post, didn't want to double post)

I did a factory reset and then used the AL2SD script thingy.

Link2SD doesn't see the ext4 parition on the reboot.

64GB flashdrive

20 GB fat32

40 GB ext4

did the debug script. Attached below.

appreciate any help on nipping this problem in the bud.

I am on 51.1.02_user_510058520 firmware, not the latest rootable firemware if that matters.

thanks

okay, to add some more stuff. it wasn't loading the script at boot up apparently, so if i use smanager to have sd.sh loaded up at boot time (favorite, boot is the options I picked), then it can see the ext4 partition. But here is the deal, it will link stuff to that partition, move it over, but then on a reboot it no longer sees it, even though the data is where it moved it. And that was the problem i was having before when I did it the manual way from the first post.
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
Hi,

nyder - Let's start with you.

I have a various ideas for additional debug checks, and I'll add them to the debug script accordingly.

For now, can you perform a firmware upgrade (even to the same version you currently have) and then re-run the script ?
[Fire TV General] nyder:
Let's see if I understand this. You want me to do a firmware update (even if the same version) and rerun the script. What you are saying is a factory reset isn't good enough, correct?

I can of course, do anything. I remember a thread about doing manual updates, I'll have to find it. Also, would it be better for me going to the latest rootable firmware? I had stayed with what I had because I didn't want to mess anything up, but it's looking like maybe my version is just a tad different then other peeps versions (which I assume they run the later version) when it comes to this Link2SD locations stuff.
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
nyder,

If I'm right, a firmware update to any firmware should work (even your current one).

Details in this link:

http://xdaforums.com/showthread.php?t=2796067
[Fire TV General] nyder:
Okay, thanks. Think i will just upgrade to the latest rootable version since I can downgrade later if I need to.

Upgrade to the 1st 51.1.1.0 firmware (first one, not the update one) and now it sees the parition thru the reboot, but the apps you link thru Link2SD disappear on the reboot. Except if you go to the area they are being copied to, you can see the data files there. Here's mylog.txt if that helps.
[Fire TV General] SaltyCookie_OnLoan2FM_SVE:
nyder,

Good news on seeing the mount work on boot. That could explain why some members would not see the script run on boot (they didn't perform any firmware update before run the script, which is apparently required for install-recovery.sh to be run on every boot).

Now for the remaining issue you have:

- Use Link2SD on an app (one you haven't linked before), and once linked see if it can be run correctly (without rebooting).

- Then check for the same app after rebooting.