Liked what you read? Please subscribe for more technical updates, so you won't miss any nice tips or tricks I have to share with you. =)

Subscribe in a reader

February 28, 2008

How to: Fix "Low Disk Space" Issue (Manually)

Hi guys.

I'm sure you had fun jailbreaking your applications, and you will probably try to install each and every available application on the Installer repo. Then suddenly, some unexpected errors occur. You don't want to restore your device. You need help.

You will read this post if you encounter these related problems:

  • Installer crashes after trying to install (more) applications
  • Installer tells you that "You're running out of disk space" even though it's a newly restored device
  • You delete videos and pictures, but still can't clear that disk space
  • You can't manually install applications via SSH, Total Commander, CuteFTP, WinSCP, iphonebrowser, ibrickr etc
  • Your favourite SFTP program reports that there is an error
  • You can't add BIOS files for applications that requires them (e.g. gpSPhone and psx4all)
  • (editors note: maybe there's more, but I can't think of any right now!)
There are 2 known methods. The easy way (no fun way :P ) and the hard way (more fun, more risk!). Whatever method you choose, the outcome will be the same. However, I'm only going to touch on the Hard way, because I cannot fulfil the requirement to do the easy way (having a wifi).


BORING DISCLAIMER NOTICE

READ THIS BEFORE CONTINUING!

Yeah I know this is boring, but you will have to read it, so that you don't keep blaming me for errors!

THIS TUTORIAL IS MAINLY WRITTEN FOR WINDOWS USER. NO OFFENCE TO MAC USERS, BUT SORRY I DON'T OWN ONE TO SPEND TIME TO TEST WITH.

ONLY FOR FW VERSION 1.1.2 AND BELOW. FOR FW 1.1.3, PLEASE USE BOSSTOOL INSTEAD.

THIS TUTORIAL IS ASSUMING THAT YOU DON'T HAVE WIFI CONNECTION AT HOME AND WANTING TO RE-LINK YOUR ALREADY "FULL" APPLICATIONS INTO THE OTHER PARTITION WHERE THERE IS MORE SPACE.

Whatever happens, FOLLOW THE STEPS CAREFULLY. I will carefully examine each and every step I write here to avoid any errors. Do whatever you need to do (e.g. wear your specs, increase monitor's brightness etc). Make sure you don't miss a step. Make sure you don't confuse "l" (small cap "L") and "1" (the number one) and "I" (capital i). I won't spend my time explaining each and every letter to be typed in though, but be wary of the characters.

Incorrect procedure or incomplete procedures might make your iPod into an unusable state. The safest way (less headache) way to remedy that is to do a complete restore. However, you won't notice where the problems are.

I will try my very best to explain each and every step if necessary. That way, you will feel confident if you are attempting to proceed with the steps.

Don't worry. Mine cocked up in the first try. Luckily with my level of experience, I'm able to restore the problem and start all over again.

I WILL PERSONALLY GUARANTEE THAT THIS IS 100% CORRECT AS OF WRITTEN DATE.

And no, I don't take credit for these information because I learned it from other sources like modmyifone.com, ipodtouchfans.com, iphoneatlas.com etc. There are too many variations, so I will only write the variation that works.

Phew. That's the end of the stupid disclaimer. Now enjoy!


Prerequisites

In order for things to be done smoothly, there are a few requirements that I assume to be available in your device.
  1. Jailbroken iPhone/iPod Touch with version 1.1.2 recommended (1.1.1 should work fine)
  2. Installed BSD Subsystem
  3. Installed Term-vt100 (any other terminal should work though)

What's happening?

If you haven't noticed, there are 2 partitions in the iPhone/iPod Touch. All files in Applications folder is stored there, hence you only have a maximum of 300 MB worth of data. However, due to firmware installs, the OS for the iPhone/iPod Touch also takes up space, and you'll probably have less than 50 MB to install applications.

Once you have completely filled up this partition space, no matter what you do you will not be able to install more applications even though you still have tons of space inside your device.

The trick here is to "re-link" your original Applications folder, and point it to another folder, which is inside another partition. And that partition is the one where all your songs, movies and pictures goes to. So if you have a clean iPhone/iPod Touch, you essentially have 7.5GB or 15GB (depending on model, and other factors) worth of free space to install programs. Install until you're mad! :P

How to know how much space I have?

Run Term-vt100, and type the following in the prompt:
cd /
df -h

It should show you 2 partitions (mine is already fixed though, you probably would get 100% for the first item) like my screenshot here.

If you don't understand, nevermind. Just take note of the values. If it shows 100% for the first item, it's full. So you'll need to move the files in order to continue installing applications.


So how to move?

You can use BossTool (near the end of this tutorial) or you can continue reading this.

NOTE: This is very complicated, so try to follow as closely as possible. Note that I did not use any SSH or SFTP programs because I don't have a running wifi network in my house.

Now you run Term-vt100, and type in the following (cAsE sEnSiTiVe so pay extra attention to it, also watch out for spaces. There might be lags, so wait for the # sign to appear before continuing the next command):
cd /
cp -pr Applications /var/root
mv Applications Applications.old
ln -s private/var/root/Applications /Applications

Detailed explanation

1. Change directory into the root (just in case step)
2. Copies /Applications folder into /var/root folder
3. Moves /Applications folder into /Applications.old folder
4. Creates a symbolic link from private/var/root/Applications to /Applications


That's it?

Not yet. Although you think that it's finished, you will need to test it. Now cross your fingers, while rebooting your iPhone/iPod Touch. Turn it off (not sleep) and turn it back on.

Once it's restarted, you will feel that nothing has happened. If something happens, then it's screwed. But I did these steps while I was writing it, and mine didn't get screwed (phew!). This is normal. You can now run Term-vt100 again, and check if your applications have moved correctly. Type in the following:
cd /
df -h

You should now at least see that it's not in 100% anymore. It would probably be around 80% used. If you want to know why, it's mainly because wallpapers and ringtones takes up the main partition too. But I'm not going to touch on that. If it's still 100%, you probably have missed a step or two, so try again.

Now you need to delete the /Applications.old folder. That was used as a backup, IN CASE something got wrong (like mine did... :P ). I will explain further.


Delete the temporary Applications.old file

NOTE: DO THIS ONLY IF THERE'S NO PROBLEMS!!! I cannot stress enough that this is your only lifeline if something gets screwed. Just make sure you test all your programs, download more programs etc, and when everything seems fine, then do this delete.

To delete the folder, launch Term-vt100 again, and type in the following:
cd /
rm -rf Applications.old

Shit! I can't see a single icon/iPod Touch gets screwed.

Well that happens to me the first time, so that's why I learn.

Anyway, if you cannot see any icons, it's probably not pointing to the right place. You're still in luck because it can be remedied easily.

Download and run iphonebrowser. Look for /Applications folder, DELETE IT (you will have to go through a stupid backup process though). The program might crash, so just close and launch iphonebrowser again. Then RENAME /Applications.old into /Applications and you're good to go (or redo it, or ignore it, or throw it... Whatever you want to do with it! :P ).

If you see a "Applications" file inside the /Applications/ folder, DELETE IT.

If your iPod keeps restarting, try to manually delete the last known installed file using iphonebrowser. When mine keep blinking, I was installing iPhone applications, so that's why it crashes. But this might not be normal SO DELETE THEM FIRST.

You will start to feel that it's really screwed, but I waited a good 30 mins for the blinking to suddenly stop. Once it stopped, that's when everything went back to normal.

Trust me, you wouldn't want to reach to this problematic stage. You would feel like throwing the damn piece of shit. :D Anyway jokes aside, if you DO hit this problem, just be patient, and try to off the device (it probably won't) or holding the Home button. DO NOT HOLD BOTH. Choose either one.

But if you're not confident, you would want to try BossTool instead. The safe, automated way to move those files via Installer. Well, that would require a working wifi connection doesn't it? Read on.


Can't this get any easier/safer method?

Well, yes. Use BossTool. But that defeats the purpose of this tutorial where it's clearly written for those who don't have the luxury of having wifi connection at home (like me!).

Anyway, you can download and use BossTool to automatically correct this problem. However, you will need a lot of free space in order to do that. So make sure you delete enough applications to make some room for BossTool. Or else it won't even install properly, and you'll face another problem.

Add http://www.sleepers.net/~iphone/repo.xml as a source in Installer, then download BossTool.
IMPORTANT NOTE

If you followed the long winded story to move your files, DO NOT INSTALL BOSSTOOL. I just did, and guess what? My iPod Touch goes to disco! It keeps flashing for no apparent reason. My guess is that I tried to do something weird to it, so it's probably crashing.

If you encounter that, connect the iPod via USB, launch iphonebrowser, then just delete BossTool.app. After a while your iPod will restart by itself, and everything will go back to normal.

If you do use BossTool, you can uninstall it after the process have ended. It is a one-time change, and it is a permanent one. If you uninstalled BossTool, it will not move your Applications folder back into the first partition though, so be careful.

I got questions!!!

Well if you have any questions/problems, just comment me/use the contact form and I'll to my best of knowledge to help you with whatever I can.

4 comments:

White_Eagle_One said...

I used bosstool on my 1.1.4 iphone to relocate both my fonts and ringtones. Now when I add ringtones to my itunes and sync it shows that it copies to the iphone but i dont see them in my settings > sound. Is there a way to undo the ringtone relocate that BossTool did? Please help I do not want to do a firmware restore again.

Yusry said...

Hmmm...

I don't have an iPhone, hence I can't let you know how to undo it...

Why not you contact the author of BossTool (BigBoss). He might be able to help you out.

White_Eagle_One said...

I would but i can't seem to find his blog/website or email. Do you know any of these?

Yusry said...

Try visiting ipodtouchfans.com

They have a nice friendly community out there. Most of the guides I wrote are "edited and tested" by me before it gets re-posted.

Look for a user named "BigBoss" and send him a PM. But I suggest you do a search for undoing BossTool changes. Not everyone is as free as me you know... :)

Yusry is a technology freak, he plays a lot with his iPod Touch since day 1. He is also into programming and gets excited trying out new softwares. He is also a member of a local Singaporean band named Dermapthera. You can read his other blog at http://dermapthera.wordpress.com