biolocal:Nodedisk

From Wiki CEINGE

(Difference between revisions)
Jump to: navigation, search

Gianluca (Talk | contribs)
(New page: Each node should be initialized with the following partitions on the local disk: * swap1 - 2Gb * swap2 - 2Gb * scratch - 50Gb The new CentOS 5 cluster installation is based on labels for...)
Next diff →

Revision as of 14:51, 4 August 2009

Each node should be initialized with the following partitions on the local disk:

  • swap1 - 2Gb
  • swap2 - 2Gb
  • scratch - 50Gb


The new CentOS 5 cluster installation is based on labels for disk partitioning.

A script is installed in /usr/local/sbin/build_disk.sh to create at boot time the disk partitioning if the expected partitions doesn't exist.

cat /usr/local/sbin/build_disk.sh

#!/bin/sh

/sbin/findfs LABEL=scratch 2>1 > /dev/null;

if [ $? -ne 0 ];
then
        /bin/mount | grep hda
        if [ $? -ne 0 ];
        then
                /sbin/sfdisk /dev/hda << EOF
0,4161,S
,4161,S
,104127,L
EOF
                /sbin/mkswap /dev/hda1; /sbin/mkswap /dev/hda2; /sbin/swapon /dev/hda1; /sbin/swapon /dev/hda2;
                /sbin/mkfs -t ext3 -L scratch /dev/hda3; /bin/mount LABEL=scratch
        fi
fi

This script is called by rc.local and works only if the partition label "scratch" doesn0't exist and any hda partition is already mounted.

sfdisk takes some command from the std input to create the partitions: from 0 cylinder, with size 4161 cylinders, of type swap from last cyl, with size 4161 cylinders, of type swap from last cyl, with size 104127 cylinders, of type linux

Finally the partitions are created and mounted.

Note : The swap partition should always exist, otherwise the scheduler wouldn't get the node (it looks for nodes with free swap space)

Personal tools