Monday, November 29, 2010

Partition - Partitioning a hard drive

What is a partition?

The partitioning of a hard drive occurs after the drive has been physically formatted but before it is logically formatted. It involves creating areas on the disk where data will not be mixed. It can be used, for example, to install different operating systems that do not use the same file system. There will therefore be at least as many partitions as there are operating systems using different file systems. If you are using just one operating system, a single partition the full size of the disk is sufficient, unless you want create several partitions so as to have, for example, several drives on which data are kept separate. 
There are three types of partitions: primary partitions, extended partitions and logical drives. A disk may contain up to four primary partitions (only one of which can be active), or three primary partitions and one extended partition. In the extended partition, the user can create logical drives (i.e. "simulate" several smaller-sized hard drives). 
Let's look at an example where the disk contains one primary partition and one extended partition made up of three logical drives (later we will look at multiple primary partitions): 

For DOS systems (DOS, Windows 9x), only the primary partition is bootable, and is therefore the only one on which the operating system can be started. 
Partitioning is the process of writing the sectors that will make up the partition table (which contains information on the partition: size in sectors, position with respect to the primary partition, types of partitions present, operating systems installed,...). 
When a partition is created, it is given a volume name which allows it to be easily identified.

Master Boot Record

The boot sector (called the Master Boot Record or MBR) is the first sector of a hard drive (cylinder 0, head 0, sector 1), it contains the 
main partition table and the code, called the boot loader, which, when loaded into memory, will allow the system to boot up. 
After it is loaded into memory, this programme will determine from which system partition to boot, and will start the programme (called the bootstrap) which will start up the operating system present on that partition. 
This disk sector also contains all information concerning the hard drive (manufacturer, serial number, number of bytes per sector, number of sectors per cluster, number of sectors,...). This sector is therefore the most important one on the hard drive and is also used by the BIOS setup to recognize the hard drive. In other words, without it your hard drive is useless, which makes it a favourite target for viruses.

File systems

In this section, it is important to differentiate between the FAT file system and 
the file allocation table (FAT). 
FAT is the name of the file system used by DOS operating systems (DOS and Windows 95, as well as Windows NT and OS/2 which support it). 

Operating system
Associated file system
DOS
FAT16
Windows XP
NTFS
Windows 98
FAT32
Windows 95
FAT16 - FAT32 (for version OSR2)
Windows NT
NTFS
OS/2
HPFS
Linux
Linux Ext2, Linux Ext3




FAT file systems are characterised by the use of a file allocation table and clusters (or blocks). 
Clusters are the smallest unit of storage in a FAT file system. A cluster actually represents a fixed number of disk sectors. 
The FAT (File Allocation Table) is the heart of the file system. It is located in sector 2 of cylinder 0, head 1 (and is duplicated in another sector as a precaution in the event of an accident). This table records the numbers of the clusters that are used, and where the files are located in the clusters. 
The FAT file system supports disks or partitions up to a maximum size of 2 GB, but only allows at most 65536 clusters. So, whatever the size of the partition or disk, there must be enough sectors per cluster so that the entire disk space can be contained in these 65525 clusters. As a result, the larger the disk (or partition), the greater the number of sectors per cluster. 
The FAT file system uses a root directory (represented on the operating systems that use this type of file system by the symbol C:\ ) , which must be located at a specific location on the hard drive. This root directory stores information on the sub-directories and files that it contains. For a file, it will store:
·                   the file name
·                   the file size
·                   the date and time the file was last modified
·                   the file attributes
·                   the cluster number at which the file starts


Using multiple partitions

As mentioned earlier, there are three types of partitions: primary partitions, extended partitions and logical drives. A disk may contain up to four primary partitions (only one of which can be active), or three primary partitions and one extended partition. In the extended partition, the user can create logical drives (i.e. create the impression that there are several smaller-sized hard drives). 
Primary partition 
A primary partition must be logically formatted and have a file system appropriate to the operating system installed on it. 
If you have several primary partitions on your disk, only one will be active and visible at a time, depending on the operating system with which you started the computer. By choosing which operating to load at start-up, you determine which partition will be visible. The active partition is the partition from which one of the operating systems was loaded when the computer was started up. The partitions other than the one from which you started will then be hidden, which will prevent their data from being accessible. The data on a primary partition are therefore only accessible from the operating system installed on that partition. 
Extended partition 
Extended partitions were developed to overcome the limit of four primary partitions, as you can create as many logical drives as you want in them. At least one logical drive is required in an extended partition, as you cannot stored data in them directly. 
Many machines are formatted with one large partition using up all available space on the drive. This is not, however, the most advantageous solution in terms of performance and capacity. The solution is to create several partitions, which will allow you to:
·                   install several operating systems on your disk
·                   save disk space
·                   increase file security
·                   organise your data more easily

Let's have a look at what a system containing several operating systems looks like: 



Hard Drive

The role of the hard drive

The hard drive is the component which is used to permanently store data, as opposed to RAM, which is erased whenever the computer is restarted, which is why the term mass storage device is sometimes used to refer to hard drives.
The hard drive is connected to the motherboard using a hard drive controller which acts as an interface between the processor and the hard drive. The hard drive controller manages the drives linked to it, interprets commands sent by the processor and routes them to the drive in question. Hard drives are generally grouped by interface as follows:
·                   IDE
·                   SCSI
·                   Serial ATA
When the USB standard appeared, external cases which could connect a hard drive using a USB port were released, making hard drives easy to install and increasing storage capacity for macking backups. These are called external hard drives, as opposed to internal hard drives which are plugged directly into the motherboard; still, they are the same disks, even though they are connected to the computer using a case plugged into a USB port.

Structure

A hard drive is made up of not just one, but several rigid metal, glass, or ceramic disks, stacked very close to one another and called platters.

The disks turn very quickly around an axle (currently several thousand revolutions per minute) in a counter-clockwise direction. A computer works in binart mode, meaning that the data is stored in the form of 0s and 1s (called bits). Hard drives hold millions of these bits, stored very close to one another on a fine magntic layer a few microns thick, which is covered by a protective film.
They are read and written using read heads located on both sides of the platters. These heads are electromagnets which raise and lower themselves in order to read or write data. The read heads are only a few microns from the surface, separated by a layer of air created by the rotation of the disks, which generates a wind of about 250km/h (150 mph)! What's more, these disks are laterally mobile, so that the heads can sweep across their entire surface.

However, the heads are linked to one another and only one of them can read or write at a given moment. The term cylinder is used to refer to all the data stored vertically on each of the disks.
This entire precision mechanism is contained within a fully airtight case, as the smallest particle can degrade the disk's surface. This is why hard drives are closed shut with seals, and the warning "Warranty void if removed", as only hard drive manufacturers can open them (in particle-free "cleanrooms").

How it works

The read/write heads are said to be "inductive", meaning that they can generate a magnetic field. This is especially important in writing: The heads, by creating positive or negative fields, polarise the disk surface in a very tiny area, so that when they are read afterwards, the polarity reversal completes a circuit with the read head, which is then transformed by an analog-digital converter (ADC) into a 0 or 1 which can be understood by the computer.

The heads start writing data from the edge of the disk (track 0), then move onward towards the centre. The data is organised in concentric circles called "tracks", which are created by low-level formatting.
The tracks are separated into areas (between two radii) called sectors, containing data (generally at least 512 octets per sector).

The term cylinder refers to all data found on the same track of different platters (i.e. above and below one another), as this forms a "cylinder" of data.

Finally, the term clusters (also called allocation units) refers to minimum area that a file can take up on the hard drive. An operating system uses blocks, which are in fact groups of sectors (between 1 and 16 sectors). A small file may occupy multiple sectors (a cluster).
On old hard drives, addressing was done physically, by defining the position of the date from the coordinates Cylinder/Head/Sector (CHS).

Block mode

Block mode and 32-bit transfer are used to get the best performance out of your hard drive. Block mode involves transferring data in blocks, usually in 512-byte packets, which keeps the processor from having to process a large number of tiny one-bit packets. This way, the processor has the "time" to perform other operations. 
Unfortunately, this data transfer mode is only useful for older operating systems (such as MS-DOS), as recent operating systems use their own hard drive manager, which makes this management system obsolete.
There is a BIOS option (IDE HDD block mode or Multi Sector Transfer) which can sometimes determine how many blocks can be managed at once. It is a number between 2 and 32. If you don't know it, there are several solutions available:
·                   Check your hard drive's documentation
·                   Search for the drive's specifications on the Internet
·                   Carry out tests to determine it.
Still, block mode may generate errors in certain systems, due to redundancies in the hard drive manager. The system involves disabling one of the two managers:
·                   the 32-bit software manager in the operating system;
·                   block mode in the BIOS.

32-bit mode

32-bit mode (as opposed to 16-bit mode) is characterised by 32-bit data transfers. 32-bit transfer is comparable to 32 doors opening and closing all at once. In 32-bit mode, two 16-bit words (groups of bits) are transmitted one after another, then assembled.
The improvements in performance when switching from 16-bit mode to 32-bit mode are generally insignificant. In any event, it is no longer normally possible to select the mode, as the motherboard automatically determines which mode to use depending on the type of hard drive.
However, automatically selecting 32-bit mode may slow down IDE CD-ROM drives whose speed is higher than 24x when they are alone on an IDE ribbon cable. Indeed, when a CD-ROM drive is alone on the cable, the BIOS cannot tell if it is compatible with 32-bit mode (because it is looking for a hard drive), in which case it switches to 16-bit mode. In this case, the transfer speed (incorrectly called the transfer rate) will be lower than the one claimed by the manufacturer.
The solution is to plug the CD-ROM drive and a 32-bit-compatible hard drive into the same ribbon cable.

Technical specifications

·                   Capacity: Amount of data which can be stored on a hard drive.
·                   Transfer rate: Quantity of data which can be read or written from the disk per unit of time. It is expressed in bits per second.
·                   Rotational speed: The speed at which the platters turn, expressed in rotations per minute (rpm for short). Hard drive speeds are on the order of 7200 to 15000 rpm. The faster a drive rotates, the higher its transfer rate. On the other hand, a hard drive which rotates quickly tends to be louder and heats up more easily.
·                   Latency (also called rotational delay): The length of time that passes between the moment when the disk finds the track and the moment it finds the data.
·                   Average access time: Average amount of time it takes the read head to find the right track and access the data. In other words, it represents the average length of time it takes the disk to provide data after having received the order to do so. It must be as short as possible.
·                   Radial density: number of tracks per inch (tpi).
·                   Linear density: number of bits per inch (bpi) on a given track.
·                   Surface density: ratio between the linear density and radial density (expressed in bits per square inch).
·                   Cache memory (or buffer memory): Amound of memory located on the hard drive. Cache memory is used to store the drive's most frequently-accessed data, in order to improve overall performance;
·                   Interface: This refers to the connections used by the hard drive. The main hard drive interfaces are:
·                                  IDE/ATA
·                                  Serial ATA
·                                  SCSI
·                                  However, there are external cases used for connecting hard drives with USB or FireWire ports.
Related Posts Plugin for WordPress, Blogger...