biolocal:Nodedisk

From Wiki CEINGE

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:51, 4 August 2009 (edit)
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...)
← Previous diff
Revision as of 14:54, 4 August 2009 (edit) (undo)
Gianluca (Talk | contribs)

Next diff →
Line 7: Line 7:
The new CentOS 5 cluster installation is based on labels for disk partitioning. 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.+A script is installed in /usr/local/sbin/build_disk.sh to create at boot time the disk partitioning if the expected partitions don't exist.
<PRE> <PRE>
Line 32: Line 32:
</PRE> </PRE>
-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.+This script is called by rc.local and works only if the partition label "scratch" isn't found and any hda partition is already mounted.
sfdisk takes some command from the std input to create the partitions: sfdisk takes some command from the std input to create the partitions:
-from 0 cylinder, with size 4161 cylinders, of type swap+*from 0 cylinder, with size 4161 cylinders, of type swap (0,4161,S)
-from last cyl, with size 4161 cylinders, of type swap+*from last cyl, with size 4161 cylinders, of type swap (,4161,S)
-from last cyl, with size 104127 cylinders, of type linux+*from last cyl, with size 104127 cylinders, of type linux (,104127,L)
Finally the partitions are created and mounted. 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)'' ''Note : The swap partition should always exist, otherwise the scheduler wouldn't get the node (it looks for nodes with free swap space)''

Revision as of 14:54, 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 don'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" isn't found 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 (0,4161,S)
  • from last cyl, with size 4161 cylinders, of type swap (,4161,S)
  • from last cyl, with size 104127 cylinders, of type linux (,104127,L)

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