March 28, 2024, 07:22:01 AM

collapse

Author Topic: SUCCESS! The 64GB Question - How to move apps to SD card or flash drive?  (Read 19984 times)

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #15 on: August 18, 2012, 05:04:29 PM »
Unfortunately, I'm a newb at Linux/Unix, too.   I hope symlinks is/are the answer, or lead(s) us to the answer, rp1.  That will be my next research project. Thanks!
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #16 on: August 20, 2012, 08:43:49 PM »
OK, here's a link to a symlink thread on symbolically linking a folder in sdcard to an external flash drive partition, along with some of the caveats learned.  The OP was trying this on an Asus Transformer device, but it's tantalizingly close to what we want to do.
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline rp1

  • Newbie
  • *
  • Posts: 2
  • Popularity: 1
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #17 on: August 21, 2012, 02:18:43 PM »
lol well im glad i could help, i just dont remember as much as i should about the stuff i pulled in the Linux OS, but pls do research this, i want to know the linux file system again, it has exceptional real world applications, i once navigated a chinese language linux OS on a broken computer of a friend and knew where what was due to just simple "feel".

I want that again so i may be installing another Linux OS on it as a learning experience. So i was wondering if complete wipe of Nexus is done, will we have access to total 8/16gb? or is there some still reserved? Is there an actual linux arm based OS that works on it except for android? can there be dual boots? or booting off external USB with symlinks...?

oh and also in the link given for the asus transformer, its mentioned that Fat32 doesnt support symlinks, so again it needs to be seen if Nexus 7 supports any other filesystem in native or can be hacked to support it?

i hope my ramblings have given you a bit more ideas or understandings in your quest, PLS post anything you find so it may help us all?
« Last Edit: August 21, 2012, 02:46:33 PM by rp1 »

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #18 on: August 21, 2012, 07:49:11 PM »
So i was wondering if complete wipe of Nexus is done, will we have access to total 8/16gb? or is there some still reserved? Is there an actual linux arm based OS that works on it except for android? can there be dual boots? or booting off external USB with symlinks...?

oh and also in the link given for the asus transformer, its mentioned that Fat32 doesnt support symlinks, so again it needs to be seen if Nexus 7 supports any other filesystem in native or can be hacked to support it?

I guess you can pretty much do what you want to do setting up a bare Nexus 7.  If they partitioned it w/2GB for the OS & mandatory apps, you can repartition it.  You can choose your version of Linux/Unix - the sky's theoretically the limit.

I need to learn the quirks.  There is support for FAT32 file format with the vfat mount switch.  Who knows why it isn't supported with symlinks?
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #19 on: August 26, 2012, 03:10:14 PM »
It's time for a status update.  I downloaded Android Terminal Emulator and set about giving Linux commands to my N7.  In order to really isolate a symlink from conventional storage, I used Link2SD app's idea of creating a second primary EXT3 partition on my USB flash drive.  My Windows PC only sees the first primary partition on the flash drive.   Link2SD tries to mount the second partition at /data/sdext2, which makes it inaccessible to unrooted Android users.

The attached photo shows the mount command (green arrow) to mount the flash drive's second partition.  It's "mount -t ext3 -o rw /dev/block/sda2 /data/sdext2."  An incorrect mount command (red arrow) precedes it.  Before you run that command, you need to run something like Stickmount or USB Storage OTG apps to recognize the USB drive and put its partitions in /dev/block/sda1 and /dev/block/sda2, respectively.  You can let Stickmount mount the first partition automatically, but both apps want to put the second partition in the wrong place.  Thus the command above in this paragraph.

« Last Edit: August 26, 2012, 03:13:30 PM by birdastrompgman »
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #20 on: August 26, 2012, 03:55:15 PM »
The attached photo shows the successfully mounted flash drive partitions.  sda1 (red arrow) is the flash drive's first partition, mounted in sdcard/usbStorage/sda1. sda2 (yellow arrow) is the second partition, mounted in /data/sdext2, where Link2SD wants to see it.

Second photo shows that Link2SD sees the second partition with 14GB free memory.

I've done some experiments, without much success. 

Symbolic linking, or symlinking in Linux.  The command
ln-s /data/sdext2/iBird_Pro /data/media/iBird_Pro
#works to make symlink in /data/media/iBird_Pro
#but /mnt/sdcard/iBird_Pro link failed with
# lstat .'./iBird_Pro' failed: I/O error
#

Three of my apps have GB+ data directories.  I tried copying those data to the second partition, deleting their data directories, and symlinking them.  The apps didn't see them, and tried downloading them again.  The data ended up downloaded to the same original directories, not their symlinked doppelgangers. 

There's a lot of FUSE shimming going on with Android.  Our sdcard directory that is the base for unrooted users, is /data/media, which is also sdcard, which is/are FUSEd as /storage/sdcard0. etc is /system/etc, usbdrive is /mnt/usbdrive, vendor is /system/vendor, and the d directory is /sys/kernel/debug.  The /data/media symlink holds when checked with ls and ls -l (long) directory listings.  But the /sdcard and /storage/sdcard0 lists show the data directories under ls, but not ls -l listings.

I need to learn more about FUSEing, and experiment more with workarounds for symlinking.
« Last Edit: August 26, 2012, 04:12:36 PM by birdastrompgman »
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #21 on: August 26, 2012, 04:32:53 PM »
Failing to successfully symlink by myself, I tried Link2SD's automated symlinking.  Link2SD claims the ability to move apps, their data, and their libraries to the second partition, and symlink them.  See the attached photo/screen capture.  Unfortunately, none of the linked apps survived the process.  I knew I'd have to make new shortcuts, but every link I've tried has been broken.  Every linked app has failed to run.  Maybe if I re-read the app's documentation, I'll discover some logic flaw in my thinking, but I don't think I'm missing anything.
« Last Edit: August 26, 2012, 05:45:59 PM by birdastrompgman »
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #22 on: August 28, 2012, 02:07:44 PM »
I gained .5GB of storage space today, a small, but significant, step forward.  Gaining 25% more available storage is GOOD!  Link2SD put up a software version 2.2 update today that:
Quote
2.2
- fixed file permission bug that causes linked apps to FC on Jelly Bean
- added external SD information in "Storage Info" page (if presents)
- updated translations

It fixes the broken link problem.  The linked apps now run properly, both from the home screen and apps screens shortcuts.  I linked 24 apps to my second partition, and went from 2.45GB free space to 2.98GB free space of my N7's 5.92 GB storage.  Some of it went to my second partition, which had 13.54GB available before the links, and 13.30GB after linking.

My data hogging astronomy and birding apps still insist on seeing their massive (2GB) data files on the N7's OEM memory, unfortunately.
« Last Edit: August 28, 2012, 02:37:17 PM by birdastrompgman »
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #23 on: August 29, 2012, 10:51:54 AM »
Unfortunately, the Link2SD app still needs some work.  It doesn't mount the second partition automatically at boot, so I have to do it manually (or eventually, with a script.)  That failure to load at boot means Link2SD fails to link the apps it moved/linked in the second partition, and 1) they're unavailable, 2) their links are lost - permanently

It has a setup choice to rebuilt its mount script, but when I choose it, it fails to see the unmounted device at /dev/block/sda2, where it resides.
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline frank

  • Jr. Member
  • **
  • Posts: 69
  • Popularity: 5
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #24 on: September 04, 2012, 07:38:58 PM »
I think this does what you want?  Haven't tried it myself.
http://forum.xda-developers.com/showthread.php?t=1869944

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #25 on: September 04, 2012, 11:04:42 PM »
Thanks, Frank.  It may be more useful to me, since my astronomy and birding apps have huge (~3GB) data files.   I think your link may do it.  It will be my next project.

Another update on my link2sd project. 

I installed it on my rooted Nexus 7 tablet running Android 4.1.1.  I partitioned an ext3 second primary partition, mounted it with the Linux command

mount -t ext3 /dev/block/sda2 /data/sdext2

and was able to link and run apps while freeing up space on my external sdcard storage.

But when I rebooted, link2sd could not find the second partition, and all my links were lost.

When I try the link2sd menu option "Recreate mount scripts," I get an error message saying

Second partition not found
/dev/block/ device not found
Make sure you have two partitions on your SD card and both are primary

However, link2sd gives me that message even when my SB drive's second partition is present at /dev/block/sda2

Part of my problem is the Nexus 7 does not come with an SD card slot, and it does not come with native USB-OTG support. I use the Stickmount app to mount my USB drive's first partition, and it puts the second partition in /dev/block/sda2. 

My other problem is link2sd tries to modify files that don't exist. I do not have init.d or install-recovery.sh files on my Nexus 7.  A search for "init." finds

/init.goldfish.rc
/init.grouper.rc
/init.grouper.usb.rc
/init.rc
/init.trace.rc
/init.usb.rc
/data/local/tmp/init.rc
/etc/init.goldfish.sh

A search for "install-recovery" finds three .bak files with August 2012 dates, all apparently created by other apps, since my Nexus 7 shipped with June 2012 software build dates.
/data/media/backups/install-recovery.sh.bak
/etc/install-recovery.sh.bak
/mnt/sdcard/backups/install-recovery.sh.bak

Other than the /etc/init.goldfish.sh script file, the only other .sh script file on my Nexus 7 is  /system/bin/bugmailer.sh

I've written the app's developer, hoping he'll suggest what mount scripts I should write, and where (in what files) I should insert them.
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline lionsh

  • Newbie
  • *
  • Posts: 1
  • Popularity: 1
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #26 on: September 05, 2012, 01:23:48 PM »
Hi,

I think there is a simple solution to your problem and i registered just to let you know  ;)
I have the Nexus 7 8GB, rooted.
I bought NOVA3 game which has 2GB files.
I searched everywhere how to move these files to USB storage.
Finally, I found this:
http://forum.xda-developers.com/showthread.php?t=1410262

Basically, instead of using symlinks you can use mount, and the best thing there is a nice and simple app for that :)
And you can mount on demand only when you use the app.
So just install the app. D\L all the files that are stored on internal storage. attach the USB OTG storage.
Create a mount (check the option to copy the files) and voila.

Hope it helps.

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #27 on: September 05, 2012, 03:08:16 PM »
Thanks, lionsh. Frank's link leads to the same solution, so I think you both are on the same track. I will be checking that out later today. Thanks for registering just to help me out. I greatly appreciate it!
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
SUCCESS!: The 64GB Question - How to move apps to SD card or flash drive?
« Reply #28 on: September 07, 2012, 07:16:10 PM »
The Directory Bind app linked above did the trick.  I saved 2GB of my 8GB OEM memory by moving my three largest data directories (used by one astronomy and two birding apps) to my USB flash drive, and binding their new source directories (and subdirectories) to their original target directory locations.  All three apps are able to find their data after reboots, and after unplugging and reconnecting the USB flash drive while my N7 is running.

I went from 1.33GB free memory to 4.15GB after removing a CWM backup (~1GB), and the three data directories.  It took me 2 months to get my N7 where I want it, but I think I'm there (for now)!
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: SUCCESS! The 64GB Question - How to move apps to SD card or flash drive?
« Reply #29 on: September 09, 2012, 11:14:30 PM »
Directorybind isn't an easy app to use.  You, the user, have to identify the locations of the largest data directories to bind. I used SD Card Storage Optimizer to find those files and directories.  On the good side, if I want to bind the following directories:
 /mnt/sdcard/Android/data/com.southernstars.skysafari_pro/
 /mnt/sdcard/Android/data/com.southernstars.skysafari_pro/files/
 /mnt/sdcard/Android/data/com.southernstars.skysafari_pro/files/skydata/
 /mnt/sdcard/Android/data/com.southernstars.skysafari_pro/files/skyimages/

I only need to bind the trunk directory, and all the upper branches get bound
 /mnt/sdcard/Android/data/com.southernstars.skysafari_pro/
to a similar directory on my usbdrive
 /mnt/sdcard/usbstorage/sda1/Android/data/com.southernstars.skysafari_pro/

The directorybind app developer mounted his external drive at /sdcard/external_sd/ but I used Stickmount's default location, /mnt/sdcard/usbstorage/sda1/, which is where it mounts my USB flash drive's first partition.

I copied all the files from
 /mnt/sdcard/Android/data/com.southernstars.skysafari_pro/
to my flash drive's first partition
 /mnt/sdcard/usbstorage/sda1/Android/data/com.southernstars.skysafari_pro/,
deleted the original data tree above the trunk, bound the empty trunk directory as the source directory, and the flash drive tree as the target directory(ies).

It worked like a charm.
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

 


* Top Boards

* 'Like' And 'Follow' Us!

* Top Posters

bjs229 bjs229
2682 Posts
S.Prime S.Prime
2017 Posts
Babyfacemagee Babyfacemagee
1263 Posts
matt matt
936 Posts
birdastrompgman birdastrompgman
840 Posts
loociddreemr loociddreemr
708 Posts
radiocycle radiocycle
653 Posts