How to partition 22TB disk?
The simplest solution is to use GPT partitioning, a 64-bit version of Linux, and XFS:
GPT is necessary because the MS-DOS-style MBR partition table created by
fdisk
is limited to 2 TiB disks. So, you need to useparted
or another GPT-aware partitioning program instead offdisk
. (gdisk
,gparted
, etc.)A 64-bit kernel is necessary because 32-bit kernels limit you to filesystems smaller than you're asking for. You either hit a size limit based on 32-bit integers or end up not being able to address enough RAM to support the filesystem properly.
XFS is not the only solution, but in my opinion it is the easiest one for RHEL systems.
You cannot use ext4 for this in RHEL 6. Although the filesystem was designed to support 1 EiB filesystems, there is an artificial 16 TiB volume size limit in the version of
e2fsprogs
included in RHEL 6 and its derivatives. Both Red Hat and CentOS call this out in their docs. (The ext4 16 TiB limit was raised considerably in RHEL 7 to 50 TiB.)ZFS may not be practical in your situation. Because of its several legal and technical restrictions, I can't outright recommend it unless you need something only ZFS gives you.
Having ruled out your two chosen filesystems, I suggest XFS. It is the default filesystem in RHEL 7, it was available as a supported filesystem in all RHEL 6 versions, and was backported to the later RHEL 5 releases after RHEL 6 came out.
Here's the process:
Check whether you have
mkfs.xfs
installed by running it without arguments. If it's not present, install the userland XFS tools:# yum install xfsprogs
If that failed, it's probably because you're on an older OS that doesn't have this in its default package repository. You really should upgrade, but if that is impossible, you can get this from CentOSPlus or EPEL. You may also need to install the
kmod_xfs
package.Create the partition:
Since you say your 22 TiB volume is on
/dev/sdb
, the commands forparted
are:# parted /dev/sdb mklabel gpt # parted -a optimal -- /dev/sdb mkpart primary xfs 1 -1
That causes it to take over the entire volume with a single partition. Actually, it ignores the first 1 MiB of the volume, to achieve the 4 KiB alignment required to get the full performance from Advanced Format HDDs and SSDs.
You could skip this step and format the entire volume with XFS. That is, you would use
/dev/sdb
in the example below instead of/dev/sdb1
. This avoids the problem of sector alignment. In the case of a volume that only your Linux-based OS will see, there are no downsides worth speaking about, but I'd caution against doing this on a removable volume or on an internal volume in a multi-booting computer, since some OSes (Windows and macOS, for instance) will offer to format a partitionless hard drive for you every time it appears. Putting the filesystem on a partition solves this.Format the partition:
# mkfs.xfs -L somelabel /dev/sdb1
Add the
/etc/fstab
entry:LABEL=somelabel /some/mount/point xfs defaults 0 0
Mount up!
# mount /some/mount/point
If you want to go down the LVM path, the above steps are basically just a more detailed version of the second set of commands in user bsd
's answer below. You have to do his first set of commands before the ones above.
LVM offers certain advantages at a complexity cost. For instance, you can later "grow" an LVM volume group by adding more physical volumes to it, thereby making space to grow the logical volume ("partition" kinda, sorta), which in turn lets you grow the filesystem living on the logical volume. (See what I mean about complexity? :))
Just as an alternative to the other suggestions.
You don't have to partition a disk at all.
You could simple create a Volume Group, with one or more Logical Volumes.
pvcreate /dev/sdb
vgcreate data /dev/sdb
lvcreate --name dump -L '100%VG' data
Now you have a logical volume that you can format with any filesystem type you wish.
mkfs.XXXX /dev/mapper/data-dump #<- XXXX can be ext4, xfs, btrfs, reiser
mount /dev/mapper/data-dump /mntpt
Question to the question: You asked 'how to partition 22TB disk' and then in the question again, you said, you just wanted a 22TB partition. So this is ambiguos in first place.
If you already have a single block device which can support 22TB of space on it, then you already posses whole 22TB partition. All you need is a filesystem on top of it, which will make the device mountable and usable for reading/writing by system processes. More ever, you need to have a Linux kernel running in 64-bit mode with a filesystem module/driver that supports and scales to 22TB of data growth, can handle the ins and outs of managing the data on the (single) block device with ease. Performance is altogether another dimension to it. In such case, I would opt to choose XFS
as my filesystem, for the reason that it is a 64-bit filesystem and capable of handling filesystems as large as a million terabytes. It supports upto 9 EXABYTES.
2^63 = 9 x 1018 = 9 exabytes
For more details on XFS: http://oss.sgi.com/projects/xfs/
If you are looking for further partitioning the huge 22TB block device, then use gparted
to split the device into usable partitions and then format them with the filesystems to make them mountable.
It seems that you have got hardware RAID controller, since you mention that you have got DELL perc RAID controller -- which will mean that, you have to tell which RAID configuration (precisely which RAID level are you using?) and in most cases, you are not going to get complete 22TB of space for use, I could be wrong though.