[OnePlus X General] SebiderSushi:
@ze7zez in case it is an issue with the drivers you could give edl a shot. You can try it on windows first according to the instructions in the readme or try it on Linux as well. You should be able to do this in the Live environment where most Linux Distributions allow you to try them out without installing anything to your harddrive. Any of the common Linux distributions should be fine for this task as long as they work on your PC.

In your case you can just attempt to run edl w recovery OPX_MM_recovery.img and see if it does the trick. Maybe try to reboot to recovery even if you see errors, who knows. Make sure you are using a compatible version of the recovery - the UnBrick tool includes a version compatible with the OxygenOS 2 bootloader and according to the symptoms you were describing it appears that you have the OxygenOS 3 bootloader installed. If in doubt, just try both versions.

If you can't write even with edl chances are you can at least read your storage. Definitely take a backup of all important partitions and the partition table on your device with edl rl dump_onyx_bricked --genxml --skip=grow,boot,system,cache,userdata if possible before trying to write anything else at this point. If you see any errors, if edl tells you it cannot read partitions or if edl printgpt does not print a valid list of your device partitions you'll have to use

edl rf dump_onyx_full_brokengpt.img to take a backup.

You might want to repeat the process a second time and compare both dumps for differences to make sure you're not relying on a faulty backup.

If your partition table is broken you can try to fix it according to the section "Customize what to flash" from the first post, then run

edl qfil rawprogram0.xml patch0.xml ./

If you have important data on your device you also have a chance to retrieve it with edl. If you have encrypted your userdata on a ROM uploaded by YumeMichi the "encryption footer" which holds the encryption key to all your data is stored in the reserve2 partition so keep that in mind if you need to decrypt or restore a backup of userdata

As long as your partition table is intact, you can dump your userdata with edl r userdata dump_onyx_userdata.img. If your partition table is broken your userdata will be part of a full dump created with edl rf but you might want to take another dump after fixing the partition table if you don't know how to access a specific partition inside a full dump with a broken GPT.

Accessing your userdata is best attempted on a Linux machine because the tools you need to read or decrypt a dump of your userdata are already there or easier to install and set up than on Windows. If you only want to create backups and restore them back to your device any operating system is fine as long as you successfully set up edl

If your partition table is intact you can now attempt some read/write testing on an unused partition like cache and see if your flash storage is spewing out garbage.

If your partition table is still broken at this point and you are feeling adventurous you can use edl ws <start_sector> <filename> to write and edl rs <start_sector> <sectors> <filename> to read from a specific sector if you know there's gonna be some unused storage space after it. This approach has no error margins. Your device will overwrite anything it is told to. If you go this route you have to trust your math, your device firmware & flash storage or your backups. For better or for worse.