biolocal:Nodedisk
From Wiki CEINGE
(Difference between revisions)
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 |
Current revision (13:05, 28 October 2009) (edit) (undo) Mauro (Talk | contribs) |
||
(One intermediate revision not shown.) | |||
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 | + | 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 26: | Line 26: | ||
,104127,L | ,104127,L | ||
EOF | EOF | ||
- | /sbin/mkswap /dev/hda1; /sbin/mkswap | + | /sbin/mkswap /dev/hda1; /sbin/mkswap /dev/hda2; |
/sbin/mkfs -t ext3 -L scratch /dev/hda3; /bin/mount LABEL=scratch | /sbin/mkfs -t ext3 -L scratch /dev/hda3; /bin/mount LABEL=scratch | ||
fi | fi | ||
fi | fi | ||
+ | /sbin/swapon /dev/hda1; /sbin/swapon /dev/hda2; | ||
</PRE> | </PRE> | ||
- | This script is called by rc.local and works only if the partition label "scratch" | + | 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)'' |
Current revision
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/mkfs -t ext3 -L scratch /dev/hda3; /bin/mount LABEL=scratch fi fi /sbin/swapon /dev/hda1; /sbin/swapon /dev/hda2;
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)