Description: TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. . ocfs2-tools (1.6.4-3ubuntu2+lliurex1) precise; urgency=low . * Added lliurex-features Author: dmontalva --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: http://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- /dev/null +++ ocfs2-tools-1.6.4/vars/ocfs2 @@ -0,0 +1,19 @@ +{ + + "OCFS2_DISK": { + "function": "lliurex.variables.ocfs2_disk.init", + "packages": [ + "ocfs2tools" + ], + "description": "set the device formated in ocfs2 filesystem", + "value": null + }, + "OCFS2_NET_EXPORT_DIRS": { + "function": "lliurex.variables.ocfs2_net_export_dirs.init", + "packages": [ + "ocfs2tools" + ], + "description": "set the folders mounted in ocfs2 cluster", + "value": null + } +} --- /dev/null +++ ocfs2-tools-1.6.4/lliurex-install/etc/mpath.conf.lliurex @@ -0,0 +1,20 @@ +# Don't include blacklisted devices when creating multipaths +blacklist { + devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" + devnode "^hd[a-z][[0-9]*]" + devnode "^vd[a-z][[0-9]*]" + devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]" + +} + +defaults { + path_grouping_policy multibus + failback immediate + user_friendly_names yes + polling_interval 5 + +} + +# +# As new volumes get added, they can be named. +# --- /dev/null +++ ocfs2-tools-1.6.4/lliurex-install/etc/ocfs2/cluster.lliurex @@ -0,0 +1,59 @@ +node: + ip_port = 7777 + ip_address = 10.4.0.2 + number = 0 + name = centro + cluster = ocfs2 + +node: + ip_port = 7777 + ip_address = 10.4.0.3 + number = 1 + name = aula1 + cluster = ocfs2 + +node: + ip_port = 7777 + ip_address = 10.4.0.4 + number = 2 + name = aula2 + cluster = ocfs2 + +node: + ip_port = 7777 + ip_address = 10.4.0.5 + number = 3 + name = aula3 + cluster = ocfs2 + +node: + ip_port = 7777 + ip_address = 10.4.0.6 + number = 4 + name = aula4 + cluster = ocfs2 + +node: + ip_port = 7777 + ip_address = 10.4.0.7 + number = 5 + name = aula5 + cluster = ocfs2 + +node: + ip_port = 7777 + ip_address = 10.4.0.8 + number = 6 + name = aula6 + cluster = ocfs2 + +node: + ip_port = 7777 + ip_address = 10.4.0.9 + number = 7 + name = aula7 + cluster = ocfs2 + +cluster: + node_count = 8 + name = ocfs2 --- /dev/null +++ ocfs2-tools-1.6.4/lliurex-install/usr/sbin/llxcfg-cluster @@ -0,0 +1,110 @@ +#!/bin/sh + +usage() { + +echo "Usage: llxcfg-cluster fix-cluster (no superblock restore) +\tllxcfg-cluster fix-cluster-superblock [NUM_BACKUP_SUPERBLOCK 1-6] +\tllxcfg-cluster reconfigure-ocfs2 +\tllxcfg-cluster force-umount +\tllxcfg-cluster start-service (only mount ocfs2) +\tllxcfg-cluster restart-service (also force umount) +\tllxcfg-cluster tune-nodes {NUM_NODES} (new max slots nodes. Default:8) +\tllxcfg-cluster restart-cluster (restarts ocfs2 cluster and mount service) +\tllxcfg-cluster stats +\tllxcfg-cluster nodes +\tllxcfg-cluster cap-replication [ENABLED|DISABLED] +" +exit 0 +} + +[ $1 ] || usage + +[ "$(id -u)" != "0" ] && exit 0 + +OCFS2_MOUNT_FSTAB="/ocfs2" +eval `n4d-vars getvalues OCFS2_NET_EXPORT_DIRS` +eval `n4d-vars getvalues OCFS2_DISK` + +#eval $(n4d-vars getvalues OCFS2_EXPORT_DIRS OCFS2_MOUNT_FSTAB OCFS2_DISK) + + +case $1 in + fix-cluster) + CHECK_MOUNT_OCFS2=$(LC_ALL=C awk -v dev="$OCFS2_DISK" -v fstab="$OCFS2_MOUNT_FSTAB" '$1 == dev && $2 == fstab && $3 == "ocfs2" { print "yes" }' /proc/mounts) + [ "$CHECK_MOUNT_OCFS2" = "yes" ] && echo "Please first umount your OCFS2 filesystem." && exit 0 + fsck.ocfs2 -f -p -y $OCFS2_DISK + export DEBIAN_FRONTEND=noninteractive + export DEBCONF_FRONTEND=noninteractive + /etc/init.d/ocfs2 stop + /etc/init.d/ocfs2-umount stop + dpkg-reconfigure ocfs2-tools + /etc/init.d/ocfs2-umount start + /etc/init.d/ocfs2 start + ;; + fix-cluster-superblock) + CHECK_MOUNT_OCFS2=$(LC_ALL=C awk -v dev="$OCFS2_DISK" -v fstab="$OCFS2_MOUNT_FSTAB" '$1 == dev && $2 == fstab && $3 == "ocfs2" { print "yes" }' /proc/mounts) + [ "$CHECK_MOUNT_OCFS2" = "yes" ] && echo "Please first umount your OCFS2 filesystem." && exit 0 + BLOCK=2 + [ $2 ] && BLOCK=$2 + fsck.ocfs2 -f -y -r $BLOCK $OCFS2_DISK + export DEBIAN_FRONTEND=noninteractive + export DEBCONF_FRONTEND=noninteractive + /etc/init.d/ocfs2 stop + /etc/init.d/ocfs2-umount stop + dpkg-reconfigure ocfs2-tools + /etc/init.d/ocfs2-umount start + /etc/init.d/ocfs2 start + ;; + force-umount) + /etc/init.d/ocfs2-umount stop + service ocfs2-tools stop + ;; + start-service) + service ocfs2-tools start + ;; + restart-service) + CHECK_MOUNT_OCFS2=$(LC_ALL=C awk -v dev="$OCFS2_DISK" -v fstab="$OCFS2_MOUNT_FSTAB" '$1 == dev && $2 == fstab && $3 == "ocfs2" { print "yes" }' /proc/mounts) + if [ "$CHECK_MOUNT_OCFS2" = "yes" ]; then + /etc/init.d/ocfs2-umount stop + fi + service ocfs2-tools stop + service ocfs2-tools start + ;; + tune-nodes) + [ "$CHECK_MOUNT_OCFS2" = "yes" ] && echo "Please first umount your OCFS2 filesystem." && exit 0 + [ $2 ] && tunefs.ocfs2 -N $2 $OCFS2_DISK && exit 0 + echo "Please especify Max Node Slots." + ;; + restart-cluster) + /etc/init.d/ocfs2-umount stop + service ocfs2-tools stop + /etc/init.d/ocfs2 stop + /etc/init.d/o2cb stop + /etc/init.d/o2cb start + /etc/init.d/ocfs2 start + service ocfs2-tools start + ;; + reconfigure-ocfs2) + /etc/init.d/ocfs2-umount stop + service ocfs2-tools stop + /etc/init.d/ocfs2 stop + /etc/init.d/o2cb stop + export DEBIAN_FRONTEND=noninteractive + export DEBCONF_FRONTEND=noninteractive + dpkg-reconfigure ocfs2-tools + /etc/init.d/o2cb restart + /etc/init.d/ocfs2 restart + service ocfs2-tools start + ;; + cap-replication) + #[ "$2" = "ENABLED" ] && llxcfg-setvars CAP_DATA_REPLICATION='ENABLED' + #[ "$2" = "DISABLED" ] && llxcfg-setvars CAP_DATA_REPLICATION='DISABLED' + ;; + stats) + debugfs.ocfs2 -R "stats" $OCFS2_DISK + ;; + nodes) + mounted.ocfs2 -f + ;; +esac + --- /dev/null +++ ocfs2-tools-1.6.4/lliurex-install/usr/sbin/lliurex-format-ocfs2 @@ -0,0 +1,17 @@ +#!/bin/bash +usage() { + +echo "Usage: llxcfg-cluster fix-cluster (no superblock restore) +\tlliurex-format-ocfs2 device [NODES] +\texample: lliurex-format-ocfs2 /dev/vdb 8 +" +exit 0 +} +[ $1 ] || usage + +NODES=8 + +[ $2 ] && NODES=$2 + +mkfs.ocfs2 -N $NODES --fs-feature-level=max-features --fs-features=xattr -L net $1 +n4d-vars setvalue OCFS2_DISK "$1" \ No newline at end of file