Lost+found

I rooted my phone for one reason: The available space for apps was constantly shrinking! The updates in the Google Play store failed with the error “not enough space available” and I had to de-install apps in order to update or install new apps.

Programs could eat up the space with their user data, so I often cleared the data of e.g. Firefox, but the suspect remained that the total space is shrinking, because the tool “DiskUsage” was showing a big amount of “System Data”, but without root permissions there is no way of tracking it any further.

Once rooted the culprit was easy to see: /data/lost+found was containing like 600MB. On Linux (or ext3/ext4 file systems to be more specific), the lost+found is a system folder where fragments of files go which don’t belong to a file and have been found on a fsck (file system check).

As it is pretty unlikely to recover some data from it you can usually delete the content. It’s a bad sign that there are files in it, the reason could be sudden reboots or system crashes, but there is little you can do. This is the user data partition and what if the Facebook app is missing 4096 bytes in the middle of a database or so?

You can probably delete it on the device using a root file explorer. I did it using adb. On Ubuntu it’s easy:

# install the adb tool
$ sudo apt-get install android-tools-adb
# open a shell on the device
$ adb shell
# you should see a prompt like:
~ $ 
# become root (be careful now!)
~ $ su
root@android:/ #
# go to /data
root@android:/ # cd /data/lost+found
# verify
root@android:/data/lost+found # pwd
/data/lost+found
root@android:/data/lost+found # ls -l
[.. directory ..]
# delete. this is a recursive delete, be extra careful!
root@android:/data/lost+found # rm -rf *

Log out with “Ctrl-D” two times. If you want, you can check the available space with “df -h” while in the Android shell. You should have more free space than before now.

There are other folders consuming some space, e.g. /data/log, but I left them untouched for now to not risk anything. It would probably be save to clean that up, but it wasn’t taking too much space.

VirtualBox with Windows 8

Running Ubuntu as a host and setting up VirtualBox with Windows 8.1 as a guest, I had problems with booting even the installation ISO image. The first splash screen shows up, but then the screen simply turns black and shows this error message:

Your PC needs to restart.
Please hold down the power button.
Error Code: 0x000000C4
Parameters
0x0000000000000091
0x000000000000000F
0xFFFFF80213D5DA80
0x0000000000000000

It wasn’t a vbox driver problem or the NX-bit BIOS setting as first suspected. The problem was a missing CPU instruction CMPXCHG16B.

See also: http://4sysops.com/forums/topic/windows-server-2012-r2-on-virtual-box-error-0x000000c4/

To fix this find out the name of the virtual machine with vboxmanage:

$ vboxmanage list vms
"Win8" {3c4da3bf-ad88-463b-905d-9fd6b3a219b8}

Then enable the instruction on the machine you picked:

$ vboxmanage setextradata "Win8" VBoxInternal/CPUM/CMPXCHG16B 1

That’s already it! After that the ISO boots successfully and installing Windows was no problem anymore.

Don’t forget to add your user to the vboxuser group to be able to use USB devices!

$ sudo adduser yourusername vboxusers

Android desktop backup

I flashed a ROM on my Samsung Android phone. I replaced a leaked official with a “real” and published official ROM, so no real change in the Android version. But I feared having to install all apps again and loosing all their data.

Luckily Android features a backup function in recent versions (I think 4.x?) which can easily be done with ADB (without root!). It’s command “backup” makes an archive of the device’s data (namely /data/data).

# Start adb daemon, check connection
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
0019axxxxx    device

# Make backup: -apk copies also APK
# adb backup -apk -all -f backup-withapk.ab
Now unlock your device and confirm the backup operation.

The device is asking for confirmation, you can optionally set a password.

The good thing with the “-apk” option is: All programs are saved, too! Although Google saves the list of apps and can re-install them on a new device, this applies only to market apps, while “adb backup” also saves others (e.g. Adblock Plus).

To restore is easy too:

$ adb restore backup-withapk.ab

Of course it will only restore everything, so if you want to make partial backups/restores you should consider rooting and using TitaniumBackup.

Unfortunately not everything worked well: some configurations like email credentials had to be entered again. Also the Google Authenticator lost it’s memory somehow, so watch out if you have to rely on it! But I still found it useful.

A new blog is born

So, here it is. I actually never wanted a blog, I always thought there is nothing I could write about (and others would read). But after taking a good offer of a domain and webspace, after some month I finally had to replace the stupid default page with something more meaningful.

Et voilà! It’s actually much simpler than I thought to install everything necessary. The most useful content I could contribute to the world is some geeky stuff, as it took me often a long time to find out a technical solution for something and I often was reading it at the end – in a blog of someone!

So see you soon!