August 16, 2011
On Unix or Linux I never had to manage LUNs larger than 2To because using LVM I can create very large filesystems with reasonably small LUNs (in general I use LUNs from 256Go to 2To depending on purpose of the filesystem). It’s more convenient to manage “small” LUNs as you arrange them the way you want.
Nevertheless, low cost storage DAS arrays (understand array without SAN like eSATA arrays) sometimes comes with very basic option RAID level, number of disks, period.
In this case I have a SAS array with two RAID 5 volumes, 23To each and I want to make 1 big filesystem with the 2 disks.
Usually I choose fdisk to create partitions but fdisk will fail to manage volumes greater than 2To (MBR limitations).
In order to create larger partitions you have to use GPT (GUID partition table) and EFI partitions.
GPT support must be included in the kernel in order to work with EFI partitions.
A lot of professional Linux distributions embed GPT support by default.
GNU Parted is GPT compatible, so this is how to proceed.
Create the two 23To partitions with parted:
# parted /dev/sdc mklabel gpt # parted /dev/sdc mkpart primary 1 -1 # parted /dev/sdd mklabel gpt # parted /dev/sdd mkpart primary 1 -1
(-1 indicate the end of the disk).
# parted dev/sdc print Model: DELL PERC 6/E Adapter (scsi) Disk /dev/sdc: 24.0TB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 24.0TB 24.0TB primary # parted /dev/sdd print Model: DELL PERC 6/E Adapter (scsi) Disk /dev/sdd: 24.0TB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 24.0TB 24.0TB primary
LVM and xfs :
Use LVM to aggregate the 2 partitions:
# pvcreate /dev/sdc1 /dev/sdd1 # vgcreate vg_data /dev/sdc1 /dev/sdd1 # lvcreate -l 100%FREE -n lvdata1 vg_data
And create the filesystem :
# mkfs -t xfs /dev/vg_data/lvdata1 # df -h /dev/mapper/vg_data-lvdata1 Filesystem Size Used Avail Use% Mounted on /dev/mapper/ vg_data-lvdata1 44T 534G 44T 2% /backupst1
I had to use xfs (you will need a license on some professional Linux distributions) because ext4 is limited to 16To filesystems.