The #1 Nexus 7 News, Discussion and Fan Site!
2012 Nexus 7 Discussion Forums (1st Generation) => Nexus 7 Root, Hacks, Mods And Development => Topic started by: birdastrompgman on August 08, 2012, 02:02:26 AM
-
I rooted my N7, bought a USB-OTG cable, flash drive, and downloaded Stickmount. It recognizes the flash drive, and mounts it as sdcard/usbStorage/sda*/. I can read the files already stored on any flash drive, but the free storage (64 GB, for example) on the flash drive isn't available to any of the 4 different Move2SD or file explorer apps I used. ES File Explorer, for instance, sees the autorun and introductory files on a new flash drive, or the 61 files on the flash drive I carry in my pocket. Its SD card analyzer, however, shows the same 5.92GB of total storage space whether I put a 16GB or 64GB flash drive into the OTG cable. None of the Move2SD apps are configurable to let me change their default SDcard destination.
Changing the apps backup directory to sdcard/usbStorage/ doesn't help. Turning on the USB debugging developer option doesn't help.
I tried to find/install an app that will let me create a second partition on my flash drive. Link2SD mentions three partitioning apps: minitool, paragon, and easeus. I couldn't find minitool or easeus on Google Play. Paragon failed to download, giving me an insufficient space error message.
So, can someone tell me an app that will allow me to create another FAT32 partition on my flash drive? Is there another workaround to access my USB flash drive?
-
Do I have to write a script? Do I have to run a kernel with ums? Does Jelly Bean have native ums support?
I assumed that Stickmount seeing the SDA1 directory (A=drive, 1=partition 1) meant I'd have access to that drive and partition. So, creating another partition will just give me an SDA2 directory that I can read files in, but not write files to?
-
I think I'm almost there. I found easeus, which is a Windows program, on CNET. I used it to partition my flash drive into two primary FAT32 partitions, and formatted them. I also found a USB Mass Storage OTG app for the N7. More tomorrow.
-
The problem is Stickmount and USB Mass Storage Watcher OTG put the flash drive partitions in different places than where the various move2SD apps expect to see them.
Unmounted, they're in /dev/block/sda1 and /dev/block/sda2
Stickmount mounts them in /sdcard/usbStorage/sda1 and /sdcard/usbStorage/sda2
USB Mass Storage Watcher OTG lets you put the partitions in /usbOTG/mnt/sdcard or /usbOTG/mnt/usbdrive or a new folder of your choice under /usbOTG/mnt/
Link2SD tries to unmount the first partition, and tries to use install-recovery.sh and init.d scripts to mount the second partition at boot to /data/sdext2/, but it doesn't see them.
I tried disabling Stickmount and using USB Mass Storage Watcher OTG to leave the flash drive partitions unmounted. Link2SD still didn't see the flash drive.
I never got App2SD to work. I selected apps and tried to move them. The app pulled up the app info settings for every selected app. I didn't know what to do, so I tried clearing data and caches, forcing stops, and uninstalling apps. It made no difference. the apps never moved. Worthless app, with no documentation what it's doing.
DroidSail Super App2SD wouldn't install, giving an insufficient space message, despite 5.92GB of available space.
I'll probably end up writing scripts to mount the second partition where Link2SD wants to see it, but I'll try some more bespoke apps first.
-
Well it didn't work. Here's the script I wrote, placed into the sdcard directory as link2.sh, and executed. Link2SD still doesn't see the flash drive.
mount -t vfat /dev/block/sda2 /data/sdext2
So, what's the story with the rest of you? Nobody else has a a flash drive or external memory card hooked up to their N7 and working? If you do, now is the time to tell us how you did it.
-
I got tired of trying to find a canned program to move my apps to my flash drive. The canned programs all make (often wrong) assumptions based on cell phone architecture.
I started moving them manually. So far, I've managed to move 5 of them successfully. It's pretty simple - just move the .apk file over to the mounted flash drive location, and make a directory for the associated data files, if necessary.
So, I'm going to repartition my flash drive and complete the process. Right now it's a 32GB drive split into two 15 GB partitions, and nothing is seeing partition 2. So I'll make a 24 GB partition 1 and a 6GB partition 2 in case some day I can use #2.
-
Not sure I follow with what your trying to achieve here, are you planning on leaving the flash drive permanently attached because the moved apps you will only be able to use when it's connected?
Apps don't really take up that much space compared to files we use like game data and that goes on the internal memory (sdcard), movies, music, pictures, porn etc... ;)
Am I missing the point?
-
I have an 8GB N7 with <3GB free space, so the 24GB partition would be handy. I run an astronomy program that loads 1.4GB of compressed & uncompressed data files, and that would free up a lot of storage if I could move it. Similarly, I run a couple of data-intensive birding programs I'd like to place on the flash drive. I wouldn't have to plug it in when I'm web surfing or gaming on an airplane - just on the astronomy field or when birding in a new area.
Back to the drawing board. The .apk files are installation packages. When run on the flash drive, they install apps back in my 8GB internal memory.
-
That's fair enough I knew there would be a valid reason.
-
I know the apps2sd thing was very popular in the past android versions where the apps partition was separated from the data partition, so you could only install a limited amount of apps. On my archos tablet, that was ~300 mb if you didn't root, so apps2sd allowed you to move the app to the "SD" which was just another part of the internal storage. You couldn't move them to an actual SD card, even though the device had the card slot. Its all semantics and not very straightforward.
Unless there's some new way to use it with android 4.0 and later, I don't think any apps2sd is going to help you out. Hope you find something though.
-
Thanks. I'm new to Android, so I wasn't aware of that history. At leas some of the apps seem to have managed to move apps to external usb storage in a second partition mounted in /data/sdext2. I need to find the error in my linux script. I suspect it's in my device definition, so I may just try another script to move the stickmounted second partition, rather than trying to mount the unmounted device.
-
Im still on the fence weather to root or not to root. My main reason for rooting would be to expand space for more apps on my 8gb nex7 via stick mount. If this isn't possible I definitely will not root. Bird, please keep posted on your progress in this matter. If you achieve thus feat please let me know via this thread. Thnxs
-
Every path of investigation comes to the same dead end. Android "external memory" refers to a partition in the soldered-in memory chip in your device. USB plug-in memory hasn't been successfully spoofed/mounted in place of the OEM memory, AFAIK.
USB memory is best used to store large media files, like movies, books, and music.
-
hello
i signed up specifically because of this as iv been wanting to buy a nexus 7 but it isnt available in my country in
an affordable price range and am hoping to buy one soon, and this is the main problem that i see coming up given
the size of the programs and games available for mobile OSs.
I messed a little with linux in my time and was thinking, and it may be wholly and solely wrong due to my inexperience
with the Android OS or Linux in general, i was thinking:
What not create symlinks? i remember doing it for a few distros i ran, esp for mounting problems and disappearing shortcut
files, it might work in this scenario as it is already rooted, and maybe we are able to install tools allowing for proper
file handling and distribution in Android 4.1?
IIRC it wouldnt take the same amount of space but did only leave a sort of shortcut for the program to access it
but atleast when i did it, it had to be created by hand, i do not remember if it accepted whole folders as symlink,
but i think it might, or we could just make a small script that mounts all the files manually, whenever the program shortcut
is accessed, it might slow down the process somewhat but in the end it IS saving space
i hope to god i havent made a fool of myself :P
-
I have seen some discussion at xda on creating symlinks, so with my limited Linux knowledge, I do know that it is possible.
-
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!
-
OK, here's a link to a symlink thread on symbolically linking a folder in sdcard to an external flash drive partition, (http://forum.xda-developers.com/showthread.php?t=1442729) 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.
-
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?
-
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?
-
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.
-
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.
-
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.
-
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:
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.
-
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.
-
I think this does what you want? Haven't tried it myself.
http://forum.xda-developers.com/showthread.php?t=1869944 (http://forum.xda-developers.com/showthread.php?t=1869944)
-
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.
-
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 (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.
-
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!
-
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)!
-
Directorybind (http://forum.xda-developers.com/showthread.php?t=1410262) 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.
-
I get stick mount to work and nexus media worked for streaming without root. I am using my sticks in a conventional manner though. I am not manipulating the partitions.
-
Here's a screen capture of my Directory Bind app screen, showing what it looks like. T=target, the (now virtual) location where the app is looking for its data. S=source, the actual location where the app data files are stored on my flash drive.
(http://i1179.photobucket.com/albums/x397/BestmpgxB/2012/directorybind.jpg)
-
it took me awhile but following the birdmans efforts i have managed to get directory bind up and running :D
moved my backups to a 32gig flash drive.
-
Cool, Commodore128. Now if I could only get it to work with Android 4.2. I had to revert to 4.1.2, since Directory Bind and apps are stymied by 4.2's emulated directory structure.
In 4.2, I could get Directory Bind to bind the true source directory path (/mnt/shell/emulated/0/usbStorage/sdb1/xxx) to the fused/symlinked/emulated target directory path (/sdcard/xxx) on second mount (sdb1, NOT sda1), but apps didn't see their data. I think it would work in 4.2 if Directory Bind would accept the true target directory path, but since Directory Bind is no longer supported by its developer, that isn't likely to happen.
I hear there's a hacker warez called Lucky Patcher that supports directory binding. Until I check it out, I'm sticking with 4.1.2 and Directory Bind.
-
i'll have a look for lucky patcher--should also have mentioned runng AOKP milestone build 1--4.1.2
pity directory bind will no longer be supported.
that's life i suppose ??
-
Word is Lucky Patcher doesn't work with 4.2, either. The Directory Bind developer is an anomaly. It's his only product, & he never intended to support it.
I'm not the lowest of the low, but I am the slowest of the slow (49.6 mpg over 38k miles in Scion xB)