Home tmade.de

Home Wiki

OCFS2

Create

mkfs.ocfs2 -Ldata /dev/sdb1     #Format "/dev/sdb1" with ocfs2 with label name "data"

Resize a OCFS2-Partition

A OCFS2 formated Partition can be resized as follows:

1. Delete the active partition with “fdisk”.

fdisk /dev/XXX

Note: Remember the “START-” and “ENDBLOCK” number!!

2. Create the partition with new blocksize.

3. Save the partition with new size (“wq”)

4. Restart the system

Another option is to run

sfdisk –R /dev/sdXX

to reload the kernel-partitiontable.

5. Resize the partition with “tunefs.ocfs2”

tunefs.ocfs2 -S /dev/XXX

Check amount of node slots

tunefs.ocfs2 -Q "UUID = %U\nNumSlots = %N\n" /dev/sdxx

Change Node Slot Count

To change the amount of node slots (default = 4) run:

tunefs.ocfs2 -N 12 /dev/sdb1     #Change to 12 node slots

Check and Repair

fsck.ocfs2 /dev/sdb1

Mount

to mount a second OCFS2-Device on SLES10 add:

configfs             /sys/kernel/config   configfs   rw                    0 0

to the fstab.

To mount a second OCFS2-Device on SLES11 create “/etc/init.d/after.local” with following content:

mount -at ocfs2

Test

#!/bin/bash

if ! cat /proc/mounts | grep "/sys/kernel/debug" &>/dev/null; then
   mount -t debugfs none /sys/kernel/debug
   mounted=1
fi

echo "Clusterlocks held by filesystem.."
for vol in /sys/kernel/debug/ocfs2/*
do
   count=$(wc -l ${vol}/locking_state | cut -f1 -d' ');
   echo "$(basename ${vol}): ${count} locks" ;
done;

echo "Clusterresources held by filesystem.."
for vol in /sys/kernel/debug/o2dlm/*
do
   count=$(grep -c "^NAME:" ${vol}/locking_state);
   echo "$(basename ${vol}): ${count} resources" ;
done;

if [ -n "$mounted" ]; then
   umount /sys/kernel/debug
fi

http://oss.oracle.com/projects/ocfs2-tools/dist/documentation/v1.4/o2cb_ctl.html

http://oss.oracle.com/projects/ocfs2/dist/documentation/v1.2/ocfs2_faq.html