The below process works only for an ocfs2 file-system created on whole device (with no partitions used):
1. Make sure that an ocfs2 backup is present before continuing.
2. Prepare global outage to extend the ocfs2 fs.
3. Unmount the share on all nodes using it (for safety reasons, such as avoiding data corruption if a node writes to the device when the disk extend is being performed)
4. Make sure that the new LUN size is visible under OS (using any scsi rescan command) on all nodes.
5. Extend the actual LUN used for ocfs2 volume via multipath on first node:
# multipathd -k"resize map LUN_WWID_HERE"
6. Verify if remaining nodes are seeing the new size via multipath command, if not execute:
# multipathd -k"resize map LUN_WWID_HERE"
It should show now new size (2TB)
7. Extend ocfs2 fs via tune command on first node:
# tunefs.ocfs2 -S /dev/mapper/LUN_WWID_HERE
From the man page for -S Flag:
option -S, --volume-size Grow the size of the OCFS2 file system. If blocks-count is not specified, tunefs.ocfs2 extends the volume to the current size of the device.
8. Mount fs on first node and verify if its extended
# df -k /dev/mapper/LUN_WWID_HERE
9. Mount fs on the remaining nodes
If ocfs2 file-system sits on partition, then please follow the below post:
Creating Filesystem size greater than 2TB
Please be aware that above method is old and if the file system needs to be extended above > 2TB then partition needs to be re-created (fdisk won’t work with 2TB devices and changing the partition type to GPT will cause data to wipe)
To re-create the partition or create new disk with more than 2TB with partition type GPT perform the below steps:
1. Partition disk as GPT:
# parted -s /dev/disk_id_here mklabel gpt
2. Create primary partition:
# parted -s -- /dev/disk_id_here mkpart primary 0 -1
3. Create ocfs2 volume:
# mkfs.ocfs2 -b 4k -J size=128M -C 64k -N number_of_nodes_here /dev/disk_id_here_with_created_partition
4. Copy over the data from old ocfs2 which cannot be extended over 2TB.
# rsync -avz /old_ocfs2_dir /new_ocfs2_dir
The above recreation must be used as trying to simply extend over 2TBs from a standard partition to GPT is not possible.