Formatted Micro SD Card as internal storage, after flashing a new build the card is unusable with any device I've tried reformatting as portable storage and internal storage and neither work, choosing portable storage shows no errors it just doesn't do anything while internal storage errors.

I've tried taking out the card and plugging it into my computer to reformat but Windows doesn't pick it up at all (including the SDFormatter tool) and GParted gives the following error when trying to change anything:


  Input/output error during write on /dev/mmcblk0
  
  Error fsyncing/closing /dev/mmcblk0: Input/output error


Trying to reformat it using the Disks tool in Mint gives me this error:


  Error synchronizing after initial wipe: Timed out waiting for object(udisks-error-quark,0)


The parted command line tool gives similar errors.

I've been tearing my hair out all day over this, I can't seem to find any way to bring the SD card back. This is actually the second card this has happened to, I ended up throwing away the first one and then I've gone and done it again.

I've had a look at http://nelenkov.blogspot.co.uk/2015/06/decrypting-android-m-adopted-storage.html, but as I've flashed a new ROM the key is gone?

Any help is appreciated!
Use DISKPART utility to create new partitions and reformatting them. I suggest using the below procedure by inserting the card into an adapter and then into the PC.

This is the part which has no Android, but is done on Windows PC. Here we go.


First open a command prompt window with administrative rights. 
An Administrator command prompt will open. Type in diskpart.
Then enter this command "list disk" without the quotes to display all active disks on your machine.
Now choose the disk which is your SDCARD using Select command "Select disk 1".
Type "clean" with no quotes. Hit enter.
Type in "create partition primary", partition will be created.
Type "Active", this will mark the partition as active.
Now, the formatting of partition in format you like, usually SDCARD is FAT32. Type "format fs=fat32 label="NAME THE CARD" quick".
Then type "assign" and then "exit".


Now you have a formatted SD CARD!