I put together what I hope is a comprehensive guide to rooting your Vox and increasing the internal storage capacity while you're at it. I tried to be careful, but typing this stuff in wrong could brick your Vox or your computer (or at least force you to reinstall Windows). If you see any error messages, stop and ask. If you are going to follow these directions, I recommend reading them through enough to be familiar with them. If you really
want to be prepared, find a few old USB flash drives and practice things like making partitions and copying one drive to another. If I've made a mistake in my directions, it might not be obvious unless you're familiar with how Linux handles hard drive devices and partitions. I'll feel really, really sorry for you if something breaks, but that's it, so be careful and on your own head be it.
The first thing we want to do is make a directory to work in. We're going to create some temporary files and such, and it's easiest if we keep them all in one spot. Then, if we mess up, we can delete the directory and start over. First, we're going to create a rooted, but otherwise exact duplicate of the stock Vox memory card. After that, we'll modify it to take advantage of a larger card.
We're going to need the following hardware:
- The original Micro SD Card from the inside of the Vox
- A new 8GB or larger Micro SD Card for the rooted image
- A USB Micro SD Card reader
- If you're booting from a live CD, a 16GB or larger USB flash drive for your working directory
- A notepad and pen or pencil
We'll need the original memory card removed from the Vox, another card that's 8GB or larger (preferably SanDisk class 4; others may run slowly) and a USB memory card reader. If you use a larger card, then we can take advantage of the extra space later. You'll need to have access to a directory with at least 10GB free. You've said that you're using VirtualBox, but I've also included instructions for using a 16GB (or larger) USB flash drive for your working directory. You're also going to need the root password for your system.
Please note that this process may take several hours, most of it downloading firmware (depending on the speed of your internet connection) and copying images to and from the memory cards (depending on the speed of your USB hardware and the cards).
PREPARE YOUR WORKING DIRECTORY
If you're using Linux installed in a virtual machine or on your hard drive (remember that you need about 10GB free), then type the following:
Now skip to the section named PREPARING THE FILES
If you're booting from a live CD and don't have a hard drive partition to use as a working directory, use the following directions. The benefit to this method is that you could actually disconnect your computer's hard drive to do this so that you know for sure that it won't get erased.
The first thing we need to do is get the flash drive mounted. Most systems automount USB drives if you plug them in. Mine doesn't, so I'm kind of guessing about exactly what will happen. If something doesn't look right, let me know and I'll try to figure out what's going on.
First, we need to write down a few bits of information. In your terminal, type the following:
When I type it, I see this:
uid=100(bowz) gid=100(users) groups=100(users),11(floppy),17(audio),18(video),19(cdrom),93(scanner)
The information that we're interested in are the numbers following "uid" and "gid". Mine are both 100, but yours won't necessarily be the same. Write them down in order of uid:gid ("100:100"). As an aside, if either of those numbers is 0, or if you see 0 anywhere in the "groups" list, then you're performing commands as root all the time. That's a bad idea
. The rest of these commands would work, but I recommend that you stop and let me know so we can try to fix it.
Now we're going to prepare the flash drive. In your terminal, type the following:
tail -f /var/log/messages
That will start displaying system messages in real time, which will help us figure out what device your system assigns to the USB drive. The output on mine when I do that looks like this:
> tail -f /var/log/messages
Jan 19 17:32:44 dungheap blueman-mechanism: loading RfKill
Jan 19 17:33:04 dungheap logger: ACPI group video / action LCD is not defined
Jan 19 17:33:05 dungheap last message repeated 5 times
Jan 19 17:33:13 dungheap blueman-mechanism: Exiting
Jan 19 17:51:07 dungheap -- MARK --
Jan 19 18:11:07 dungheap -- MARK --
Jan 19 18:31:07 dungheap -- MARK --
Jan 19 18:34:13 dungheap kernel: [ 3807.920339] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null)
Jan 19 18:45:20 dungheap logger: ACPI action lid is not defined
Jan 19 19:02:49 dungheap logger: ACPI action lid is not defined
Yours should look similar, but the messages themselves don't really matter at this point. You can see from the above that my system is named "dungheap" and I closed the lid (it's a laptop) to put my daughter to bed.
Now insert the USB flash drive. You should see output similar to the following.
Jan 19 19:44:40 dungheap kernel: [ 8035.217593] usb 1-3: new high speed USB device using ehci_hcd and address 5
Jan 19 19:44:40 dungheap kernel: [ 8035.333488] usb 1-3: New USB device found, idVendor=1908, idProduct=0225
Jan 19 19:44:40 dungheap kernel: [ 8035.333502] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 19 19:44:40 dungheap kernel: [ 8035.333512] usb 1-3: Product: USB2.0 Device
Jan 19 19:44:40 dungheap kernel: [ 8035.333520] usb 1-3: Manufacturer: Generic
Jan 19 19:44:40 dungheap kernel: [ 8035.333527] usb 1-3: SerialNumber: 20120218120009
Jan 19 19:44:40 dungheap kernel: [ 8035.337091] scsi8 : usb-storage 1-3:1.0
Jan 19 19:44:41 dungheap kernel: [ 8036.338805] scsi 8:0:0:0: Direct-Access Generic Mass-Storage 1.09 PQ: 0 ANSI: 2
Jan 19 19:44:41 dungheap kernel: [ 8036.339606] sd 8:0:0:0: Attached scsi generic sg2 type 0
Jan 19 19:44:42 dungheap kernel: [ 8037.078141] sd 8:0:0:0: [sdb] 30679040 512-byte logical blocks: (15.7 GB/14.6 GiB)
Jan 19 19:44:42 dungheap kernel: [ 8037.080354] sd 8:0:0:0: [sdb] Write Protect is off
Jan 19 19:44:42 dungheap kernel: [ 8037.088234] sdb: sdb1
Jan 19 19:44:42 dungheap kernel: [ 8037.091100] sd 8:0:0:0: [sdb] Attached SCSI removable disk
The line second from the bottom tells me that the system assigned sdb
to the flash drive and it has one partition (sdb1
). Write the drive designation down on your notepad. If there's only one partition (in this case, sdb1
) go ahead and write that down. If there are no partitions, (you only see sdb
), then write that down instead. Since a brand-new flash drive usually has a VFAT partition on it, we're going to reformat it as an EXT2 filesystem. This is necessary because some of the operations we'll need to do in our working directory won't work with VFAT. Since your system probably automounted the flash drive, we'll need to unmount it. Press CTRL-c to stop the log output and enter the following:
That will show you a list of mounted filesystems. Mine looks like this:
/dev/root on / type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sdb1 on /mnt/usb type vfat (rw,noexec,nosuid,nodev,user=bowz)
We're looking for the same drive that we wrote down, sdb1
(or whatever yours was). If there were multiple partitions (like sdb1
), you should see one of them, so write that down.
It will ask for your root password. After typing it in, the command prompt should change to "#". Everything you do until you type "exit" will be done with no questions asked, even if it trashes your system. Be careful. Now unmount the drive. For the following commands, replace sdb1
with the name that you saw in the log output.
FORMATTING THE DRIVE
The easiest thing to do here is just reformat the partition we just unmounted. This will erase everything on the partition and Windows will no longer be able to read it. Still as root ("#" command prompt), type the following. Remember that this is formatting whatever drive you're telling it to. This is the most dangerous part of the journey, so again, be careful
. If you aren't 100% sure, stop and ask.
This may take a few minutes, but you should see something similar to the following when it's done:
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
32 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
We're finally ready to mount the flash drive as our working directory. You should still have the "#" prompt. Enter the following, again replacing sdb1
with the drive designation that you wrote down.
mount -t ext2 /dev/sdb1 /mnt/vox
Now we're going to make the working directory. Replace the 100:100
with the uid:gid numbers that you wrote down earlier.
chown 100:100 vox
After typing "exit", you're no longer root and the "#" prompt should go away. You're also in whatever directory you started in before all of those commands, so let's go to your new working directory.
There. Now we can go to the next stage.
PREPARING THE FILES
Now let's download the software that we'll need. The command that we're going to add to the Vox is "su" (the same "switch user" or "superuser" application that we used before on our Linux system) and the accompanying SuperUser.apk. Both are available at the following website: http://androidsu.com/superuser/
. Download the latest stable version for ARM devices, which is currently Superuser-3.1.3-arm-signed.zip
Once the zip file is downloaded, we're going to unzip the contents so we can copy them to the Vox later.
You should see the following output:
signed by SignApk
Now type the following to move back to our vox directory.
Now we're going to download the current Vox firmware (thanks, hecatae
curl -O "http://download.kobobooks.com/vox/images/eng.CAN.20120604.161216/x[000-166]"
The download will take a while, totalling 166MB. When it's done, we'll concatenate it into a single file.
cat x* > ../update.zip
You should see output that looks similar to this:
drwxr-xr-x 4 bowz users 4096 Jan 19 18:21 .
drwxr-xr-x 193 bowz users 16384 Jan 19 18:18 ..
-rw------- 1 bowz users 1324669 Jan 19 17:56 Superuser-3.1.3-arm-signed.zip
drwxr-xr-x 2 bowz users 4096 Jan 19 18:16 fwparts
drwxr-xr-x 4 bowz users 4096 Jan 19 17:56 superuser
-rw-r--r-- 1 bowz users 171558652 Jan 19 18:21 update.zip
Now we're going to root update.zip, which will become our recovery image. Since the chance of Kobo updating the firmware is becoming vanishingly small, this means a factory reset will bring us back to a rooted copy of the latest firmware.
After typing "su", you should see a "Password:" prompt. We're telling the system that we want to become root and it wants the root password, so type that in. The command prompt will change to "#". Everything you do between now and when you type "exit" will be done with no questions asked, even if it trashes your computer. Be careful. Now we'll mount the system image in the update and add the superuser files.
mount -t ext4 update/system.img imagemount -o loop
cp superuser/system/app/Superuser.apk imagemount/app/
cp superuser/system/bin/su imagemount/bin/
chmod 4755 imagemount/bin/su
After typing "exit", the command prompt should no longer by "#". Now we'll zip it back up into the recovery package.
BACKING UP THE VOX
zip -r9 ../update-rooted.zip .
Now we're prepared to create the rooted SD Card. First, we need to make a copy of the memory card from the Vox. We'll then have two backups, the original SD Card and the copy in our working directory. We're going to watch our log again.
tail -f /var/log/messages
Now put the SD Card from the Vox into your USB card reader and then insert the card reader into the computer. You should see output very similar to the following:
Jan 19 21:08:31 dungheap kernel: [13065.942580] usb 1-3: new high speed USB device using ehci_hcd and address 7
Jan 19 21:08:31 dungheap kernel: [13066.060329] usb 1-3: New USB device found, idVendor=1908, idProduct=0225
Jan 19 21:08:31 dungheap kernel: [13066.060344] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 19 21:08:31 dungheap kernel: [13066.060354] usb 1-3: Product: USB2.0 Device
Jan 19 21:08:31 dungheap kernel: [13066.060361] usb 1-3: Manufacturer: Generic
Jan 19 21:08:31 dungheap kernel: [13066.060368] usb 1-3: SerialNumber: 20120218120009
Jan 19 21:08:31 dungheap kernel: [13066.063328] scsi10 : usb-storage 1-3:1.0
Jan 19 21:08:32 dungheap kernel: [13067.065646] scsi 10:0:0:0: Direct-Access Generic Mass-Storage 1.09 PQ: 0 ANSI: 2
Jan 19 21:08:32 dungheap kernel: [13067.066389] sd 10:0:0:0: Attached scsi generic sg3 type 0
Jan 19 21:08:33 dungheap kernel: [13067.760280] sd 10:0:0:0: [sdc] 15523840 512-byte logical blocks: (7.94 GB/7.40 GiB)
Jan 19 21:08:33 dungheap kernel: [13067.761191] sd 10:0:0:0: [sdc] Write Protect is off
Jan 19 21:08:33 dungheap kernel: [13067.773552] sdc: sdc1 sdc2 sdc3 < sdc5 sdc6 > sdc4
Jan 19 21:08:33 dungheap kernel: [13067.779330] sd 10:0:0:0: [sdc] Attached SCSI removable disk
The second line from the bottom tells us the system assigned device sdc
to the SD Card. Your partition list ("sdc1 sdc2 sdc3 < sdc5 sdc6 > sdc4") might have different letters, but the numbers should be the same because that's how the Vox card is partitioned. Write down the letters (in my case above, sdc
). None of the partitions is VFAT, so automounting software shouldn't mount any of them. Hit CTRL-c again to stop the logger and check the mount table again (by typing "mount"), just to be safe. You shouldn't see any of the partitions listed in the output to the "mount" command. If you do, become root and unmount any that show up. For example, if you see /dev/sdc1
in your mount table, do the following:
Let's make our backup copy of the card. Using the letters that you wrote down instead of sdc
, enter the following:
dd if=/dev/sdc of=./vox_image.bin bs=512
This will take quite a long time, like up to an hour on slow hardware (and any part in the chain of card, reader, USB hardware, CPU can be the bottleneck), so don't panic. When it's done and you've typed "exit", take the USB reader out. Remove the Vox SD Card from the reader and replace it with the new one that will be your rooted copy. Put the Vox original someplace safe.
COPYING THE IMAGE TO THE NEW CARD
Your system will probably assign the same drive designation to this one as the last one, but we'll verify it just to be safe.
tail -f /var/log/messages
Now put the card reader in the PC. Since this is a new card, it'll probably only have a single partition again and it will probably get automounted. Write down the drive designation and hit CTRL-c. Check the "mount" command to see if it got mounted. If it did, unmount it:
Now we're going to copy the image that we made to the new card. Again, be careful to use the drive designation that you saw in the log output.
dd if=./vox_image.bin of=/dev/sdc bs=512
This will take even longer than the read. Be patient and don't panic. When it's done, pull the reader out of the PC, wait a few seconds, and put it back in. The partition table gets cached and that will refresh it. It also wouldn't hurt to watch /var/log/messages again, either, just to make sure everything's OK.
ROOTING YOUR NEW CARD
If you were to put the new card inside your Vox and put it back together, you would be an exact copy of the old one, complete with all of your apps, user information, books and data. If you keep your backups, you can now go back to that state anytime you want as long as your hardware holds out. We're going to root it, however.
Remember, instead of sdc
in the following commands, use the drive designation that you wrote down. The numbers will be the same as I have below (so if the drive that you wrote down was "hde" instead of "sdc", you'll use "/dev/hde2" in the first set of commands below).
First, we're going to copy the recovery image to the new card.
mount -t ext4 /dev/sdc2 imagemount
ls -al imagemount
You should see a file named "recovery_backup_signed.zip". If not, something's wrong. If you do see it, then still as root:
cp update-rooted.zip imagemount/recovery_backup_signed.zip
At this point, you could put the card back into the Vox and perform a factory reset. It would broom out all of your data, but the result would be rooted. Instead, I'm going to assume that you want to keep your data. If you want to expand the storage of your Vox, you won't get to keep your data, anyway, so you can skip this next bit and go to EXPANDING YOUR STORAGE
mount -t ext4 /dev/sdc1 imagemount
cp superuser/system/app/Superuser.apk imagemount/app/
cp superuser/system/bin/su imagemount/bin/
chmod 4755 imagemount/bin/su
If you don't want to expand the storage (you used an 8GB card or don't care about wasting the extra space) then you're done. You can skip to the YOU'RE DONE
EXPANDING YOUR STORAGE
If you used a 16GB or 32GB card, this will let you use the extra space for storage. It will, however, wipe out your user data and restore the Vox to rooted, but otherwise factory state.
You should see the following prompt:
Command (m for help):
Type "p" and hit enter. You should see something very similar to the following. In fact, the numbers should all match exactly.
bash-4.1# fdisk /dev/sdc
Command (m for help): p
Disk /dev/sdc: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcf3814cc
Device Boot Start End Blocks Id System
/dev/sdc1 92160 616448 262144+ 83 Linux
/dev/sdc2 616449 1665025 524288+ 83 Linux
/dev/sdc3 1665026 4286466 1310720+ 5 Extended
/dev/sdc4 4286467 15523839 5618686+ 83 Linux
/dev/sdc5 1665088 3762240 1048576+ 83 Linux
/dev/sdc6 3762303 4286466 262082 83 Linux
Command (m for help):
We're going to remove and recreate several partitions. First, let's delete partitions 3-6. Enter the command "d". It will ask you which partition you want to delete. Enter "6" and hit enter. Then type "d" again and this time, enter "5". Then do the same for partitions 4 and 3.
Now, we're going to create our new, larger partitions. We need to create partiton 3 as an "extended" partition that will hold partitions 5 and 6. Partition 5 is the data partition, where apps are installed and partition 6 is the Dalvik cache. On mine, I gave them 4GB split into 3.5GB for apps and 512MB for cache. This more than triples the space for apps and doubles the cache.
Enter "n" to create a new partition. Enter "e" to create an extended partition. Then enter partition number 3. Hit enter to select the default first sector and type "+4G" (for four gigabytes) for the last sector.
Enter "n" to create another new partition. Enter "p" to create a primary partition and select partition number 4. Hit enter twice to select default start and end blocks. This will allocate the remainder of the card for /sdata, which is where things like books are stored.
Enter "n" to create another new partition. Enter "l" to create a logical partition. Hit enter to select the default first sector and type "+3500M" for (roughly) 3.5GB.
Enter "n" to create another new partition. Enter "l" to create a logical partition. Hit enter twice to select the default first and last sectors.
Now enter "w" to write out the partition table.
To format the partitions, enter the following commands, again using the correct drive designation. Each one may take a few minutes.
The Vox will format partition 4 (/sdcard) itself when it boots. You're now ready to put the card back into the Vox.
You can now take out your card reader.
If you were using a USB flash drive for your working directory, you can now unmount it.
Take the USB drive out and put it somewhere safe as a backup in case you need to create a new internal card for your Vox.
Put the new card in the internal card slot of your Vox. I recommend connecting the battery and booting it up before you put all of the screws back in just to be safe, but even a worst case scenario now has you putting the original card back in and running a Vox without root. If you didn't increase the card partition sizes, it should boot right up, but otherwise it'll take an extra long time (again, don't panic) as it formats /sdcard and rebuilds the data and cache partitions. If you changed the partition sizes, it might be a good idea to do a factory restore.
To do a factory restore, which rebuilds the system from the recovery image, then you need to abort five boots in a row. To do this, power the Vox on. When the open book animation starts, hold down the power button until the Vox shuts off. Repeat. After the fifth time, you'll get a "something went wrong" message and it'll rebuild the Vox system. It doesn't repartition the card, though, so if you expanded the partition sizes, they'll stay that way. Note that the "factory restore" in the settings menu just erases /data and /sdcard, but doesn't rebuild /system.
Good luck. I've tried to be complete and careful, but remember that there is a danger of hosing up your Vox and computer, so if you aren't sure about something, stop and ask.
Finally, if your card ever dies and you didn't keep any backups, you can actually create an SD Card for a Vox from scratch using just the update.zip downloaded from Kobo (which I posted about here
). The only problem I had was that I couldn't use the Google Play Store afterwards. I think there's a serial number or something stored on the card somewhere that I couldn't find.