Iphone out of disk space ? Move your application directory to /var !

[I notice in my logs that lots of people still visit this link – you should no longer need to do this. Simply BlackRa1n your iPhone and install Cydia or Rock. They normally do this for you – I certainly no longer muck about with version 3.x of the iPhone OS. Plus with the fact that there is a virus out there for jailbroken iPhones… Be Carefull !!]

Any user who has logged into his iPhone via ssh (and has installed the bsd subsystem) or has used the installer.app terminal application can do the “df -h” command to get a human-readable output of his iphone partition setup.

It’s basically set up in two partitions : one root (/) partition and one /private/var partition which is mounted afterwards and tacked on to the root partition. It’s actually this /private/var/ partition that contains (under another subfolder ‘root’) all your music, videos and other media.

The root partition contains your installed applications (under the folder ‘Applications’, and since Apple locked the phone down and didn’t think anybody else would add stuff to it, it only provided a minimum of space for the root partition – 300 Megabytes or so. And your /private/var partition has close to 7+ Gigabytes !

With all the applications that I installed via Installer.App, I’ve recently gotten the message that the iPhone has low disk space on its root partition. I’ve got about 13 Megs free, and I dread adding other applications for fear of running out of disk space. Lots of bad things happen when your root partition runs out of diskspace…

So I’ve stumbled over another link that documents how to move your Applications folder to the /var folder so you can install all that you want.

You basically need to do the same thing that you do when you need space on another unix/linux machine :

  • modify your fstab file (which contains the list of partitions to boot) and remove the noexec option from the media partition so that it can execute programs. You can edit the file by copying it over to your computer and editing it there and saving it back (ALWAYS MAKE A BACKUP !) or by editing it directly via the Editor program you can install via installer.app.
  • move over your /Applications folder to /private/var/root
  • and then delete /Applications and create a symlink to the /private/var/root/Applications residing on the media partitition.

I haven’t tried this out yet, but my guess is that you can be much more selective by doing this one level deeper : installer.app for example, should be able to add all the new programs to the the /private/var/root/Applications partition, and then put a symlink to it in the original /Applications folder.

The advantage would be that

  1. you don’t mess with moving the Apple programs and applications
  2. your installer.app applications get backed up (I’ll need to verify if that’s actually true or not)
  3. your root partition will be able to function, even without a media partition (this won’t normally happen, but then I’m paranoid about things like this)

I’ll probably give it a test for installing python on the media partition, I’ll let you know.

Iphone upgrading to firmware 1.1.2

While the jailbreaking and unlocking of your sim is easy as pie when you have an iphone using firmware 1.1.1, upgrading to firmware 1.1.2 can be a whole other can of fishy noodles. The process involves prepping your unlocked and jailbroken 1.1.1. iPhone and then upgrading to the latest 1.1.2 version, and then running from your mac or pc the jailbreak software for 1.1.2, which will flash it again.

It seems that most upgrade guides are particular in their wording, and if you have the ‘malchance’ to not exactly have the same files on your phone as the one providing the guide, you can be up in shit creek for several hours. I know I was.

I upgraded from my jailbroken and unlocked 1.1.1 firmware to 1.1.2 by downloading the new jailbreak program from Conceited Software, which in its latest version includes ‘hactivation’ of the sim. Or so they state, and for most people it’ll probably work (as read on several forums), but for me only the jailbreak part worked, minus the sim activation.

After much, MUCH, MUUUUUCH trial and error and repeatedly going to back to firmware 1.1.1 (thank god for that) I found out that I needed to perform two extra things while preparing for my upgrade to 1.1.2 :

  • take my sim pincode off – this probably blocked my update somewhere
  • unlock using anysim 1.2.1u (not the one in the installer list, that is not the latest one at current date)
  • and only then running oktoprep in the installer.app
  • and finally upgrading to 1.1.2 firmware, and then running the jailbreak software for 1.1.2

Phew. Was it worth it ? I’ll need some more time to check it out again, while I’m installing all my third-party programs again…

PS – if you want complete guides to hacking your iPhone, I can recommend this site.

iPhone wonderfulness

Now that I’ve got my iPhone, I am constantly amazed about it. I’ll list just a few things about that caught my attention.

  1. It’s a phone !
  2. It’s a computer !
  3. It’s a phone and a computer integrated in a marvellous way !

1. It’s a phone.

Of course it’s a phone, that’s why you bought it in the first place. But the UI is soooo well done, it’s scary. It’s scary that it took all this time for someone to come up with a UI that is better than all that windows mobile smartcrap. It’s the smoothness with which your pin login screen appears to unfold when you press the home button. It’s the nice sounds it makes while you work with it. It’s the way your fingers seem to be able to type on those smallish onscreen keys yet you still manage to select the right letter almost all the time. You can read more iphone gushiness from Stephen Fry’s blog.

2. It’s a computer.

It’s a computer in its own right. You can install ssh and the sshd daemon on it, and you can login to it like any other computer. You are using the zsh shell, you can install the latest version of the python scripting language, ruby or Perl. The Apache webserver runs on it, cron is installed, all the Unix command lines work just fine ! Your address book details are kept in sqlite databases, so any tool like python which has integrated sqlite access can access and use them.

3. It’s a phone and a computer.

While the phone baseband modem and the computer are kept separate in the iPhone (at least, that’s what I understand) the results of using the phone are saved to the computer side, so you can for example, install a script that will get all your calls (from an sqlite db) and put those calls in your ical calendar so you can see when you called and who (if the phone number is in the address book).

And it’s all very well integrated ! So well, in fact that you tend to overlook a few problems at first. One of them comes up pretty quickly : there’s no cut-and-paste possible, so quickly picking up for example an rss link from safari and dropping it in a rss reader is not possible. Perhaps a cut and paste solution like iClip would be a solution, where you slide the text or link to a sideboard to store it in, go to the other application and slide it in ?

Other things are missing as well. No GPS, no 3G, no search in your contacts (though you can find most of them fairly quickly).

Still, it’s a beaut, and as Chris Pirillo says: it just put the bar higher for the other phones to compete !

Unlocking the iphone (firmware 1.1.1)

Seems a whole lot of people have spent enormous time on jailbreaking and subsequently unlocking the iPhone. For those who want to know more about this, here are a few links to get you started (please note that these links are valid at the time of writing, and that I am not encouraging you to go and hack your iPhone) :

  • Hack the iPhone : step-by-step instructions on hacking the iphone without needing a computer (you do need a wireless network though)
  • Jailbreakme.com : the website you need to visit to crack your iPhone automatically !
  • Unlocking the iPhone : after getting the iPhone to accept new programs, you need to install a program to unlock your sim card
  • Installing Applications on your iPhone : you can use the handy Installer tool that jailbreak installs for you. Oooooooodles of applications…
  • iPhone Club (dutch) : this forum has a large number of flemish and dutch users who share their knowledge

Makes it very easy to get a real functional phone !