How to find the pathname of the swap partition on SD card? As this warns, you should not enable swap on the wrong partition or you can destroy your phone:


  OK before we go any further! previous phones had a partition layout where mmcblck0 was the SDcard (external) our phone uses mmcblck1 for the external sd. This is important because if you use an app it may be preset to use mmcblck0 as swap partition.using this setting will cause you to use your sbl2 or sbl3 as swap partition.this will brick your phone and unbrick guide will be useles.


So the swap partition might be /dev/block/mmcblk0p3 if I have 3 partitions (fat32, sdext, swap) on my SD card, or /dev/block/mmcblk0p2 if I have 2 partitions (fat43 and swap) or /dev/block/mmcblk1p? if you have a different phone, etc. and the wrong choice can brick your phone.

How do you find out which partition is which?  It should be the only partition on any drive of the phone with the swap filesystem.


fdisk -l does this on Ubuntu, but outputs nothing in Android
blkid does not show the swap partition
cat /proc/partitions lists a lot of partitions, but doesn't indicate which is the swap
cat /proc/swaps only lists swaps that are already being used
cat /proc/mtd only says dev: size erasesize name and nothing else
ls /dev/block/vold lists some partitions as 179:64 179:65 179:66, but doesn't indicate what they are?
4ext recovery will show it in the table of partitions (swap swap 129 MiB), but doesn't say the dev name
...


Even if there's no command line tool to print it directly, surely there's a way to deduce it from some other information??
I installed the Disk Info app and in the options, I enabled Expert mode and Unmounted partitions.  It doesn't say "swap", but it shows clearly that it's the only other partition on the SD card and it's the right size, so /dev/block/mmcblk1p2 must be the one:



Swapper 2 is configured to use /dev/block/mmcblk0p3 by default, so I'm glad I didn't go with the default.