Writing 'partition' Failed (remote failure) error, when flashing from fastboot A couple of days ago, I got an error on my phone (Motorola Razr HD xt925) saying that it cannot load the home screen. So, I restarted it in order to resolve the issue. However, it didn't reboot and since then it has been stuck in the Motorola logo. 


I tried to do recovery or factory reset, but all the options lead to the same Motorola logo with no luck. 
The only option that is working is AP Fastboot.  I managed to unlock the bootloader by getting an unlock code from Motorola's website and using the mfastboot command. So I assume that the fastboot command is working since it detects the devices; however, I couldn't make ADB command to work since it give the error: 'device not found'. 
Anyway, the second step is to flash the phone. According to this question, I should be able to do that. However, when I am running the command fastboot flash partition gpt.bin, I am getting the following result: 

(bootloader) Variable not supported!
target max-download-size: 30MB
sending 'partition' (32 KB)...
OKAY [  0.022s]
writing 'partition'...
FAILED (remote failure)
finished. total time: 0.154s



I have been searching for days to solve this problem, but nothing yet! I don't know which part I am doing wrong.
Use Motorola root toolkit.
From here, give a try to mfastboot-v2, then post your results.