SD Card File Write Failing

Good Day,

I am unable to get the example code "ReadWrite" to work on my SD card.

Lets take a small step back, I had an Arduino Uno setup with, LCD, SD, WiFi, RTC and very quickly I had no more free pins so I bought a atmega1284p Atmel and bootloaded it, and Im using it as a Maniacbug Mighty 1284p 16Mhz with optiboot "board".

I connected up my LCD... fine.
I connected up the SD reader and uploaded "cardinfo" example ... fine:

Initializing SD card...Wiring is correct and a card is present.

Card type: SDHC

Volume type is FAT32

Volume size (bytes): 4017094656
Volume size (Kbytes): 3922944
Volume size (Mbytes): 3831

I then uploaded ReadWrite example... failed:

Initializing SD card...initialization done.
Writing to test.txt...done.
error opening test.txt

When I plug in the SD card to my windows machine and open the explorer I see "TEST.TXT" with 0 byte size. I have tried formatting with SDFormatter but still same results.

Please can someone advise?