• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Extend ocfs2 Filesystem with tunefs.ocfs2 Command (Whole device used without partitions)

by admin

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

Note: from above process point 2 and 3 can be removed if data on ocfs2 is not critical – please note that its always recommended to unmount actual ocfs2 volumes to lower possibility of file-system corruption.

If ocfs2 file-system sits on partition, then please follow the below post:

How to resize an OCFS2 filesystem on Linux

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.

Filed Under: oracle, Oracle 11g, oracle 12c

Some more articles you might also be interested in …

  1. New Connections to the Database lead to ORA-12518 or TNS-12518
  2. ORA-01506: missing or illegal database name
  3. How does the RMAN Retention Policy Obsolete Incremental Backupsets
  4. Oracle RMAN interview questions
  5. CentOS / RHEL 7 : How to set udev rules for ASM on multipath disks
  6. What are Lexical Units in a PL/SQL Block
  7. Oracle RAC: How to modify private hostname, Private network IP & MTU
  8. How to Failover a Service During Instance Shutdown Using SRVCTL
  9. Oracle SQL script to Show current Users and SQL being Executed
  10. How to Verify if a Disk/Partition is in Use by Oracle ASM, was used by Oracle ASM or is never used by Oracle ASM

You May Also Like

Primary Sidebar

Recent Posts

  • Chezmoi: A multi-machine dotfile manager, written in Go
  • cheat: Create and view interactive cheat sheets on the command-line
  • chars: Display names and codes for various ASCII and Unicode characters and code points
  • chafa: Image printing in the terminal

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright