Take a look a YouTube video from XFiX on how to create the XBOX ONE HDD (SSD).
There are two methods for Linux USB and for Windows.
Xbox One S and Xbox One X HDDs have the same structure.
I used this method for 2TB Samsung EVO SSD (MZ-75E2T0BW).
I created the Xbox One SSD (four partitions) in Windows 10, copy/pasted all files from the original drive into my SSD (System Support, System Update, Temp Content and User Content), replaced the drive in my Xbox One X (not Project Scorpio) and it is working just GREAT!
For HDD replacement just follow the Xbox One X teardown video here on ifixit.
14 screws T10 and 2 screws T9 (USB connector). No other tools are required.
crwdns2934105:0crwdne2934105:0
crwdns2934113:0crwdne2934113:0
crwdns2915270:0crwdne2915270:0
crwdns2889612:0crwdne2889612:0
10
crwdns2944067:02crwdne2944067:0
did I need to do anything to the hard drive like firmware update or will the xbox one x just prepare the Hard drive once its formatted
crwdns2934271:0crwdnd2934271:0 Lee crwdne2934271:0
Please use the XBOX HDD Master Tool from GBA TEMP, follow the instructions, update the XBOX about the recovery with the OSU file, then it will work again
crwdns2934271:0crwdnd2934271:0 Marcel crwdne2934271:0