Partitioning the disks

From ImageWiki

Jump to: navigation, search

Disk servers

Each disk server has 1 320 GB PATA disk on which the system partitions should be installed. Furthermore it includes 6 750 GB SATA disks for data storage.

The system disk (PATA disk, /dev/hda) has been partitioned as (all primary partitions):

imagediskserver1 ~ # fdisk /dev/hda
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          13      104391   83  Linux                  /boot (100MB, ext2)
/dev/hda2              14         535     4192965   82  Linux swap / Solaris   swap  (4096MB)
/dev/hda3             536       38913   308271285   83  Linux                  /     (the rest, ext3)


The data disks have been configured as a Software RAID 5 array and partitioned using LVM2 logical volumes. First make sure that RAID 5 and LVM2 support is compiled into the kernel. Alternatively use modules and do

modprobe raid5
modprobe dm-mod

Each of the 6 SATA disks (sda, sdb, sdc, sdd, sde, sdf) was partitioned with one primary partition with system ID 'linux raid autodetect' (ID code: fd):

imagediskserver1 ~ # fdisk /dev/sda
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       91201   732572001   fd  Linux raid autodetect

In order to create the RAID array first create a multi device:

mknod /dev/md1 b 9 1

Then create the array

mdadm --create /dev/md1 --level=5 --raid-devices=6 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

On the RAID 5 array (/dev/md1) we create 2 partitions using LVM2

livecd ~ # pvcreate /dev/md1
livecd ~ # vgcreate vg /dev/md1
livecd ~ # lvcreate -L2500G -ndata vg
livecd ~ # lvcreate -L993.17G -nscratch vg
livecd ~ # mke2fs -j -L DATA /dev/vg/data
livecd ~ # mke2fs -j -L SCRATCH /dev/vg/scratch

On imagediskserver1 scratch is called home:

livecd ~ # pvcreate /dev/md1
livecd ~ # vgcreate vg /dev/md1
livecd ~ # lvcreate -L2500G -ndata vg
livecd ~ # lvcreate -L993.17G -nhome vg
livecd ~ # mke2fs -j -L DATA /dev/vg/data
livecd ~ # mke2fs -j -L HOME /dev/vg/home

Mount the partitions:

livecd ~ # mkdir /mnt/data
livecd ~ # mkdir /mnt/scratch
livecd ~ # mount /dev/vg/data /mnt/data
livecd ~ # mount /dev/vg/scratch /mnt/scratch


To make the mounting permanent add the following to /etc/fstab:

imagediskserver1:

# LVM2 Drives:
/dev/vg/data            /image/data1       ext3            noatime         1 2
/dev/vg/home            /home              ext3            noatime         1 2

imagediskserver2:

# LVM2 Drives:
/dev/vg/data            /image/data2       ext3            noatime         1 2
/dev/vg/scratch         /image/scratch1    ext3            noatime         1 2

imagediskserver3:

# LVM2 Drives:
/dev/vg/data            /image/data3       ext3            noatime         1 2
/dev/vg/scratch         /image/scratch2    ext3            noatime         1 2

IBM blade servers

Each IBM blade server has 2 146.6 GB SATA disks (/dev/sda and /dev/sdb).


The system disk (/dev/sda) has been partitioned as (all primary partitions):

imageserver3 ~ # fdisk /dev/sda
Disk /dev/sda: 146.6 GB, 146694733824 bytes
255 heads, 63 sectors/track, 17834 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          13      104391   83  Linux                   /boot (99 MB, ext2)
/dev/sda2              14        4496    36009697+  82  Linux swap / Solaris    swap  (34 GB)
/dev/sda3            4497       17834   107137485   83  Linux                   /     (101 GB, ext3)

The scratch disk (/dev/sdb) has been partitioned as (all primary partitions):

imageserver3 ~ # fdisk /dev/sdb
Disk /dev/sdb: 146.6 GB, 146694733824 bytes
255 heads, 63 sectors/track, 17834 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4483    36009666   82  Linux swap / Solaris    swap (34 GB)
/dev/sdb2            4484       17834   107241907+  83  Linux                   /image/localscratch (101 GB, ext3)


NOTE: There are two swap partitions (one on each disk), because the Linux kernel will automatically use RAID 0 stripping on the swap disk theoretically doubling swap disk speed.


The following commands was issued to create file systems:

mkswap /dev/sda2 && swapon /dev/sda2
mkswap /dev/sdb1 && swapon /dev/sdb1
mke2fs -L BOOT /dev/sda1
mke2fs -j -L ROOT /dev/sda3
mke2fs -j -L localscratch /dev/sdb2
mount /dev/sda3 /mnt/root 
mkdir /mnt/root/image
mkdir /mnt/root/image/localscratch


On all imageserver1-3 machines the /etc/fstab file includes the following lines:

/dev/sda1               /boot           ext2            noauto,noatime  1 2
/dev/sda3               /               ext3            noatime         0 1
/dev/sda2               none            swap            sw              0 0
/dev/cdrom              /mnt/cdrom      auto            noauto,ro       0 0
/dev/sdb1               none            swap            sw              0 0
/dev/sdb2               /image/localscratch     ext3    noatime         1 2
Personal tools