mkfs.ocfs2 -Ldata /dev/sdb1 #Format "/dev/sdb1" with ocfs2 with label name "data"
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
tunefs.ocfs2 -Q "UUID = %U\nNumSlots = %N\n" /dev/sdxx
To change the amount of node slots (default = 4) run:
tunefs.ocfs2 -N 12 /dev/sdb1 #Change to 12 node slots
fsck.ocfs2 /dev/sdb1
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
#!/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