It’s been far too long since I’ve posted, I know, but shrug that’s life.
Yesterday I noticed that the screen on my Kobo Touch eReader (doesn’t get much use, so I only occasionally see it) was displaying garbage. I figured it had crashed or something so (forgetting the reset button on the back) I cracked it open to disconnect and re-connect the battery, when I did that I found this. Note that the battery connector wasn’t broken from factory, just seems to be VERY fragile, as it broke as soon as I tried to unplug it, fortunately there’s enough of it left in the socket that I was able to gently plug the contacts back in by way of a pair of tweezers, I’ll probably gob it with some hot snot later too.
When I see a micro SD slot just hanging out I find it diffucult to resist pulling out the card to see whats on it… (The eagle-eyed reader will also note that there is not one but THREE suspiciously UART-y looking headers unpopulated on the board, maybe one day I’ll get bored enough to check those out.)
So I duly disconnected the battery (and finally noticed that there was a reset button so I didn’t actually need to crack it open to begin with). Pulled the card out and shoved it in a micro-SD reader connected to a VM. Three partitions were auto-mounted.
KOBOeReader is what it exposes as USB Mass Storage when you plug it in, recoveryfs and rootfs are ext4 and contain standard looking linux-y directory structures, so we can assume that it boots off the SD card, which might be problematic but maybe not.
Let’s dump the partition table on that card.
The good news here is that the FAT32 partition is at the end of the volume so we can probably expand it. An interesting point to note is that the first partition starts at 19456 which is quite unusual, generally partition tables start at 2048 so there’s probably some data stuffed onto the front of the SD card. Since there’s no kernel in the two ext4 partitions it’s probably safe to assume that that space is occupied by the kernel and associated paraphenalia.
If we care we can confirm with binwalk;
Pretty much as expected.
Now let’s see if we can embiggen the storage, after rummaging around in my drawer I turned up a 32GB SDHC card, wasn’t sure if that would work (media size limits in various implementations of FAT) but since I didn’t have anything smaller I figured it was worth a try.
First things, let’s grab an image of the original SD card;
Swap cards and then shove it back to the bigger card with;
Then fire up fdisk to expand the partition;
Paritition table looks fine, let’s delete that FAT32 partition and re-create it;
The important thing to note here is the “First sector” answer, by default fdisk will create a partition from sector 2048 but that’s in the reserved section of the card where the kernel resides, instead we use the first sector from the original partition table (1068034).
Looks good, just one final change required;
Been a while since I’ve needed to work with a FAT volume in Linux, mkfs.vfat probably sets the partition type for you, but since I was already in fdisk I figured I might as well.
Speaking of, time to create a new vfat filesystem;
Not sure if the Kobo actually cares about the volume label but figured it was best to set it as it was just in case.
Now, stick the SD card back in the Kobo, plug the battery back in, power up, et voila it (eventually) boots into the “first start” state ready to be set up again (you might be able to preserve the config by copying the contents of the “original” FAT32 volume to the “new” FAT32 volume, I didn’t care enough to try).