Sample Header Ad - 728x90

How to find the pathname of the swap partition on SD card?

9 votes
2 answers
16304 views
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??
Asked by endolith (3041 rep)
Sep 14, 2013, 01:38 PM
Last activity: Apr 16, 2016, 01:16 PM