Why and how to partition a hard drive?

Page 1 / 1

Partitioning a hard drive is important because it allows you to separate your data into several parts. Generally, you create at least two partitions on a hard disk.
The first partition for the operating system or OS (such as Windows, Linux or Mac) and the second partition for your personal data.

The fact to partition your hard drive in this way will you be able to format the first partition to reinstall the operating system after a crash too high of this operating system.
Before formatting the partition, you will copy the important data on the second partition and then you will format the first partition to reinstall the operating system by the installation CD/DVD.

Note: If you need help to reinstall Windows, see our tutorials :
- Windows XP - Formatting and reinstalling
- Windows Vista / 7 - Formatting and reinstalling

Partitioning is also used for other things but this solution is used in most cases.

  1. Why partitioning ?
  2. Partitioning now or later ?
  3. MBR (Master Boot Record)
  4. The different types of partitions
    1. Primary partitions
    2. Extended partitions
    3. Logical drives
  5. Mark a partition as "active"
  6. The different types of file systems
  7. Cluster size - size allocation unit
  8. Quick Format or not ?
  9. Compression of files and folders

1. Why partitioning ?

As we briefly explained, partitioning can separate your data into several parts.
Partitioning is useful in various cases :

  • You can reinstall Windows without losing your data
  • Install multiple operating systems on one computer (use of primary partitions is recommended)
  • You can reinstall Windows without losing your data
    Install multiple operating systems on one computer (use of primary partitions is recommended)
  • Compatibility with various operating systems (example: Windows primarily uses the FAT32 and NTFS whereas Linux uses Ext as the file system)

Partitioning can also be used to separate data from different persons or separate different types of data:
- For example, on a family PC, we divide the hard disk by the number of people who use this computer. Therefore each user has a part of the disk that is allocated to that user.
- On a personal PC, we will create, for example, a partition to install video games, one for music, ...

2. Partitioning now or later ?

The answer to this question is different from the one we have given in the past.

Indeed, in the past, the answer would have been: before. At this time, once the hard disk was partitioned, it was strongly discouraged to resize partitions in the future as this could cause loss of data and therefore crashes (if the partition where the operating system was installed, was affected by the changes).

Currently, IT has evolved and the mofication of the partitioning is only a formality. Indeed, hard drives and partitioning programs are much more sophisticated and much more stable than before. Now you can resize partitions, delete or recreate them without any problems.
We recommend that you use a program known to perform these partitioning operations.

3. MBR (Master Boot Record)

The MBR is the boot sector of a hard disk. The MBR is the first sector of a hard disk.
In that sector, there are :
- The minimum necessary for your computer to boot your operating system.
- The list of the hard drive partitions.

Sometimes the MBR is damaged due to a virus or some other reason.
In this case, under Windows, it is possible to rewrite the bootable portion of the MBR on the hard drive using the installation CD / DVD of the concerned OS :
- For Windows XP, see the point "2. Rewrite the MBR" of the tutorial "Windows XP - Startup Repair".
- For Windows Vista and 7, see the point "3. Rewrite the MBR and boot repair" of the tutorial "Windows Vista / 7 - Startup Repair".

Recently, the GPT was invented. This new partition table has been created because the MBR limit you to ~2.2 TB per partition. Since the arrival of 3TB hard drives, so we had to find another system partition table for these drives can operate with a 3TB partition. GPT allows you to create much larger partitions, but compatibility is not always perfect.
For example : The hard drive of a user under Windows 2000 began making bad sectors due to a compatibility problem. We therefore advise you to wait until the standard is supported safely before you use it.

4. The different types of partitions

There are 3 types of partitions :

  1. Primary partitions
  2. Extended partitions
  3. Logical drives

4.1. Primary partitions

Primary partitions are used to install operating systems and / or store data.
By creating multiple primary partitions and through tutorials found on the Internet, we can, for example, create a Multiboot on his computer

Notes :
- If you want to create a Multiboot (install multiple operating systems on a single computer), we recommend that you install these operating systems on primary partitions.
- If you want to create another partition for your data, you can create an extended partition with multiple logical drives inside it.

Info : If you want to create a Multiboot with Windows XP and Windows 7 on one or two hard drives, refer to the following tutorials :
- Tuto MultiBoot (XP / Seven with GAG) - On the same drive
- Tuto MultiBoot (XP / Seven with GAG) - On 2 HDDs

Warning : The number of partitions on a hard drive is limited to 4 It's for this reason that we created the extended partitions.

4.2. et 4.3. Extended partitions and logical drives

Because the number of partitions is limited to 4 on the same hard drive, we will use extended partitions to create other partitions.
Unlike primary partitions, extended partitions can only contain logical drives. Then you can store your data in the logical drives and use them as if they were in primary partitions.

To explain to you how these extended partitions works, we will divide our hard drive in 7 parts :

  1. Partition 1 (Primary partition)
  2. Partition 2 (Primary partition)
  3. Partition 3 (Primary partition)
  4. (Extended partition)
    1. Partition 4 (Logical drives)
    2. Partition 5 (Logical drives)
    3. Partition 6 (Logical drives)
    4. Partition 7 (Logical drives)

In total, we have 4 partitions on our hard drive but the last (which is an extended partition) contains 4 other partitions (specifically, logical drives).

Now you may be asking : How we could create 7 partitions in total whereas the maximum is 4? The answer is partly in the sentence above.
In fact, the hard drive contains only 4 partitions in this example : the 3 primary partitions + the extended partition.

The list present in the MBR contains therefore only addresses for these 4 partitions.
Then the addresses of logical disks are, themselves, in the "EBR" (Extended Boot Record) located at the beginning of the extended partition in question.

5. Mark a partition as "active"

The active partition is the partition on which a computer should start. It is therefore, in general, the partition containing the operating system.
On a hard disk, there is only one active partition.

When you install an operating system on your hard drive, the installer marks the partition as active so you can start your computer correctly.

In the case of a Multiboot, the partition that is marked as active, contains a boot program that can select the operating system to start. Even in the case of a Multiboot, you will only have one partition marked as active.

Attention : Because this "flag" tells the computer on which partition it should start, it's not advisable to change the active partition manually if you don't know what you're doing. Moreover, Windows will display you a warning first, if you try to do so.

Note : In Windows 7, the active partition is the system partition named "System Reserved". Removing this partition will make Windows inaccessible.

6. The different types of files systems

In IT, there are different types of files systems.

Here is a list of major files systems and their use (generally) :

  • FAT : used for USB flash drives and memory cards, because this file system is supported by many systems.
  • FAT 16 : DOS (or MS-DOS of Microsoft) and Windows 95
  • FAT 32 : Windows 95 OSR2 and Windows 98. Also used under Windows XP for storing data.
  • NTFS : used under Windows starting from XP. This file system allows you to manage permissions (read, write, delete, ...) for each user or group of Windows users.
  • Ext (Ext 2, Ext 3, ...) : Mainly used in Linux (including Ubuntu)

Other file system, as well as other support, but those we have cited are the main file system used with Windows and Linux.
For example, the file system for the CD / DVD is CDFS.

Each file system to its technical limitations and advantages.
For example :
- FAT is very compatible but is limited to ~2 GB per file.
- NTFS can manage rights and can store files larger than 2GB. However, this file system can cause problems in specific case.

7. Cluster size - size allocation unit

Generally, when a partition is formatted, we leave the value "4K" which is the default. However, if this size is set correctly, this can allow your operating system to read your files faster.
By against, if you use it improperly, you may lose space on your hard disk (more precisely, the partition).

So how to choose this value ? The short answer is : most your files are larger, most the value should be higher. In the opposite direction, most files are smaller, the value should be low.

So what is a cluster ? A cluster is a block which is stored in a file. If the file is larger than the cluster in question, the rest of the file is stored in the next cluster.

Here is an example of clusters with 2 files of 14 KB each one and a cluster size of 4 KB (the default size).
In this example, the read head will read 4 addresses to read the entire file of 14 KB Because this file is small, the cluster size is correct. It will only lose 4 KB of space on the partition and you don't lose performance.

Now, imagine that the cluster size is used for large files. The read head of the hard drive will read many addresses to be able to fully charge your file. For example, a file of 700 MB (700*1024 = 716,800 ko) will be stored in 179.200 clusters (716.800 / 4). It will be necessary to read 179,200 addresses to find the complete file.

The solution is to use a larger size of clusters. For example: 64 KB
With this cluster size, the file will be stored in only 11.200 clusters (716.800 / 64).
So we gain in performance, but you will lose some place with small files. Indeed, the same file of 14 ko take this time 64K instead of 16K of earlier.


Conclusion :
Because the FAT (the list of files on the partition) is at the beginning of the hard disk, the reading head of the hard disk must be a lot of back and forth to read the addresses of each cluster. Which decreases performance for large files. The use of larger clusters reduces the number of round trip and therefore You gain in performance.
However, small files take more space and you lose space on your hard drive. This shows us another advantage of partitioning.
Partitioning should be performed as follows :
- A partition with a larger cluster size for large files (such as videos or movies legally downloaded)
- And another partition with a smaller cluster size for small files.

8. Quick Format or not ?

All depends on the reason of this formatting.

In fact, a quick format does not completely erase the hard drive. Quick format only clears the list of files on the hard disk and creates the file system on the partition. In this case, the data are no longer available for a standard user.
Nevertheless, the data is still present on the hard drive. The operating system has just set all clusters as free. It takes much less time, but the data could be retrieved later through software data recovery. This recovery is only possible when the old data have not been overwritten by new data. (With some exceptions)
For more information about data recovery, refer to the tutorial : "Data recovery with File Scavenger".

Conversely, normal formatting takes much more time (depending on the size of the partition to be formatted), than the quick format because it actually deletes files on the hard drive. This deletion is not 100% sure, because the data could still be recovered due to the hysteresis's effect. To be brief, a file consists of 0 and 1 and when erasing, 1 will not be magnetized just like a 0. We can thus deduce that 1 was present before the 0 at this point in HDD. By performing the same reasoning on the entire hard drive, so it's possible to recover deleted data (but with much more difficulty). To prevent data from being recovered, the solution is to write 0 on the entire hard drive and do this 12 times. The radical solution is to break the disk into small pieces before discarding.

9. Compression of files and folders

As its name suggests, this option allows you to compress some files and folders so that they take up less space on the hard disk. So this option saves space but to the detriment of performance. In addition, with the current hard drives, this possibility has much less interest since you can store multiple terabytes (1 TB = 1000 GB) on a single hard drive, and for a very reasonable price. We therefore recommend that you don't enable this option when formatting.