Wednesday, August 12, 2015

Linux GPT Partitioning

In linux, for MBR disk the partition size can only go upto maximum 0f 2TB.

To solve this problem use GNU parted command with GPT ( GUID Partition Table format). It supports Intel EFI/GPT partition tables. (GPT) is a standard for the layout of the partition table on a physical hard disk.

Create a new GPT disklabel

root@nirav:~# parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands

Create a new GPT disklabel

(parted) mklabel gpt
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?
Yes/No? Yes

set the default unit to TB

(parted) unit TB

Make a partition of 4TB

(parted) mkpart primary 0.00TB 4.00TB

Print the partition table

(parted) print

Model: ATA WDC WD40PURX-64G (scsi)
Disk /dev/sdb: 4.00TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  4.00TB  4.00TB  ext4         primary

(parted) quit

Information: You may need to update /etc/fstab.

root@nirav:~# mkfs.ext4 /dev/sdb1

No comments:

Post a Comment