RHEL: GPT/MBR partition tables (using disks larger than 2 TiB)

# Tested on RHEL 6 & 7

# Up to now the default type of the partition table of a hard disk is MBR (msdos).
This
# old method presents some problems like the limitation of having a maximum of four primary
# partitions but the main problem is that we can't go beyond the first 2 TiB of the disk.

# Nowadays physical disks are growing in size quickly. A way of solving this problem is
# by switching to GPT (GUID Partition Table) partitioning scheme.

# To partition a disk using GPT we first have to write a GPT label to it. The way to do
# it is the following:

parted /dev/<sde> mklabel gpt
   Warning: The existing disk label on /dev/sde will be destroyed and all data on this disk will be
   lost. Do you want to continue?
   Yes/No? Yes
   Information: You may need to update /etc/fstab.


# If we want to make the disk usable by LVM, first we have to partition the disk and mark
#
the new partitions with the "LVM label" so let's create
a new partition and change
# its name and flags

parted /dev/sde
   GNU Parted 3.1
   Using /dev/sde
   Welcome to GNU Parted! Type 'help' to view a list of commands.
   (parted) mkpart primary 1M 500M
   (parted) name 1 mypart
   (parted) p
   Model: ATA VBOX HARDDISK (scsi)
   Disk /dev/sde: 4295MB
   Sector size (logical/physical): 512B/512B
   Partition Table: gpt
   Disk Flags:

   Number  Start   End    Size   File system  Name    Flags
    1      1049kB  500MB  499MB               mypart

   (parted) set 1 lvm on
   (parted) p
   Model: ATA VBOX HARDDISK (scsi)
   Disk /dev/sde: 4295MB
   Sector size (logical/physical): 512B/512B
   Partition Table: gpt
   Disk Flags:

   Number  Start   End    Size   File system  Name    Flags
    1      1049kB  500MB  499MB               mypart  lvm

   (parted) q
   Information: You may need to update /etc/fstab.


# On RHEL 6, 'fdisk' is not able to manage disk partition table anymore:

myrhel6:/root#> fdisk -l /dev/sde
   WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.
   [...]

# On RHEL 7, we get a message indicating that 'fdisk' support is in experimental phase:

myrhel7:/root#> fdisk -l /dev/sde
   WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
   [...]


# To switch back to MBR partition table, do the the following:

parted /dev/<sde> mklabel msdos
   Warning: The existing disk label on /dev/sde will be destroyed and all data on this disk will be
   lost. Do you want to continue?
   Yes/No? Yes

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Exclude multiple files and directories with rsync
Viewed 2562 times since Wed, Oct 31, 2018
Method 2 – Use shell scripts How to install yum cron on a CentOS/RHEL 6.x/7.x
Viewed 4172 times since Tue, Dec 4, 2018
6 rsync Examples to Exclude Multiple Files and Directories using exclude-from
Viewed 4953 times since Wed, Oct 31, 2018
Linux PAM configuration that allows or deny login via the sshd server
Viewed 1981 times since Wed, Oct 3, 2018
RHCS6: Basic operations on clustered services
Viewed 2704 times since Sun, Jun 3, 2018
How to Register and Enable Red Hat Subscription, Repositories and Updates for RHEL 7.0 Server
Viewed 12653 times since Mon, Oct 29, 2018
linux ssh Remotely Initiated Reverse SSH Tunnel
Viewed 3174 times since Wed, Apr 22, 2020
How to Migrate from RHEL 8 to CentOS 8
Viewed 3059 times since Fri, May 15, 2020
Managing temporary files with systemd-tmpfiles on Red Hat Enterprise Linux 7
Viewed 9626 times since Sun, Nov 22, 2020
Linux - How to perform I/O performance test with dd command
Viewed 6087 times since Fri, Jun 8, 2018