{"id":207,"date":"2023-08-14T10:48:07","date_gmt":"2023-08-14T10:48:07","guid":{"rendered":"https:\/\/privateblog.nobytesleft.net\/?p=207"},"modified":"2023-08-14T10:48:07","modified_gmt":"2023-08-14T10:48:07","slug":"convert-a-data-disk-from-mbr-to-gpt-without-losing-data","status":"publish","type":"post","link":"https:\/\/privateblog.nobytesleft.net\/?p=207","title":{"rendered":"Convert a data disk from MBR to GPT (without losing data)"},"content":{"rendered":"<p>The reason for this is very simple. MBR partitions do not work above 2 TB. I had (long story&#8230;) a 2 TB NTFS partition on a 4 TB USB hard drive. Windows provides a command-line tool, MBR2GPT.EXE, but it works only on bootable disks with Windows installed. And a request for making it work with data disks has been dismissed from Microsoft.<\/p>\n<p>The prevailing wisdom is &#8220;do a backup&#8221;. But even if I do &#8211; or already have &#8211; a backup, if I want to enlarge a 2 TB partition it will take a long time to rewrite all data to the disk. So it is much better to convert the disk in-place.<\/p>\n<p>You can find procedures on the web, but they focus on system disks. Actually, the procedure is extremely simple if you have only a data disk, but you have to use non-Microsoft tools.<\/p>\n<p>I used Ubuntu 22.04, as a VMWare virtual machine on a Windows 10 host. It has the ability to connect an USB device to the virtual machine, but I had to replace the line<\/p>\n<pre class=\"\"><strong>usb.restrictions.defaultAllow = \"TRUE\"<\/strong><\/pre>\n<p>with<\/p>\n<pre class=\"\"><strong>usb.restrictions.defaultAllow = \"TRUE\"<\/strong><\/pre>\n<p>in the .vmx file.<\/p>\n<p>Afterwards, I connected the USB drive to the VM. It appeared as <strong>\/dev\/sdc<\/strong>. The procedure is then as simple as:<\/p>\n<pre class=\"\"><strong># umount \/dev\/sdc1<\/strong> (to remove the mount for the existing partition)\r\n<strong># gdisk \/dev\/sdc<\/strong><\/pre>\n<p>This automatically converts the partition to GPT, you have only to write it to the disk with <strong>[w]<\/strong> and confirm.<\/p>\n<p>Just to read again the disk in Linux, simply do the following:<\/p>\n<pre class=\"\"># partprobe<\/pre>\n<p>In Ubuntu, this will also make the partition to mount again (and you can check everything is there).<\/p>\n<p>That&#8217;s all! In my case, I then went back to windows and enlarged the 2 TB partition with the Disk Administration tool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The reason for this is very simple. MBR partitions do not work above 2 TB. I had (long story&#8230;) a 2 TB NTFS partition on a 4 TB USB hard&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-207","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=207"}],"version-history":[{"count":1,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":208,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions\/208"}],"wp:attachment":[{"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}