As [this](http://androidforums.com/motion-4g-all-things-root/692605-guide-creating-using-swap-partition.html) 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](http://www.bootmed.com/bootmed/resources/findpath11/), 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`](https://android.stackexchange.com/a/5234/693) 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??