Try DigitalOcean free for up to two months!

Linux+: Hardware Part 14 – Hard Disk Drives Partition and Formats

Discussion in 'Linux Other' started by Jarret W. Buse, Feb 12, 2014.

  1. Jarret W. Buse

    Jarret W. Buse Well-Known Member Staff Writer

    Jul 3, 2013
    Likes Received:
    Linux+: Hardware Part 14 – Hard Disk Drives Partition and Formats

    Before Hard Disk Drives (HDD) can be used to store data or an Operating System (OS), the disk needs to be prepared for the data. The preparation is termed Partitioning and formatting. Before getting into partitions and formatting, let’s look at the makeup of a hard disk drive.

    In the previous article, Linux+: Hardware Part 13 – Hard Disk Basics, the other HDD basics were covered as to how the HDD hardware functions. Each side of a platter is separated into concentric circles called Tracks (Cylinders). The Tracks are similar to rings on a tree, starting at the inside of the platter and going toward the outside of the platter. Imaginary lines radiate from the center of the platter to the outside of the platter dividing the Tracks into Sectors. Each platter can have 300 or more tracks and also 100 sectors per track. Each sector can contain 512 bytes or more. Some OS systems and format types can allow sectors to contain as much as 2 to 4 kb per sector. Tracks and Sectors are shown in Picture 1.

    Hardware 14 - Picture 1.JPG
    PICTURE 1​

    NOTE: Remember that when data is written to a drive, in some cases, if a file is less than the sector size the unused space is wasted. For systems with small files it is best to use small sector sizes and larger files should use larger sector sizes.

    For most Hard Disk Drives (IDE and EIDE), the BIOS must be configured to recognize the installed drive. The settings require the number of Tracks (Cylinders), Heads, and Sectors per Track. Newer BIOS chips have an auto detect feature.

    NOTE: SCSI BIOS chips on a SCSI controller manage the setup of the SCSI Hard Disks.

    The setup of the information in the BIOS is usually termed the Cylinder-Head-Sector (CHS) parameters. To find the storage capacity of a Hard Disk you multiply the CHS parameters and then multiply it by the size per sector. For instance, a drive with 8,192 Cylinders, 16 Heads, 63 Sectors and 512 bytes per sector would be:

    8,192 x 16 x 63 x 512 = 4,227,858,432 bytes (4 GB)

    There are three modes in the BIOS for configuring the drives:

    1. Normal
    2. Large
    3. Large Block Access (LBA)
    The Normal mode uses the CHS parameters, but only allows up to 1,024 Tracks. The Large mode uses translations to exceed the 1,024 Track limitation. LBA uses 28 bits to specify the Sector numbers which allows full use of the drive with no translations.

    To initialize a drive, it must be partitioned. Partitioning a drive is setting up logical drives on the physical drive. For instance, a 1 TB drive can be partitioned into two 500 GB drives. The physical drive will be seen by the OS as two logical drives. Depending on the file system, partitions can be a whole drive or portions of a drive.

    NOTE: Each logical partition can be a different file system.

    Each HDD uses the first Sector to store the Master Boot Record (MBR) and partition table. The MBR checks the partition table to determine which partition is set as the boot partition (active partition). The MBR then reads the first sector of the portion of the drive which is the active partition. On this first sector should be the boot loader file of the installed OS.

    NOTE: The partition table lists the beginning and end of each logical partition.

    Three types of partitions exist on PCs:

    1. Primary – partition tables allow four entries so only four Primary partitions can exist per drive
    2. Extended – one of the four entries can be an Extended partition
    3. Logical – the Extended partition can contain many Logical partitions
    An HDD must have one partition to be usable. IDE drives can have 16 partitions and a SCSI drive 15 partitions.

    NOTE: Using a GUID Partition Table (GPT) removes the partition limitations set by using a Master Boot Record (MBR).

    Once partitioned, the Logical Drives must be formatted so the drive can be used to store data. To write the structure of the file system (DOS, FAT32, MINUX, EXT2, EXT3, EXT4, etc.) is called high level formatting. How the data is stored is determined by the file system itself. The formatting places a File Allocation Table (FAT) on the Logical Partition. The file system determines limitations of files, directories, names of files and directories, etc.

    NOTE: Formatting a partition will erase any existing data in the partition.

    Various Partitioning/Formatting tools include:

    • GParted
    • Parted
    • Fdisk

    Attached Files:

    • slide.jpg
      File size:
      26.9 KB
    ZHANG/ZHIKUN and DevynCJohnson like this.

Share This Page