FORUMS
Remove All Ads from XDA

CWM Flashable: Mount external USB storage to /data and /sdcard

211 posts
Thanks Meter: 47
 
By jmandawg, Senior Member on 27th September 2014, 06:08 PM
Post Reply Email Thread
The goal of this was to swap /data and /sdcard with usb storage so that i could install unlimited apps and games. Swapping them does come at the price of speed as the usb interface is not as fast as the internal storage. Bascially you could do the same thing with stickmount and link2SD, but then you have to deal with stickmount and link2SD....

This is based on croniccorey's "INT2EXT+" script located here: http://forum.xda-developers.com/show....php?t=1716124

Thanks to rbox for recovery and jocala for UUID idea.

Warning: This will make your fireTV run slower. This works best on a clean install, but should work either way. You may see a pixelated screen on first boot and it will take a few minutes while files are copied to USB, just be patient.

There are now 3 versions of the scirpt pick your poison:

1. the original MountDataToUSB which mounts your USB drive to /data (except /data/misc). This is the total solution for external usb drive hard drives plugged into powered hub only. External Hard Drives only, DO NOT USE WITH USB THUMB DRIVE.

2.. MountPartialDataToUSB Same as #1 except it leaves /data/misc /data/system and /data/data mounted to internal storage. The downside is when you install new apps some stuff does get installed to /data/data which takes up internal storage space. Tested with USB 2.0 thumb drive and UI seems as fast as stock.

3. MountMediaToUSB which mounts your USB drive to ONLY /data/media (and the fuse mount point /sdcard) expanding where game OBB files are stored (similiar to sticking an SD Card in your phone). This should be about as fast as stock fireTV except when accessing data off /data/media but this doesn't expand /data/app




I've made this into a CWM flashable now to simplify things. You need to have the following pre-requisites:
Quote:

1. Rooted with rbox's CWM recovery installed

2. ext4 formatted usb drive I recommend using the full drive, but it should work as long as it's the first partition
(google how to do this).

3. This script won't work with multiple drives plugged in as it mounts /dev/block/sda1 which is the first drive detected Mounts by UUID now so you can use jocala's BusyMount script to mount other drives after.

4. The ext4 forrmatted drive must be the only drive plugged in when flashing the zip because it grabs the UUID off of it while flashing.



Instructions:
1. Plug in ext4 formatted USB Drive
2. adb reboot recovery
3. Factory Reset (optional but recommended, some users have reported errors if they don't. Also first boot will take longer while it copies all files from data). If you factory reset make sure you are blocking updates.
4. Flash zip in CWM. MAKE SURE THAT ONLY YOUR DRIVE YOU WANT AS DATA IS PLUGGED IN WHEN YOU FLASH v3.0 and newer zips THAT IS WHEN THE UUID IS READ and stored.
4. Reboot (first boot may take a few mins while files are copied, pixelated screen may display for couple minutes be patient). May be very laggy while it is downloading everything from the cloud to your usb drive, but should speed up a bit after it's done.
5. a. If using full data mount - Check System about for available disk space .
b. if using Media Mount only - run this command from shell and view available storage on media:
Code:
root@android:/ # df
Filesystem             Size   Used   Free   Blksize
/dev                   974M    48K   974M   4096
/mnt/secure            974M     0K   974M   4096
/mnt/asec              974M     0K   974M   4096
/mnt/obb               974M     0K   974M   4096
/storage/usb           974M     4K   974M   4096
/system                756M   723M    33M   4096
/data                    5G   946M     4G   4096
/persist                 7M     4M     3M   4096
/cache                 756M    13M   742M   4096
/firmware               63M     7M    56M   16384
/data_fire               5G   946M     4G   4096
/data/media             15G   750M    14G   4096
/mnt/shell/emulated     15G   750M    14G   4096
/storage/emulated/legacy    15G   750M    14G   4096


Details: When the script first starts it waits up to 30 seconds for /dev/block/sda1 to come up. If it doesn't come up (or if the usb drive is not plugged in) then it boots from internal storage. It then checks for the folder "/data" on the usb drive, if it doesn't exists it copies the files from the internal storage to the USB drive. Everything under /data is mounted to usb storage with the following exceptions /data/dalvik-cache /data/misc and /data/resource-cache

IMPORTANT: The internal storage is mounted to /data_fire if you need to flash anything in CWM copy it to /data_fire/media/0/ as CWM does not see the ext4 usb storage

I've also included a revert script (REVERT_MountSDCARDtoUSB.zip) to undo the changes in case something doesn't work. Just flash with CWM.

If you have issues check/post the output of /storage/usb/moutUSB.log

Just be aware if you update the firetv image with one of rbox's pre-rooted roms you have to re-flash this zip after right after.

Quote:


Change log:

Update 2014/11/18 - v3.1 - Recommended Added KhoaTon's fix for drives with a LABEL set. See post 163 in this thread for details.

Update 2014/11/03 - v3.0 - All versions now mount by UUID. Synced all version numbers. Fixed bug in MountMediaToUSB. MAKE SURE THAT ONLY YOUR DRIVE YOU WANT AS DATA IS PLUGGED IN WHEN YOU FLASH v3.0 zip THAT IS WHEN THE UUID IS READ.

MountPartialDataToUSB_v1.0.zip [For usb thumb drives or Hard drives] Same as MountDataToUSB_v2.5 except it leaves /data/misc /data/system and /data/data mounted to internal storage. See notes above for specifics.

MountMediaToUSB_v1.0zip [For usb thumb drives or Hard drives] - Mounts only /data/media to the USB drive. Should should keep most of everything at normal speed, and expand /data/meda and /sdcard storage. This is where OBB files for games are usually stored.

MountDataToUSB_v2.5.zip [For external hard drives ONLY]- Same as v2 except re-named zip to MountDataToUSB.zip and re-named script and log file to "mountUSB.sh" an "mountUSB.log". Also fixed permission on /data_fire/media/0 so it's easier to push files directly to it for flashing in CWM. Fixed bug with /data/media/0/0 folder.

v2.MountSDCARDtoUSB.zip - (originally posted on page 3) mounts everything except for /data/misc to the usb storage

REVERT_MountSDCARDtoUSB. - Flash this to revert back to normal.

The Following 14 Users Say Thank You to jmandawg For This Useful Post: [ View ] Gift jmandawg Ad-Free
 
 
27th September 2014, 06:30 PM |#2  
Recognized Developer
Thanks Meter: 2,098
 
Donate to Me
More
Quote:
Originally Posted by jmandawg

I DO NOT RECOMMEND ATTEMPTING THIS UNLESS YOU ARE FAMILIAR WITH THE COMMAND LINE

I would also highly recommend making sure your recovery is working
27th September 2014, 06:33 PM |#3  
OP Senior Member
Thanks Meter: 47
 
More
good point
27th September 2014, 07:54 PM |#4  
Senior Member
Thanks Meter: 75
 
More
This is exactly what Ive been waiting for.. I want to attach a 1TB USB drive to my Fire and just call it a day. I dont even care about storing movies on it or anything.. I pull from my NAS and that has 12TB in it. I just want to be able to install as many apps as I want without running out of room.

I hope this finds its way into the AFTV Tool.. Im too lazy to do this on my own. When you do this kind of crap 50-60 hours a week, reading the forums is about as much as I want to do with computers when I get home.

Anyway, thank you for your hard work! Thats awesome!
29th September 2014, 05:27 AM |#5  
CLran619's Avatar
Member
Flag san diego
Thanks Meter: 11
 
More
so this essentially allows apps to be installed directly onto an external without using apps to foldermount
29th September 2014, 11:28 PM |#6  
jocala's Avatar
Senior Member
Flag Ocala
Thanks Meter: 2,359
 
Donate to Me
More
Nice work.
15th October 2014, 01:50 AM |#7  
Member
Thanks Meter: 19
 
More
This method works like a champ. I did a fresh install and started with the basic items i needed. After that, copied the files over to my usb, and finished the rest.
I have 29gb space showing up in my storage and have no errors or problems with operating. This is a great way to bypass the 5.45gb of free space on a firetv.
Not sure why this isnt more visible on the front page. Great work!
15th October 2014, 04:50 PM |#8  
OP Senior Member
Thanks Meter: 47
 
More
Quote:
Originally Posted by t3ch42

This method works like a champ. I did a fresh install and started with the basic items i needed. After that, copied the files over to my usb, and finished the rest.
I have 29gb space showing up in my storage and have no errors or problems with operating. This is a great way to bypass the 5.45gb of free space on a firetv.
Not sure why this isnt more visible on the front page. Great work!

Just be aware if you update the firetv image with one of rbox's pre-rooted roms you have to re-copy over the install-recovery-3.sh script and add the line to start it back into /etc/init.bueller.sh.
Maybe I will put those 2 things into an update.zip when the next rom is release.
15th October 2014, 07:49 PM |#9  
Recognized Developer
Thanks Meter: 2,098
 
Donate to Me
More
Quote:
Originally Posted by jmandawg

Just be aware if you update the firetv image with one of rbox's pre-rooted roms you have to re-copy over the install-recovery-3.sh script and add the line to start it back into /etc/init.bueller.sh.
Maybe I will put those 2 things into an update.zip when the next rom is release.

You should really just need to rename it install-recovery.sh.
15th October 2014, 08:30 PM |#10  
OP Senior Member
Thanks Meter: 47
 
More
Quote:
Originally Posted by rbox

You should really just need to rename it install-recovery.sh.

From my experience, It won't work, that script is called too late and sometimes not at all. But feel free to prove me wrong, once i got it working i kinda left it as it was.
15th October 2014, 09:05 PM |#11  
Recognized Developer
Thanks Meter: 2,098
 
Donate to Me
More
Quote:
Originally Posted by jmandawg

From my experience, It won't work, that script is called too late and sometimes not at all. But feel free to prove me wrong, once i got it working i kinda left it as it was.

Oh I see, the original instructions included editing the init. I thought you were using the mechanism that was in the install-recovery that came from supersu.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes