The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

Discuss AppStore Apps | Browse / Search Cydia | MMi Cydia Stats




  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > Native iPhone / iPod Touch App Discussion
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 04-11-2008, 01:12 PM
What's Jailbreak?
 
Join Date: Mar 2008
Device + Firmware: iPhone 1.1.3
Operating System: Windows XP
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Saving space by moving applications to /var

Guys, I am posting this hoping that it might become of use for all of you. I have read a big deal on how to move applications from the root partition that only has up to 20 usable MB, to the /private/var parttition, which is soft linked as /var and has GBs of available space.

After reading a lot of posts, I understood that the easiest trick was to move the whole /Applications folder to /var and then creating a soft link to /Applications for the /var/Applications directory; however after making this tidy movement, the Installer application would become unusable because of the 'main script execution error', which is pretty much unrepairable --or not easily at least.

Not an application would complain for being in /var/Applications (and soft linked in /Applications) but Installer, which is pretty bad since I could no longer install, delete or update any application. I moved Installer and all the applications back from /var to /; however Installer wouldn't work any more. I had to restore mi iPhone in order to make the Installer work --no applications left after performing the restore though.

So, I came up with this idea: what about moving all the applications but the Installer? I created a script that would do this by moving all the applications but the installer and then, after moving the applications, it would create a soft link to /Applications for each application located in /var/Applications. This would make all the applications accessible to the OS and Springboard as if they were never moved at all.

The script has been working great, and now I have hundreds of applications and the Installer has been working flawlessly.

If you feel like you need to install all the dictionaries, games, thesaurus, utilities, development and networking tools, etc, just as I do, this script is for you. You'll need to execute it after installing some applications or after each time you install a new application, is up to you. I used to install several applications and at the end I would simply run the script once; however I ended up installing a crontab that would run the script by my once a day =')

Installing the script
You need to have previously installed System/OpenSSH using Installer, for enabling SSH connections to your iPhone/iPod touch and System/BSD Subsystem so that all the commands and utilities needed can actually work.
Connect to your phone using putty or SSH Secure Shell as root. Password for mine is default password, which is 'alpine'.
After logging in, create the bin directory

# mkdir -v bin

Note that the '-v' will give you feedback on what is created.

Using vi or nano (nano is easier), write a file inside the bin directory you just created called move-apps:

# vi bin/move-apps #then insert the content or alternatively use nano:
# nano bin/move-apps


Insert the following content in the file you just opened for writing using vi or nano

#!/bin/bash
# space saver script for iphone
# Gerardo Costilla
# version 1.01 - fixed the target of the soft links,
# that was being set to . instead of /Applications

find /Applications -maxdepth 1 -mindepth 1 ! -iname "installer.app" -exec cp -rf {} /var/Applications \; -exec rm -rf {} \; 2>&1 | grep -v "are identical"
find /var/Applications -maxdepth 1 -mindepth 1 -name "*app" -exec ln -sv {} /Applications \; 2>&1 | grep -v "File exists"


Now make the script executable

chmod +x bin/move-apps


Running the script
Now login to your iPhone via SSH using SSH Secure Shell or Putty and execute the script by typing

# move-apps #note that you might need to execute it as bin/move-apps, depending on your path configuration


Running the script without using SSH Secure Shell nor Putty
You might want to install System/Term vt1000 from Installer and issue the command as root after installing some applications. I can't switch to root using 'su -' so I log in as root using ssh from the Terminal and then I execute the move-apps script.

To log in as root from terminal, using ssh, type from the prompt the following command. The password for my configuration is 'alpine'

$ ssh root@localhost


Automating the script
In order to avoid executing the script at all, I installed a command to root's user crontab, that will execute the script everyday at 05:00 AM - I am allways sleeping at this time, so this is a great time for the iPhone to work on it. Since the script is incredibly efficient and fast, you could even configure it to run it every minute without any concerns, however since your iPhone/iPod touch runs in batteries, the most you can save will always pay back.

Note that you need it to install it as root (if you are using Term vt100 to connect, you might be logged not as root [if your prompt is '$' instead of '#', then you ARE NOT logged as root]). Enter the 'whoami' command to ask the OS your user name, if you are not sure.


# crontab -e # vi will be launched, insert the following
00 05 * * * ~/bin/move-apps &> /var/move-app.log


[CONS]
There is also a great or not so good thing (its up to you) about relocating applications: whenever you delete an application using Installer, Installer ends up removing a soft link which will make it invisible for SpringBoard; however the application will remain in the big (/private/var) partition. After removing an application using Installer, if you want to absolutely delete it from the filesystem, you'll need to remove it by hand using 'rm -r'

To delete AppFlow.app, after unstalling it using Installer, issue the following command after sshing as root to your iPhone:

# rm -rv /var/AppFlow.app


Note that the 'r' in -rv will delete a folder and the 'v' will give you beedback on what is being deleted.

Short vi tutorial cheat sheet
* press [esc] and [i] to start inserting text
* only press the right, up, left and down keys AFTER pressing [esc]
* press [esc] :wq to save the file and quit vi
* press [esc] x to delete a character
# press [esc] dd to delete a line

Last edited by costicost; 04-11-2008 at 01:25 PM.. Reason: fixed the target of the soft links that was being set to . instead of /Applications
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #2  
Old 04-19-2008, 01:27 AM
What's Jailbreak?
 
Join Date: Mar 2008
Posts: 25
Thanks: 0
Thanked 1 Time in 1 Post

hmm~~great work, but too bad there are one app that do the exact samething....bosstool....
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #3  
Old 04-23-2008, 12:14 AM
What's Jailbreak?
 
Join Date: Mar 2008
Device + Firmware: iPhone 1.1.3
Operating System: Windows XP
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
What about Installer?

Quote:
Originally Posted by phillipxenxciel View Post
hmm~~great work, but too bad there are one app that do the exact samething....bosstool....
The thing is... does BoossToool will render Installer unusable? I think it will.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #4  
Old 04-23-2008, 12:37 AM
MattMac's Avatar
My iPhone is a Part of Me
 
Join Date: Dec 2007
Device + Firmware: 16GB 3G iPhone - 2.2
Operating System: OS X 10.5.5 | Win XP Pro
Location: Melbourne, Australia
Posts: 740
Thanks: 83
Thanked 87 Times in 71 Posts
Send a message via MSN to MattMac

No it doent. I used to use bosstool, but I did have problems with it. By far, the best way to do this would be just to install Cydia. Cydia moves the Applications folder to the /var/stash directory at install... This allows you to use the larger of the two partitions to install more apps.

Cydia is a great app, just like Installer but with some differences, and you can use Installer and Cydia together without any clashes.

Cydia's repo is: http://apptapp.saurik.com/

Last edited by MattMac; 06-02-2008 at 07:06 AM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
The Following User Says Thank You to MattMac For This Useful Post:
bdecorsey (06-06-2008)
  #5  
Old 04-23-2008, 08:16 AM
bhz1's Avatar
Moderator
 
Join Date: Sep 2007
Device + Firmware: iPhone 3G, 3G[S]- 3.1.2 JB
Operating System: Windows XP,Vista, OS X 10.5.8
Location: Pennsylvania
Posts: 2,395
Thanks: 82
Thanked 318 Times in 248 Posts

What i have noticed since I used Cydia do move the applications to /var/stash, when I am in WINSCP, I no longer can click on /Applications and automatically move to the /var/stash/Applications directory. All my apps work and i know where to find them, it would just be nice if WinSCP cooperated.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #6  
Old 04-24-2008, 02:08 AM
MattMac's Avatar
My iPhone is a Part of Me
 
Join Date: Dec 2007
Device + Firmware: 16GB 3G iPhone - 2.2
Operating System: OS X 10.5.5 | Win XP Pro
Location: Melbourne, Australia
Posts: 740
Thanks: 83
Thanked 87 Times in 71 Posts
Send a message via MSN to MattMac

Quote:
Originally Posted by bhz1 View Post
What i have noticed since I used Cydia do move the applications to /var/stash, when I am in WINSCP, I no longer can click on /Applications and automatically move to the /var/stash/Applications directory. All my apps work and i know where to find them, it would just be nice if WinSCP cooperated.
I'm not sure why that happens... It creates a soft link so it shouldn't have any problems... It works fin on my computer, but I use a Mac and Cyberduck. Maybe its just WinSCP. Can you navigate to /var/stash? Lol, this is why I love Macs, Windows never co-operates.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #7  
Old 04-24-2008, 09:36 AM
bhz1's Avatar
Moderator
 
Join Date: Sep 2007
Device + Firmware: iPhone 3G, 3G[S]- 3.1.2 JB
Operating System: Windows XP,Vista, OS X 10.5.8
Location: Pennsylvania
Posts: 2,395
Thanks: 82
Thanked 318 Times in 248 Posts

Yes I van navigate to /vat/stash and do anything with the file I might want. I just have to figure out thats where everything was. The first time I actually restored my phone thinking something was messed up.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #8  
Old 04-24-2008, 09:44 AM
Green Apple
 
Join Date: Apr 2008
Posts: 77
Thanks: 17
Thanked 6 Times in 6 Posts

Hey guys, I need some more room on my iPhone but I'm a bit scared off by BossTool. A few questions if I could:

-If I move my installed applications to the other drive, will I still be able to use them in exactly the same fashion as I do now?

-If I just move fonts and wallpaper, will this make any noticeable difference?

Thanks in advance.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #9  
Old 04-24-2008, 01:52 PM
bhz1's Avatar
Moderator
 
Join Date: Sep 2007
Device + Firmware: iPhone 3G, 3G[S]- 3.1.2 JB
Operating System: Windows XP,Vista, OS X 10.5.8
Location: Pennsylvania
Posts: 2,395
Thanks: 82
Thanked 318 Times in 248 Posts

Ive used BossTool a bunch of times and as long as I moved everyhting with it, I never had a problem. This last time I restored, since I installed Cydia, it moves the apps when its installed.

Moved apps work just like always with a couple of exceptions (easily fixable). Mainly you may need to see where things like Summerboard themes, Customize graphics, files are being stored. Sometimes they are in /root or sometimes in /mobile. You need to figure out where the app is looking for the files and perhaps move them. The lastest installs all semed to be in the correct places now though.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #10  
Old 04-25-2008, 12:54 AM
MattMac's Avatar
My iPhone is a Part of Me
 
Join Date: Dec 2007
Device + Firmware: 16GB 3G iPhone - 2.2
Operating System: OS X 10.5.5 | Win XP Pro
Location: Melbourne, Australia
Posts: 740
Thanks: 83
Thanked 87 Times in 71 Posts
Send a message via MSN to MattMac

Quote:
Originally Posted by bhz1 View Post
Ive used BossTool a bunch of times and as long as I moved everyhting with it, I never had a problem. This last time I restored, since I installed Cydia, it moves the apps when its installed.

Moved apps work just like always with a couple of exceptions (easily fixable). Mainly you may need to see where things like Summerboard themes, Customize graphics, files are being stored. Sometimes they are in /root or sometimes in /mobile. You need to figure out where the app is looking for the files and perhaps move them. The lastest installs all semed to be in the correct places now though.
There root and mobile thing have nothing to do with boss tool but the application itself. 1.1.2 and earlier us /var/root as the main directory and 1.1.3 and above use var/mobile. var/mobile is more compatible with 1.1.3 and above. Some apps still aren't compatible with 1.1.3/4 and still install there files into var/root. The updated versions fix this but as long as other files (eg. SMB themes) install into the correct folder then there should be no problems.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #11  
Old 06-01-2008, 07:11 PM
dbs dbs is offline
What's Jailbreak?
 
Join Date: Apr 2008
Posts: 18
Thanks: 6
Thanked 4 Times in 2 Posts

I installed Cydia AFTER installing a lot of apps using Installer.

1. Does Cydia also move the old Installer installed apps to save space?

2. Will continuing to use Installer place the new apps (installed using Installer) into the larger directory (since I have installed Cydia) ?
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #12  
Old 06-02-2008, 07:08 AM
MattMac's Avatar
My iPhone is a Part of Me
 
Join Date: Dec 2007
Device + Firmware: 16GB 3G iPhone - 2.2
Operating System: OS X 10.5.5 | Win XP Pro
Location: Melbourne, Australia
Posts: 740
Thanks: 83
Thanked 87 Times in 71 Posts
Send a message via MSN to MattMac

@dbs, 1. Yes, Cydia moves all the apps to the second partition to save space on the first partition for the main file system and so you can install more apps.
2. Yes, all new apps installed from Installer, Cydia, and manually installed will be automatically on the second partition, hence, saving you space on your main partition for better phone performance and larger number of apps installable.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
Reply

  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > Native iPhone / iPod Touch App Discussion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



Go to Top
ModMyI

All times are GMT -6. The time now is 04:40 AM. Powered by vBulletin® Version 3.8.4
If you need Dedicated Server Hosting, you should check out SingleHop. | Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 Copyright © 2007-09 by ModMy, LLC. All rights reserved.

iPhone News / iPhone Forums / Apple News / Apple Forums / RSS / Contact Us / / Privacy Statement / Top