# Converting MBR to GPT



## Deleted member 3 (Dec 22, 2008)

I finally got a new array running, 3TB currently. One disk already had some data and there was an option to create a new array without losing that data. I figured that would safe me time (it didn't) so did it. Converting the whole crap took about 40 hours (not exaggerating) which was rather unexpected. Now I have a 3TB array which needs to be GPT, not MBR. Though converting to GPT can only be done on empty disks. Google so far doesn't come with some tool that can convert disks without losing data, would anyone know of a tool that can do such a thing? I don't feel like breaking the array, copying all data, converting the disk, copying everything back, restoring the array. It would take about 300 years to do that.


----------



## AdamStark (Aug 4, 2009)

I couldn't find anything either.  You're probably not still looking for an answer, but in the interest of others who might have the same problem, here's what I did:

Go into parted and type:

> unit s [this puts parted into sector mode, which is as accurate as you can get]
> print

In my case, it returned:
Number  Start  End         Size        File system  Name  Flags
 1      63s    256076094s  256076032s  hfs+

WRITE down the beginning and end sectors, because you will need those later.

> rm [partition number].  If you have more than 1, remove each one
> mklabel gpt

This will create a new gpt partition map.

> rescue [START] [END] 
where start is the beginning sector of the partition to restore and end is the end.  Do this for each partition.  Enjoy your new GPT.  This is fine for non-booting disks, but I haven't tested it for anything else.

So here are the caveats:

Do NOT do this if any of the partitions start in the first 34 sectors or end in the last 34 sectors of the disk.  Resize them first.

Do NOT do this for any unusual fs types. *It worked for me, with HFS Plus, but I wouldn't try it for anything esoteric.  Parted needs to be able to recover the partition without any clue as to what kind of partition it might be.

Do NOT do this for critical data, back up everything if you can, and please don't blame me if it doesn't work for you.


----------

