Partitioning in Kusu
by
on June 10th, 2008 at 04:18 PM (1553 Views)
Partitioning is important in Kusu for the following reasons:
- On the master node, the disks need to be correctly partitioned, so that repositories can be created on the disk before handing over to the distro's auto-installation mechanism.
- On the compute node, partitioning needs to take place unattended, according to a predefined schema in the database, with options to preserve certain types of partitions as well.
Over the next few blog entries, I will describe the approach taken with the partitioning code in Kusu. To kick off the series, I will start with a high-level overview.
Disk States and manipulation
Each machine (whether master or compute) has a 'DiskProfile' object that represents the current/desired state of the system's disks. Generally, there are 3 stages in the disk partitioning process - query, modification, and commission.
QUERY
Usually, the machine will start off by querying the current state of the disks - how many disks? partitions on each disk? LVM partitions? Volume groups? and so on... .
In this stage, tools such as `fdisk`, `lvm vgchange -ay`, and `lvm pvdisplay` are used by the DiskProfile. The benefit of using these tools is the inherent error checking they perform when querying the disks.
At the end of this query stage, Kusu is left with a precise knowledge of the disks in the system, which is presented to the user(in the case of the master), or the nodeinstaller(compute).
MODIFICATION
Next is the modification stage. User(master) or nodeinstaller(compute) manipulates the disk profile to the desired layout. All changes are in memory, but still, all standard rules of partitioning and LVM must be checked in this stage to prevent fatal errors midway through the commission process.
COMMISSION
All changes made in the modification process are committed from memory to disk, the relevant volumes are formatted, and repositories are made on these.
The state of the disks is then passed to anaconda, which installs grub and copies the rest of the operating system to the disk.
* Important here to note: where does grub install?
On some systems '/dev/sda' may not be the first disk seen by the BIOS, and thus may not be booted into. See [1] for more details.
grub must be installed into a place where it can be seen, either by the BIOS, or by a chain loader, which can load grub.
[1] - Dell - Dell Linux - Installer Magic



Email Blog Entry
