Transforming a disk from MBR to GPT

fdiskfilesystemsgpthard-diskmbr

I have a disk with classic MBR and want to transform it to use GPT without data loss. I have seen several more or less useful tutorials, but most of them are dealing with the specific problems related to GRUB, the operating systems and multiple partitions on a disk. In my case, the situation is much simpler – I have a simple disk used to store data on a single partition. I discovered that simply running gdisk and pressing w writes GPT to the disk and I can mount and use it without issues afterwards.

I am worried about data corruption though, gdisk warns me that the operation I'm about to perform is potentially destructive, and I've seen diagrams on which GPT occupies some space which is normally used by the first partition. So my questions are:

Is this a good way to transform MBR to GPT?

Can GPT overwrite some data which was originally on the primary partition, thus corrupting my files or the filesystem?

Best Answer

I created an MBR disk with one partition, filled every single byte on that partition with data, created a SHA1 checksum of the whole partition, converted it to GPT as described in the question, created yet another checksum and compared it with the original. They were the same. So my conclusion is this: You can safely convert a disk to GPT without corrupting the data.

Warning: This does not mean the procedure is safe. It might corrupt your partitions. Always make a backup before converting using this approach.

Related Question