by Dave
Mon 8 March 2010 @ 00:21
Warning, this post is purely technical. If you were looking for something fluffy, then go here instead. I’ve just completely reset my phone. I’ve been running a continuous set of Cyanogen updates on it for several months now, and it has slowly been getting slower and slower. In fairness, I’ve had Apps2SD running for a while and I suspect that the whole thing had simply become too fragmented and cluttered. Apps2SD is short for Apps 2 SD Card and is a small hack that allows me to use a section of my SD card as internal phone memory. Because I have a first generation phone, the internal space is limited and so this hack is required for installing the amount of applications I use. I’ve been thinking lately about upgrading it to a newer model, but that’s a topic for another post. Anyway, over the last several months it has been getting gradually slower, so I figured it was time for a reset.
The procedure for doing this isn’t as complex as I had thought, but it is long-winded. First thing to do was back up all data to the SD card. In my case, that meant only one application; “Note Everything Pro”, which has a nice in-built backup/restore to/from SD card routine. Everything else gets backed up automatically, or is stored on Google’s servers ready for syncing back later. When that was done, I backed up the contents of the card to my PC, and then restarted the phone in Recovery Mode. Once there, I was able to erase all three partitions on the SD Card (Linux EXT4, Linux Swap and Fat) and create some new ones. I went with a 1GB Linux EXT2 partition (which I just remembered that I have to upgrade to EXT3 or maybe EXT4), 32Mb of swap partition, and the rest (approximately 7Gb) as a fat32 partition for data. After that was done, I used the wipe commands to erase the user data on the phone completely and restarted.
Instead of booting into my usual screen, I was prompted (very quickly indeed) with the Android Setup screens which took me through the new-user process. Within five minutes everything was completed. Unfortunately for me, that’s when the real work started. I had to then shutdown the phone, restore my data from the PC to the SD Card, restart the phone and start re-installing all the applications. I post all of this because the commands that are needed in PARTED (the partition editor) always make me surf for about twenty minutes looking for them. So, pay attention because this is the important bit.
/ # parted /dev/block/mmcblk0 ↵
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) print ↵
print
Model: SD SD08G (sd/mmc)
Disk /dev/block/mmcblk0: 9769MB
Sector size (logival/physical):512B/512B
Partition Table: msdos
Number Start End Size Type File System Flags
1 32.3kB 7000MB 7000MB primary fat32 lba
2 7000MB 7939MB 938MB primary ext2
3 7937MB 7969MB 31.8MB primary linux-swap(v1)
(parted) rm 1 ↵
(parted) rm 2 ↵
(parted) rm 3 ↵
(parted) mkpartfs primary fat32 0 7000 ↵
(parted) mkpartfs primary ext2 7000 7937 ↵
(parted) mkpartfs primary linux-swap 7937 7969 ↵
(parted) quit ↵
/ # tune2fs –j /dev/block/mmcblk0p2 ↵
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or 0 days, which ever comes first. Use tune2fs –c or –i to override.
That’s it… that’ll clean off the card and you can begin again.