How to Create Partition on Linux for more than 2TB Size using Parted -> GPT

Disclaimer: Accessing the information on this page means you agree to the Sites Privacy Policy & Terms of Use Agreement.


If you have disk that is greater than 2TB size you can create partition using parted command. Here I will show you how to create partition step by step :

First you need to identify the disk which you have attached in system which is as /dev/sdb or /dev/sdc etc …

$ fdisk /dev/sdb

After running above command you will get result related attached disk on /dev/sdb.

Once you have identify you will have to start creating partition …

$ parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type ‘help’ to view a list of commands.

(parted) print

Error: /dev/sdb: unrecognised disk label

(parted) mklabel gpt

(parted) print

Model: Unknown (unknown)

Disk /dev/sdb: 4000GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number Start End Size File system Name Flags

Now we will create partition (more than 2TB) using parted mkpart and follow below steps :

# parted /dev/sdb

(parted) mkpart primary 0GB 4000GB

(parted) print

Model: Unknown (unknown)

Disk /dev/sdb: 4000GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB   4000GB 4000GB  primary

Now to verify that the partition we have created is really works with GPT partition file system then use below command:

$ fdisk /dev/sdb 
Command (m for help): print
Disk /dev/sdb: 4000.0 GB, 4294967296 bytes
255 heads, 63 sectors/track, 718357 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1      1     267350   2147483647+  ee    GPT

Now we will format the partition and mount:

To Format the partition command is “mkfs”. Generally this takes time as per size of partition but you can see result in progress during the command running …

# mkfs /dev/sdb1 
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
360644608 inodes, 1442550528 blocks
72127526 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
44024 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848, 512000000, 550731776, 644972544
Writing inode tables:  3955/44024
Writing inode tables:  5022/44024
Writing inode tables:  7218/44024
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 23 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Once we format the partition we will mount the partition:

Create directory where you would like to mount partition, for example here we will create directory on /mnt

$ mkdir /mnt/data 
$ mount /dev/sdb1 /mnt/data
$ df -h
Filesystem            Size      Used     Avail      Use%    Mounted on
/dev/sda1             80G      2.4G       77.6G   3%          /
/dev/sdb1             4.1T   59M         4.1T        1%          /mnt/data

This article is contributed by RootLinuxBlog. If you like RootLinuxBlog and would like to contribute, you can submit an article using contact us from. See your article appearing on the RootLinuxBlog main page and help other Techies.
Please write comments if you found any error with the above article would really help us to serve you a better way. Thank you…

Linux format disk & Create Partition

Leave a Reply

Your email address will not be published. Required fields are marked *

error

Enjoy this blog? Please spread the word :)

Share