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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. Running RMAN DUPLICATE / RESTORE on a different version than source database version.
  2. Oracle Database – How to Rename a Datafile with Special Characters Created by Mistake
  3. Unable to instantiate disk “ASM_DISK” – error on running ‘oracleasm scandisks’ command
  4. How to extend ASM disk from OS level in CentOS/RHEL
  5. Oracle Database 12c : Creating a Scheduler Job in a Multitenant Database
  6. Oracle RMAN 12c – New Features
  7. Manage ASM Audit Files with syslog – configure lograte and auditing
  8. How to Migrate ASM Disk Groups to another Storage Online [non ASMLIB Devices]
  9. Oracle ASM – How ASM Disk Resync Works
  10. ASM background processes in 11gR2

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ICMP redirects on CentOS/RHEL
  • What are Oracle Key Vault Roles
  • What Is Oracle Key Vault
  • Auditing with Oracle Database Vault Reports
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary