I thought I would add to this thread as it is about disks > 2TB. I upgraded my server just over 2 years ago with 4 x 2TB HDD and I have run out of space again. I want to replace the 4 x 2TB HDD with 6 x 4TB HDD to take me from 5.5TB to 19TB of storage with it all as one volume and preferably using xfs.
I have spent the last week reading that many articles that I became confused, I was trying to find a way around fdisk and it's 2TB limit and after some experimenting I think I have a way to do this at the moment on a test PC that has an Asus H170 Pro MB, similar to the MB in my server. What follows is a bullet point description of what I have done.
- In BIOS enable UEFI and choose “Other OS”, 1 x 500GB and 1 x 1TB sata disks installed.
- Boot from the Centos 6.7 Live DVD.
- Install gdisk, create a GPT partition on both disks and then partition sda1 and sdb1 as 500M with a GUID of fd00 (Linux RAID). Then partition sda2 and sdb2 as 465G with a GUID of fd00 (Linux RAID).
- Run mdadm and create a RAID set md0 on sda1 and sdb1 with metadata=0.90 for booting. Then create a RAID set md1 on sda2 and sdb2 with default metadata.
- Create a pv on md1 and then create a vg called main.
- Boot off the SME Server 9.1 CD, select Advanced installation options and then select to install from the graphical interface.
- Select the normal options and then select Create Custom Layout for disks.
- Click on md0, tick the format box and set it up as /boot.
- Click on vg main, select edit and add lv root, mount point / of 30G, then add lv swap, mount point swap of 10G.
- Proceed with the installation, reboot and configure and then do an update.
- Install gdisk and xfsprogs.
- Create an lv called files in vg main using all the remaining space in main and format it with xfs.
- Make a backup of the directory structure below /home/e-smith/files and then delete all.
- Mount the new lv files using mount /dev/mapper/main-files -t xfs /home/e-smith/files.
- Make sure the lv is mounted and then copy the directory structure back to /home/e-smith/files.
- Edit /etc/fstab and add the entry for lv main-files then reboot and check that it has mounted correctly.
This is repeatable, I have done it twice so far with exactly the same result but I haven't done a lot of testing like creating users and testing access as a normal user which I will do. I am assuming that there should be no real difference between doing this on the small HDD I used and doing it on some 4TB HDD, can anybody think of a reason why this wouldn't work with larger disks.
[root@test ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[0] sdb1[1]
510912 blocks [2/2] [UU]
md1 : active raid1 sda2[0] sdb2[1]
486943744 blocks super 1.2 [2/2] [UU]
bitmap: 1/4 pages [4KB], 65536KB chunk
unused devices: <none>
[root@test ~]# mount
/dev/mapper/main-root on / type ext4 (rw,usrquota,grpquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/md0 on /boot type ext4 (rw)
/dev/mapper/main-files on /home/e-smith/files type xfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
[root@test ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/main-root
29G 1.8G 26G 7% /
tmpfs 3.8G 0 3.8G 0% /dev/shm
/dev/md0 476M 57M 394M 13% /boot
/dev/mapper/main-files
426G 33M 426G 1% /home/e-smith/files
[root@test ~]#