{"id":6620,"date":"2017-04-10T12:59:45","date_gmt":"2017-04-10T04:59:45","guid":{"rendered":"http:\/\/rmohan.com\/?p=6620"},"modified":"2017-04-10T12:59:45","modified_gmt":"2017-04-10T04:59:45","slug":"creating-a-partition-size-larger-than-2tb-on-linux","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6620","title":{"rendered":"Creating a partition size larger than 2TB on Linux"},"content":{"rendered":"<p>I had to mount and use a 3TB SATA HD on Linux, and as I thought, I wasn\u2019t going to be able to format and create a new partition using fdisk command.<\/p>\n<p>fdisk tool won\u2019t create partitions larger than 2 TB. This is fine for desktop users, but on a production server you may need a large partition.<\/p>\n<p>The way to solve this issue was to use GNU parted command with GPT (partition table). This is the full how to in case you need it:<\/p>\n<p>Create 3TB partition size on Linux<\/p>\n<p>Run gparted as follows, replace sdb with your real disk name:<\/p>\n<p>parted \/dev\/sdb<br \/>\nOutput:<\/p>\n<p>GNU Parted 2.3<br \/>\nUsing \/dev\/sdb<br \/>\nWelcome to GNU Parted! Type &#8216;help&#8217; to view a list of commands.<br \/>\n(parted)<br \/>\nNow type \u201cmklabel gpt\u201c, as you see below:<\/p>\n<p>(parted) mklabel gpt<br \/>\nOutput should be something like this:<\/p>\n<p>Warning: The existing disk label on \/dev\/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?<br \/>\nYes\/No? yes<br \/>\n(parted)<br \/>\nNow, let\u2019s set default size unit to TB, type \u201cunit TB\u201d and press enter:<\/p>\n<p>(parted) unit TB<br \/>\nType: mkpart primary 0.00TB 3.00TB to create a 3TB partition:<\/p>\n<p>(parted) mkpart primary 0.00TB 3.00TB<br \/>\nTo print the current partitions, type p :<\/p>\n<p>(parted) p<br \/>\nSample outputs:<\/p>\n<p>Disk \/dev\/sdb: 3.00TB<br \/>\nSector size (logical\/physical): 512B\/512B<br \/>\nPartition Table: gpt<br \/>\nNumber Start End Size File system Name Flags<br \/>\n1 0.00TB 3.00TB 3.00TB ext4 primary<br \/>\nNow type quit to exit the gparted console.<\/p>\n<p>(parted) quit<br \/>\nNow format the new patition:<\/p>\n<p>mkfs.ext4 \/dev\/sdb1<br \/>\nMount the new drive:<\/p>\n<p>mkdir \/mnt\/appdisk<br \/>\nmount \/dev\/sdb1 \/mnt\/appdisk<br \/>\nNow add that mount point to \/etc\/fstab, example:<\/p>\n<p>\/dev\/sdb1 \/mnt\/appdisk ext4 defaults 0 1<br \/>\nNow type df -ah to see if the drive is mounted properly, you should see something like this:<\/p>\n<p>\/dev\/sdb1 3.0T 321M 2.9T 1% \/mnt\/appdisk<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had to mount and use a 3TB SATA HD on Linux, and as I thought, I wasn\u2019t going to be able to format and create a new partition using fdisk command.<\/p>\n<p>fdisk tool won\u2019t create partitions larger than 2 TB. This is fine for desktop users, but on a production server you may need [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6620"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6620"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6620\/revisions"}],"predecessor-version":[{"id":6621,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6620\/revisions\/6621"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}