I have machine ROME (For DRAC: drac.rome.studlab.os3.nl; ssh: rome.studlab.os3.nl)
first problem, cannot login to it as do not know the username and password. The Dell default password did not work.

Got new password: hobb3s
And changed the password.

Q: What is a Drac and how does it work?
A: Drac stands for Dell Remote Access Controller. It is a controller card which is installed on the machine. It is kind of a standalone system besides the server. It works with sensors to detect the status of the host machine. It provides dedicated management channel to provide so called light off management. Here is a list of command of the SSH version of the DRAC interface. Do not have experience with it even do not know how to change DRAC password, but it is a pleasant to work with.

/admin1-> help
[Usage]
    show   [<options>] [<target>] [<properties>] 
           [<propertyname>== <propertyvalue>]
    set    [<options>] [<target>] <propertyname>=<value>
    cd     [<options>] [<target>]
    create [<options>] <target> [<property of new target>=<value>] 
           [<property of new target>=<value>]
    delete [<options>] <target>
    exit   [<options>]
    reset  [<options>] [<target>]
    start  [<options>] [<target>]
    stop   [<options>] [<target>]
    version [<options>]
    help   [<options>] [<help topics>]
    load -source <URI> [<options>] [<target>]
    dump -destination <URI> [<options>] [<target>]

/admin1-> 

http://en.wikipedia.org/wiki/Dell_DRAC
http://support.dell.com/support/edocs/software/smdrac3/idrac/idrac10mono/en/ug/html/index.htm

we are going to install 9.04 server which is a TLS

I choose English, with the Netherlands as the Country of Region. eth0 as the primary NIC. The installation went pretty straight forward without any problem.

Q.

  • What is PXE booting?

PXE is preboot execution environment.

It is an environment to boot computers using a NIC (network interface card) from a image stored somewhere on the network without need for a local storage device, like hard drive and etc. It uses IP network to send out UDP request to look for boot images which is located somewhere on the network. Then locate the NBP (network bootstrap program) and by using TFTP to load NBP into local memory for executing.

It is invented by Intel.


http://en.wikipedia.org/wiki/Preboot_Execution_Environment

  • How does it work?

The PXE starting procedure is

  1. NIC locates the PXE boot server by using DHCP
  2. Depending on the server located, it will ask user to select a desired OS/image to be loaded
  3. Corresponding NBP (network bootstrap program) will be downloaded through TFTP
  4. Execute the NBP
  5. Booted

PXE uses several network protocols includes IP, UDP, DHCP and TFTP. The firmware on the client tries to locate PXE service information then ask the server for NBP. After TFTP download the NBP to the RAM, it will be executed. That starts the computer in PXE mode.

  • How does it compare to booting from the hard disk or a CD?

Boot from harddisk depends on the MBR. Boot from CD depends on the boot record stored on the CD. PXE uses predefined NBP. Comparing to the earlier two, PXE is utilizing the whole bunch of protocol family, and the rest are only (only?) depending on a single solution. MBR in the case of harddisk, boot record track in the case of CD.

  • What is an MBR?

MBR is master boot record. It tells the computer where and how to start. It is the 512-byte boot sector that is the first sector of a partitioned data storage device such as a hard disk. The MBR is not located in a partition, it is located at a Main Boot Record area in front of the first partition. MBR contains bootstrapping code followed by primary partition table (four times 16 bits).

  • What is its layout?
HexOctDecDescriptionSize
000000000Boot code440B (Max. 446B)
01B80670440Optional disk signature4B
01BC0674444Reserved; Null2
01BE0676446Primary partition table16*4=64B
01FE077651055h, 0xAA55, MBR signature1B
01FF0777511AAh, 0xAA55, MBR signature1B

The first 440(max 446B) of date are the boot code.
Next from 01BE there are four primary partitions, each 16B (full explanation underneath).
The last two bytes are used together as the MBR signature, which indicates that it is the MBR. This ensures that the “real” MBR get executed.

  • What is a partition table?

Like the MBR, partition table contains partition related information. It describes how the disk is sliced. It contains boot flag, start/end address of the partition on the disk in the format of CHS addresses. There are also fields used to define the format of the CHS addresses. At the end of the partition record, there are fields indicated the LBA and number of blocks in partition.

Partition Table for /dev/sda

         ---Starting----      ----Ending-----    Start     Number of
 # Flags Head Sect  Cyl   ID  Head Sect  Cyl     Sector    Sectors
-- ----- ---- ---- ----- ---- ---- ---- ----- ----------- -----------
 1  0x80    1    1     0 0x83  254   63 59675          63   958694877
 2  0x00    0    1 59676 0x05  254   63 60800   958694940    18073125
 3  0x00    0    0     0 0x00    0    0     0           0           0
 4  0x00    0    0     0 0x00    0    0     0           0           0
 5  0x00    1    1 59676 0x82  254   63 60800          63    18073062
  • What are primary and logical partitions?

Primary partitions are four partitions directly defined in the partition table in the MBR. They are self-contained while logical partition are sub-slices from within the extended partition. And there can be more than four logical drive. The amount is only limited by the way the OS will addresses the partition. For example, in windows the drive letter ( A, B …. Z).

  • Can you boot an OS from both?

Yes/No. Yes you can boot from both kind of partitions. No, you cannot boot directly from the logical. The bootstrap program is a very simple system, so it needs clear and direct access to the partition which contains boot information. But with help of chain loader and compatible boot loaders we can boot a computer from logical partition.

  • What is fdisk, how does it work, and what can you do with it?

fdisk - Partition table manipulator. It can list, manipulate partitions

root@rome:/home/vic# fdisk /dev/sda1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xed7e2499.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.


The number of cylinders for this disk is set to 59675.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help):
  • What is the bootloader and where does it reside on the system?

Bootloader is a program which loads the operating system, which itself is loaded by bootstrap. It is stored on the first sector of a partition.

  • Describe in order all the steps required for booting the computer (not the OS!).
    1. load and execute code from 0xFFFF
    2. POST and device initialization
    3. locate MBR (0xAA55)
    4. load the fist sector into memory 0000:7c00
    5. executed the loaded boot code
    6. boot loader run, loads OS
  • Grub is set up in stages, what stages are there and what do they do?

There are two major stages 1 and 2. And an option stage 1.5 which includes all the subroutines for booting different files systems.

Stage 1 is the most essential part of GRUB. It brings up GRUB itself. It is 512 bytes in size to be able to fit into the boot sector. It works using block numbering stead of file system. So it does not understand any kind of file system. That is where the stage 1.5 come into place.

There are several different subroutines within stage 1.5. All named after its usage. For example e2fs_stage1_5 is used to load stage 2 on E2FS file system. So overtime we can expect a longer and longer stage 1.5 when there are more and more different file systems, if people really want to make life that difficult.

In stage 2 there are three different images, namely: stage2_eltorito, nbgrub and pxegrub. Stage2_eltorito is a kind of special one, it boots directly from CD, thus no need for the stage 1 hence stage 1.5.

  • Why are they separate/necessary?
  • How do they communicate with each other, and with the kernel?

Stage 1 does not know file system, stage 2 works with file system, hence in order to let them communicate with each other a proper subroutine in stage 1.5 must be used.

The creation of the stage system makes GRUB portable and flexible. And only with the separation, the stage 1 can be small enough to fit into the boot sector of the machine.

  • How does GRUB use or interact with the BIOS?

GRUB uses the device map file to communicate with the BIOS. If the file is not made, then the GRUB will try to create it, otherwise GRUB will just trust the existing device map file.

  • Do they always get along?

No. If the file is wrongly created/mutated. GRUB will still trust it and, of course it cannot find the mapped device.

  • What index does the partition table start at?

The partition table starts at 0x01BE.

  • Copy and dump the partition table in hex format in your Wiki page,and fully annotate the entries. Translate all sector information into human readable format.

dump of the MBR, partition starts at 0x01BE.

vic@rome:~$ hexdump MBR
0x100: C0 E8 02 66 89 04 66 A1 44 7C 66 31 D2 66 F7 34
0x110: 88 54 0A 66 31 D2 66 F7 74 04 88 54 0B 89 44 0C
0x120: 3B 44 08 7D 3C 8A 54 0D C0 E2 06 8A 4C 0A FE C1
0x130: 08 D1 8A 6C 0C 5A 8A 74 0B BB 00 70 8E C3 31 DB
0x140: B8 01 02 CD 13 72 2A 8C C3 8E 06 48 7C 60 1E B9
0x150: 00 01 8E DB 31 F6 31 FF FC F3 A5 1F 61 FF 26 42
0x160: 7C BE 85 7D E8 40 00 EB 0E BE 8A 7D E8 38 00 EB
0x170: 06 BE 94 7D E8 30 00 BE 99 7D E8 2A 00 EB FE 47
0x180: 52 55 42 20 00 47 65 6F 6D 00 48 61 72 64 20 44
0x190: 69 73 6B 00 52 65 61 64 00 20 45 72 72 6F 72 00
0x1A0: BB 01 00 B4 0E CD 10 AC 3C 00 75 F4 C3 00 00 00
0x1B0: 00 00 00 00 00 00 00 00 80 00 00 00 00 00 80 01
0x1C0: 01 00 83 FE FF FF 3F 00 00 00 DD 85 24 39 00 FE
0x1D0: FF FF 05 FE FF FF 1C 86 24 39 25 C6 13 01 00 00
0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA

The real partition part is

0x1B0:                                           80 01
0x1C0: 01 00 83 FE FF FF 3F 00 00 00 DD 85 24 39 00 FE
0x1D0: FF FF 05 FE FF FF 1C 86 24 39 25 C6 13 01 00 00
0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
OffsetsizeDescriptionMy 1st partition2nd3rd4th
0x001Bstatus, bootflag (0x80=boot, 0x00=not, other=invalid)80(boot flag)000000
0x011Bhead of CHS address of first block in the partitionh=01h=FEh=00h=00
0x021Bsector in bit 0-5, bit 8-9 of cylinder in bit 6-7s=01s=FFs=00s=00
0x031Bcylinderc=00c=FFc=00c=00
0x041Bpartition type83 (Linux native)05 (extended)0000
0x051Bhead of CHS address of last block in the partitionFEFE0000
0x061Bsector in bit 0-5, bit 8-9 of cylinder in bit 6-7FFFF0000
0x071BcylinderFFFF0000
0x084BLBA of first sector in the partition3F 00 00 001C 86 24 3900 00 00 0000 00 00 00
0x0C4Btotal number of blocksDD 85 24 3925 C6 13 0100 00 00 0000 00 00 00

Now start fdisk an have it print the partition table.

Command (m for help): p

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000080

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       59676   479347438+  83  Linux
/dev/sda2           59677       60801     9036562+   5  Extended
/dev/sda5           59677       60801     9036531   82  Linux swap / Solaris
  • What are the di erences between the original content (the dump),your annotations and the fdisk printout?

The major difference is that the first two are not human readable. Only the print of fdisk is straight forward for human eyes. One can use the annotation table to read the raw dump and calculate the outcome of fdisk printout. And fdisk does include the swap partition, which is not shown in the other two as it is not primary type.

  • If you wanted to add a 640MB primary partition to the table by hand, what values would you have to use for the entry in the raw table? And in the fdisk table?

640MB=(640*1024^2)/512=1310720 blocks, hence 14000 in HEX

hex valuemeaning
00 not bootable
00 XX XX h=,s=,c=
83 FS=linux native
XX XX XX end:h=,s=,c=
XX XX XX XX lba begin: 47134710
00 00 00 14 lba size: 640MB
  • Describe the entire startup process of Ubuntu. The subquestions below are leaders to help you along, they must be answered but by no means represent the entire startup process of Ubuntu. . .
    • What stages are there, and what are they for? (hardware, system con guration, system initialization, etcetera)
    • Where is the con guration kept, and how do you change it?
    • What are runlevels?
    • What happens when you log in?
  1. BIOS, hardware initialization
  2. Boot code of MBR (0xAA55)
  3. (optional) load GRUB bootloader, enter GRUB stage 1.5, enter GRUB interface, GRUB stage 2
  4. load and execute kernal, kernal start INIT
  5. start system devices, load modules, mount root filesystem
  6. execute /sbin/init (init has PID 1)
  7. Depending on the runlevel the corresponding scripts are started which start the whole system.

All the runlevel startup files are kept in /etc/init.d.
They can be change just use gedit. or other text editor.

runlevelfolder contains links to /etc/init.d/ description
0/etc/rc0.dHalt
1/etc/rc.dsingle user mode
2 - 5 /etc/rc[2-5].dmulti user mode
6/etc/rc6.dreboot

Once you logon, you have to go through the normal authentication and authorization procedure. Then your preconfigured shell is loaded and home folder mounted.

  • Describe the entire startup process of the X windows subsystem
    1. init X daemon
    2. X subsystem loads video card and other driver/modules
    3. X subsystem loads configuration file, normally /etc/X11/xorg.conf
    4. display manager starts, enters the GUI mode
    5. window manager loads
  • What stages are there, and what are they for? (hardware, system con guration, system initialization, etcetera)
    1. init X server, in this stage the X server environment will be initialized, hardware is tested, drivers loaded, necessary modules are loaded as well. So prepare X from hardware perspective.
    2. Load X configuration. This is still in the preparation phase, but more software.
    3. composite manager, windows manager start. Window components get loaded, This is the final step which bring the real GUI on.
  • Where is the con figuration kept, and how do you change it?

The configuration file is /etc/X11/xorg.conf . It is a plain text file, we can edit it directly using all kinds of text editor, like nano, vim and etc.

  • Who owns the subsystem?

The subsystem is own by root. So any change to the x server will require root privilege.