Sunday, October 6, 2013

link2sd - upgrading your card

I have a rooted android phone and make use of the great link2sd application, in order to move applications on a second partition on my external sd card. This is a great way to move almost every type of application to the sd card, that also allows you to use an efficient filesystem like ext4 instead of the old, but widely accepted, FAT32.
I saw many posts describing how to change your sd card while preserving link2sd functionality, but I saw most of them relying on Titanium Backup or other backup methods... my solutions has been a bit different and, I think, quicker so I'll explain it here.
Premises:
  1. I've got a rooted android phone, with Android 4.2.2 cyanogenmod installed
  2. my phone has got a 4Gb sd card, with two partitions: the first partition is FAT32, the second one EXT4
  3. I used link2sd to migrate most programs to the second sd card partion
  4. I bought a bigger sd card, 16Gb, and I want to migrate everything from the old sd card to the second one
So, here's what I did
  1. pick the first card, and using your PC, make a backup of all the files of the two sd card partitions, separately. As I used Linux to do it, I suggest making a backup using tar, as it also takes care of file permissions and ownership, even if you use a FAT32 or NTFS disk to hold the backup
  2. pick the second card, and partition it in two, using regular utilities like fdisk or gparted, as usual
  3. format the first partition in FAT32, the second one in EXT4. Remember to avoid using the journal, make use of some great post like this to make a good job
  4. restore all files from the backup from the old FAT32 filesystem, to the new one
  5. restore all files from the backup from the old EXT4 filesystem, to the new one
  6. insert the second sd card on your phone
  7. start link2sd - it will prompt you for the second partition's filesystem, answer "EXT4"
  8. link2sd will suggest you to reboot to mount the new sdcard correctly - say yes, wait, and everything will work
This worked just fine for me, and I found it much handier than restoring viasome android method - please let me know your experience!