{"id":124,"date":"2012-03-05T22:42:48","date_gmt":"2012-03-05T20:42:48","guid":{"rendered":"http:\/\/www.melen.org\/u\/jan\/wp\/?p=124"},"modified":"2012-03-05T22:42:48","modified_gmt":"2012-03-05T20:42:48","slug":"creating-guid-partition-table-gpt-in-freebsd","status":"publish","type":"post","link":"https:\/\/www.melen.org\/u\/jan\/wp\/?p=124","title":{"rendered":"Creating GUID Partition Table (GPT) in FreeBSD"},"content":{"rendered":"<p>Just wanted to share a very short how to on creating GPT partition table using part command. The reasons for using GPT instead of MBR are quite obvious as disk spaces increase. The MBR partition table restricts partition sizes to a maximum of 2.19 terabytes (2.19 \u00d7 1012 bytes) or almost exactly 2 TB (2,199,023,255,040 bytes or 4,294,967,295 (232?1) sectors \u00d7 512 (29) bytes per sector). GPT supports partition sizes up to 9.3 ZB or 8 ZiB?512 bytes (9,444,732,965,739,290,426,880 bytes or 18,446,744,073,709,551,615 (264?1) sectors \u00d7 512 (29) bytes per sector). MBR disks support only four partition table entries. If more partitions are wanted, a secondary structure known as an extended partition is necessary. Extended partitions can then be subdivided into one or more logical disks. Similarly GPT support 128 partitions on a single disk allowing much larger number of filesystems on a single device without doing extension structures.<\/p>\n<p>To create an empty GPT partition table run:<br \/>\n<code><br \/>\n# gpart create -s gpt mfid1<br \/>\n<\/code><\/p>\n<p>You can check the result:<br \/>\n<code><br \/>\n# gpart show mfid1<br \/>\n=&gt;        34  5857345469  mfid1  GPT  (2.7T)<br \/>\n          34  5857345469         - free -  (2.7T)<br \/>\n<\/code><\/p>\n<p>Now create first a 50G partition:<br \/>\n<code><br \/>\n# gpart add -t freebsd-ufs -s 50G mfid1<br \/>\nmfid1p1 added<br \/>\n<\/code><\/p>\n<p>Then second partition that uses rest of the drive<br \/>\n<code><br \/>\n# gpart add -t freebsd-ufs mfid1<br \/>\nmfid1p2 added<br \/>\n<\/code><\/p>\n<p>And the result:<br \/>\n<code><br \/>\n# gpart show mfid1<br \/>\n=&gt;        34  5857345469  mfid1  GPT  (2.7T)<br \/>\n          34   104857600      1  freebsd-ufs  (50G)<br \/>\n   104857634  5752487869      2  freebsd-ufs  (2.7T)<br \/>\n<\/code><\/p>\n<p>Then just initialize the file systems:<br \/>\n<code><br \/>\n# newfs \/dev\/mfid1p1<br \/>\n...<br \/>\n# newfs \/dev\/mfid1p2<br \/>\n...<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just wanted to share a very short how to on creating GPT partition table using part command. The reasons for using GPT instead of MBR are quite obvious as disk spaces increase. The MBR partition table restricts partition sizes to a maximum of 2.19 terabytes (2.19 \u00d7 1012 bytes) or almost exactly 2 TB (2,199,023,255,040 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=\/wp\/v2\/posts\/124"}],"collection":[{"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=124"}],"version-history":[{"count":3,"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=\/wp\/v2\/posts\/124\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.melen.org\/u\/jan\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}