Disk format
The disk format is a set of computer operations, independent of each other, physical or logical, that allow to restore a hard disk, a USB memory, a partition of the hard disk or memory USB or any other data storage device to its original state, or optimal to be reused or rewritten with new information. This operation can delete, although not permanently, the data contained in it. In some cases this utility can be accompanied by disk partitioning.
Low and high level formatting
It is done by software and consists of placing marks on the surface of magnetizable Chrome or Nickel metal oxide, to divide it into concentric tracks and these, in turn, into sectors which can then be referenced indicating the reading head the sector and cylinder to be read. The standard size of each sector is 512 bytes.
Tracks are divided into smaller areas, or sectors, which are used to store a fixed amount of data. Sectors are normally formatted to hold 512 bytes of data (there are 8 bits in a byte).
Low-level formatting (physical formatting)
In a low-level format, also known as a physical format, some unique mechanics come into play to delete the data, so that the disk remains exactly the same. to its factory state. In general, all manufacturers perform a low-level format on their drives once they are ready to be packaged.
Also known as physical format leaves the hard drive really empty of data. Let's see, what happens is that the write head of the disk (the one that changes the magnetism of the sectors), will go through each sector of the disk, eliminating the data that can be found on it and marking each sector as empty. This causes any data on that drive to be completely erased. This is the main reason that this type of formatting is so slow, since the head has to write each and every one of the sectors of the disk.
Today, with the technology that normal hard drives have, it is not usually necessary to carry out a low-level format, in addition to the fact that they already come standard with this type of format and the arrangement of sectors is not lost, although there are erroneous writes, what's more, there are occasions in which a physical format can damage a hard drive.
Normally only floppy disks need to be low level formatted. Hard drives are formatted at the factory and are never formatted by normal operations even if they are faulty (although they can be lost by magnetic fields or high temperatures). Currently hard drives come with technology that does not require low-level formatting, in some particular cases, such as the frequent incidence of physical formatting, the hard drive may be damaged.
Once a hard drive has been physically formatted, the magnetic properties of the plate lining can gradually deteriorate. Therefore, this makes it increasingly difficult for the reading/writing heads to read or write data in the affected disk sectors. Sectors that can no longer be used to record data are known as faulty sectors. Fortunately, the quality of modern discs is so high that the defective sectors of this type are rare. In addition, modern operating systems in general can determine when a sector is defective and, if so, mark the sector as such (so that it is never used) and use an alternative sector.
Steps to perform a low-level format
Before formatting: Make a backup.
- Find the basic information of your computer (processor power, RAM, Hard drive)
- Have a Live USB device or any other bootable device ready with a functional operating system.
- Preconfiguration of BIOS
With these tools ready, we can start formatting our unit and changing the operating system through the following steps:
- Connect the bootable device and turn off the equipment.
- Switch it into the Bios configuration to select the boot device.
- Press F10 to start the equipment from the bootable device.
- The equipment will then start from the necessary parameters for the installation of the new operating system.
- Just follow the steps indicated by the same system to complete a successful installation.
High-level formatting (logical formatting)
Unlike when we do a low-level format, in this case we do not make any physical modifications to the disk, it is based solely on the allocation of sector sizes and the file table. But after all, it could be said that it is a quick or partial format.
The only thing done in the High-level format it will be to take the file system assigned to the sectors and edit it to 'indicate' that there is no data in these. This causes data loss immediately, and although they are not really eliminated and can be mostly recoverable, the main problem is that the references to the files cease to exist and therefore all the details about them. It is true that data can be retrieved from a formatted hard drive, it is also true that in many cases or we have disordered data or they simply lose much in recovery. A logical format serves us to quickly, re-establish the empty hard drive (although the data remain there), and therefore be able to re-use all the space, which will be rewritten partially every time we keep information in the sectors. Once written information about which data already existed, the previous ones cannot be retrieved again, as we change the magnetization of the sectors, so that when using all the capacity of the hard drive after a logical format, the previous files will have been overwritten, so they will have been lost definitively.
Structure of a disk
During the low-level format operation, the tracks and sectors of each deck are set. The structure is the following:
- Pists, several thousand concentric circles per plate of the hard drive that can be arranged vertically in cylinders.
- Sector, several hundred per track. The individual size is usually 512 bytes.
- Preamblewhich contains bits that indicate the beginning of the sector and then the number of cylinder and sector.
- Data.
- ECCwhich contains recovery information for reading errors. This field is variable and will depend on the manufacturer.
- Sector, several hundred per track. The individual size is usually 512 bytes.
The sum of these three component of the sector will result in the size of the secteriable on the disc, equivalent to the space between each sector, the size of the preamble and the ECC. This loss is equivalent to 10% of the album space. For advertising reasons, the lost space is usually announced as available space for data storage. Therefore, a 20 GB hard drive will be available 18 GB.
Reading speed limitation
Low-level formatting prevents faster reading of data, regardless of interface. This reading will be conditioned only by the speed of the disk (in rpm), the number of sectors per track and the amount of information per sector.
Disk Interleave
The disk buffer will be a fundamental and very important factor in the reading speed. If a buffer has a storage capacity of one sector, after reading said sector, it must transmit the information to the main memory; This transmission time will be enough for the contiguous sector to have moved from the reading head and therefore it is necessary to wait for a new complete revolution of the disk to read the sector. A read operation loses negligible amounts of time, but roughly results in lost seconds or minutes. To do this, disk interleaving is used, a procedure consisting of numbering the clusters in a non-contiguous way or separated from each other, so that after data transmission to main memory there is no need to wait for a full rotation. The interleaving can be single or double, depending on the data rate of the buffer.
Where a shows slices without a caret, b shows slices with a single caret, and c shows a double caret.
Disk partitioning
On hard drives
Disk Partitioning can be an intermediate step between the low-level format and the high-level one, in any case, it will be an essential step to be able to perform a high-level format, since in the case of hard drives, can only be done to individual partitions. However, the high-level format can be performed on pre-existing partitions from a previous partitioning, which does not force you to perform a new partitioning each time you want to perform a high-level format.
Each hard drive supports a maximum of 4 primary partitions; one of them may be an 'Extended Partition' (which is a type of 'Primary Partition') and within it, one or more partitions of the type 'Logical Partition' [Actually, the limitation to four primary partitions is not intrinsic to hard drives, but to their partition table; Usually, the partition table is of the ms-dos type, which is what meets this limitation to four primary partitions. However, there are other types of partition tables such as the GUID Partition Table which, on 64-bit systems, could allow up to 128 primary partitions. Furthermore, GPT partition tables completely dispense with the concept of 'Extended Partition'. and, consequently, 'Logical Partition': only uses 'Primary Partitions'].
Logically speaking, each primary or logical partition will be an individual disk; to which any Windows system will assign a letter, usually starting with C. The order of priorities in assigning drive letters by default will always start with the floppy drives (a and b) continuing with the Hard Disk drives (partitions). (c,d...), optical drives (continuing the previous order), and flash drives. However, this order can be altered. On Linux systems they will be named by the prefix hda or sda followed by the partition number. The first partition will always be hda0 or sda0.
High-level formatting
The logical, high-level format, or also called file system, can usually be done by users, although many media come already formatted from the factory. The logical format implements a file system that assigns sectors to files. In hard disks, so that different file systems can coexist, before carrying out a logical format, the disk must be divided into partitions; later, each partition is formatted separately.
Formatting a unit implies the deletion of the data, due to the fact that the allocation of files to clusters is changed (a set of contiguous sectors, but which the system distributes as it pleases), with which the old allocation is lost which allowed access to the files.
Each operating system has some common file systems:
- Windows: ExFAT, FAT, FAT16, FAT32, NTFS, EFS.
- Linux: ext2, ext3, ext4, JFS, ReiserFS, Reiser4, XFS.
- Solaris: UFS, ZFS.
- Mac OS: HFS, HFS+.
- IBM: JFS, GPFS.
- Optical Discs: UDF.
Before a disk can be used to store data, it must be formatted. The removable disks (floppy disks, CD, USB, Zip Drive, etc.) that you buy are usually already formatted but you may find unformatted ones from time to time. A new hard drive or tape recording device may not have been pre-formatted.
Typically, a full format does the following things:
- Delete all previous information (including obviously viruses because they are software)
- Sets a recording system by setting what and where it will be placed on the disk.
- Verify the disc about possible physical or magnetic errors that may take place on the computer.