Problem expanding memory on micro SD

I am trying to expand my filesystem in a 32gb microSD cause (28: No space left on device)

After following the directions in here:

My SD is partitioned like this: Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 4095 1024 c W95 FAT32 (LBA)
/dev/mmcblk0p2 4096 62717951 31356928 83 Linux

Stuck in an error:
Bad magic number in super-block while trying to open /dev/mmcblk0p2. Couldn't find valid filesystem superblock.

After command:
resize2fs /dev/mmcblk0p2

Searched the web, tried different fixes all over again and again for linux systems but the error insists. Any ideas ?? Thank you in advance.

You did not say which OS distribution you are trying to install.
The rules are sometimes different, but I will suggest the following:

Install the target distribution on the microSD card usingWin32Diskimager.
Put it on the BBB and see that it boots, and that it was a good install.

Now, go find a Linux host computer and mount the microSD card on the Linux machine.
use the Linux application Gparted, which is a GUI oriented partition manager for Linux and FAT32 partitions, and
use that to expand the Linux partition. Since it is GUI oriented, you can see what is about to happen, and see the partition after it was expanded.

You can also see and manage the boot flag bit, which needs to be set on the microSD card.

— Graham