Lecture Notes
Formatting,
Files
Systems and Partitioning
How
do you prepare your hard disk for installation of an operating system? Can
you use a hard disk to store files on only? Can you install more than one
operating system on a hard disk? Read on and find out.
Introduction
Formatting
Physical
Formatting
Logical
Formatting
File
Systems
FAT
Based File Systems
FAT
16
FAT
32
NTFS
Ext
File Systems
Ext2
Ext3
Netware
File System
Partitioning
Booting
Up
Introduction
Assuming
you wish to install one or more operating systems onto a hard disk, then you
need to know about...
Knowledge
of the above ensures that a disk is correctly organised for the operating system
you wish to install. It also gives you the power to structure one or more
disks so that installation of more than one operating system is possible.
Formatting
Physical
Formatting
A
magnetic disk is physically formatted (also call a low-level format) into
a tracks, sectors and cylinders, usually by the
manufacturer. Physical formatting divides the disk into basic elements so
that data can be read from the disk.

After
formatting, the magnetic quality of the surface may gradually deteriorates. the
read-write heads may find it difficult to read the magnetic properties of
sectors. Any sector that becomes impossible to read is marked as a bad
sector and is ignored by the computer.
Logical
Formatting
After
physical formatting, the disk must be logically formatted. This process
places a file system on disk and allows an operating system to store and
retrieve files. Different operating systems (Windows 9x, NT, Linux etc.)
use different file systems. So a disk must be formatted using the correct
file system for the operating system that you plan too install.
Do
you know the type of file system commonly used by the operating systems listed
below?
Operating System
|
File System
|
DOS
|
|
Windows 95
|
|
Windows 98
|
|
Windows NT
|
|
Windows 2000
|
|
Windows XP
|
|
Linux
|
|
Novell Netware
|
|
After
a disk is formatted using a particular file system, you are usually limited to
installing one operating system. However, it is possible to logically
format a disk using more than one file system using a technique called partitioning.
Partitioning
effectively divides up you hard disk into different parts, allowing you to
logically format each part separately, using different file systems and
installing different operating systems, if you choose.
File
Systems
A
files system is the method used to organise data on a disk. It controls the allocation of disk space to files, and associates each file with a filename, directory, permissions, and other information.
A
file system is a structure used for storing and managing data. It includes
a boot, file and directory structures. A file system also needs to..
-
track
free and used space
-
maintain
file and directory names
-
record
where each file is located on disk
The choice of
file system is an important one since it affects performance, recovery from errors, compatibility with other
operating systems, limitations on partition and file sizes, and so on.
Common file systems are:-
File System
|
OS
|
Accessible by
|
FAT 16
|
DOS, Win3.1, Win95
|
Win98/NT/2000/ ME/XP/Linux
|
FAT 32
|
Win95 (2nd release), Win98, ME, 2000,
|
Win98/NT/2000/ ME/XP/Linux
not
DOS, Win3.1, Win95(1st release)
|
NTFS
|
WinNT, 2000, XP
|
WinNT, 2000, XP
not
DOS, Win3.1, Win95, Win98, read-only for Linux
|
EXT2 or EXT3
|
Linux
|
Linux or Unix
not
DOS or Windows
|
Netware
|
Novell Netware
|
Netware
not
DOS, Windows, Linux or Unix
|
FAT Based File
Systems
FAT
is characterized by the use of a File Allocation Table and clusters.
A cluster is a small fixed number of sectors and are the smallest unit of data
storage. FAT records which clusters are allocated, which are free and
where files are stored within clusters.
The
FAT table also has a root directory that records information about each
sub-directory. Each sub-directory entry contains information about files in the
form of file name, creation date, the first cluster used by the the file and
file attributes, (hidden, read-only, etc.)
FAT
16
FAT16 was the standard partition type up to Windows
95 - used by DOS, Windows 3.1 and Windows 95 (1st release). Although FAT16 partitions are supported by all versions of Windows, FAT16 partitions are limited to a maximum of 2Gb.
FAT
32
FAT32 is supported by Windows95 second edition
onwards, including Windows 2000 but not WinNT. FAT32 partitions are the standard with Windows 98.
FAT32
is based on 32-bit file allocation table entries rather than 16-bit entries used
by FAT16. As a result, FAT32 supports larger disks or partition sizes than
FAT16. Although the theoretical maximum size for FAT32 is 2 TB, Windows98's scandisk only supports 128Gb, and
Windows 2000 does not permit the creation of FAT32 disks larger than 32Gb.
Unlike
file systems such as NTFS ( WinNT, 2000, XP) and EXT (Linux), FAT file systems are unable to hold information
on file ownership and permissions. Since Linux supports both
reading from, and writing to FAT16 and FAT32 partitions, quite often FAT
partitions are used to allow file sharing between Linux and Windows on a dual-boot system.
NTFS
NTFS
(new technology file system) is a file system introduced with Windows NT v4.0.
Windows 2000 and XP also use NTFS. Linux, installed on another partition
or disk, can only access an NTFS partition in read-only mode. NTFS partitions are not accessible from Windows 95 or 98.
Like
FAT 16 and FAT32, NTFS uses clusters, but a cluster size of 512 bytes can be
specified which reduced file fragmentation and wasted disk space. So NTFS
performs well on large disks. Unlike FAT systems, NTFS supports the
holding of information
on file ownership and permissions.
Ext File System
Linux supports a wide variety of
file systems. Extfs is an old file system used in early Linux systems. Newer
versions of this system are Ext2 and Ext3.
Ext2
The
Ext2 file system is the default file system for Linux, although Ext3 is often
used now. It supports partitions of up to 4 Terabytes in size, while a single file can be up to 2 Gigabytes.
Filenames can be up to 255 characters long. Ext2 is able to manage really big partitions.
Ext3
Ext3
uses a new journaling file system which offer a number of advantages over the traditional ext2.
Whenever a computer is switched off without a proper shutdown there is the possibility that data on the disk
will become corrupted - that is, some of the data will have been written
half-written to disk. If a system crashes it usually goes through a routine to check the disk for errors -
fsck in Linux and scandisk or chkdsk in Windows. This is time-consuming, especially on today's very large disks.
A
journaling file systems get rid of these problems. Instead of writing modified files directly onto their area on the disk, the system maintains a
journal on the disk which describes all the changes which must be made to disk. Then, a background process takes each journal entry, makes the change and marks it as completed. If the system is halted without a shutdown, any pending changes are performed when it is restarted and the system is ready to continue running in seconds. Incomplete entries in the journal are discarded. This guarantees consistency and removes the need for a long and complex
file system check on bootup.
Linux
Swap
The Linux swap partition is an amount of disk space in which Linux temporarily writes data from RAM to free up memory for other processes.
Netware File
System
The
Novell Netware operating system uses the Netware File System. It was
developed specifically for Netware servers. Most other operating systems
cannot read a partition with this system installed.
Partitioning
After
a disk has been physically formatted and normally before it is logically
formatted, a disk can be sectioned up into discrete units called
partitions. Effectively, each partition is separate from another
partition and can be logically formatted with a file system different from file
systems on other partitions.
This
is tremendously useful for:-
Once
a partition is logically formatted it is called a volume and you can
give this volume a name if you like, to help identify it.
The
picture below shows a disk partitioned into two volumes. The first volume
has an NTFS file system and the volume label is WinXP. The second volume
has a FAT32 file system and the volume label is MYFILES.

Now,
there are three types of partitions, primary, extended and logical.
Primary
Partitions
A
primary partition can contain an operating system and/or data files.
There is a limit to the number of primary partitions a disk can
have. A disk can be sectioned up into at most four primary
partitions.
One
of the partitions must be set as the active partition. The active
partition is the one used at boot up time and so it should contain an operating
system. You can change the active partition at any time to another
primary partition using a utility such as DOS's fdisk.
Only
one primary partition can be active at any one time.
Extended
Partitions
Extended
partitions are used to overcome the four-partition limit on primary
partitions. Effectively, an extended partition is a container for logical
partitions and it can contain an unlimited number of them. This is useful
for further partitioning of the disk.
For
example, say you wish to have five partitions. You could create three
primary partitions with one of the primary partitions containing an extended
partition containing two logical partitions.
Extended
partitions in themselves do not hold data, they just hold logical partitions.
Logical
Partitions
Logical
partitions can contain an operating system and/or data files, just like primary
partitions. However, you should be aware that not all operating systems
can boot from a logical partition.
The
picture below shows a disk that has been partitioned into three primary
partitions, one of which is really an extended partition. Inside this
extended partition there are four logical partitions.

~Now
try the activity~
Activity
A |
By
looking at the information in the picture...
-
Draw
a sketch using boxes, showing the partitions and partitions within
partitions.
-
Draw
a diagram showing how you would partition a disk for Linux if I wanted
a /root, /boot, /usr, /home and /var partition as well as swapspace.
|
Booting Up
How
does a computer manage the booting up process? If you have more than one
partition or more than one disk, how does it know which OS to load?
On
booting up, the BIOS ROM runs it's startup procedures. The last procedure
is the boot routine. This routine reads the Master Boot Record (MBR)
on the first sector of the active partition. The MBR consists of
a partition table and information on which is the currently active
partition. The active partition's operating system boot routines are
then located and loaded.
If
there is more than one primary partition on the disk, then the first sector of
each bootable partition (containing an OS) contains the boot record for
the OS. Each OS when it is first installed usually writes it's boot
record to the first sector of its partition.
Some Questions
Examine
the picture below:-

~Now
try the activity~
Activity
B |
By
looking at the information in the picture...
-
How
many hard drives do you think this computer system has?
-
Which
operating system could be installed on the first partition?
-
How
big is this disk?
|
Examine
the picture below:-
~Now
try the activity~
Activity
C |
By
looking at the information in the picture...
-
How
many hard drives do you think this computer system has?
-
How
many bootable disks are there? (Two of the volumes, labelled Backup
and LinuxBin, hold data files only.)
-
Which
disks are most likely to have XP installed?
|
That is folks!!
|