Managing Disks in Windows

August 7, 2020

Photo by Pixabay on Pexels.com

There are two main ways to manage disks in Windows, a program in command prompt called diskpart and disk management in the GUI (graphics user interface). Disks are the actual physical disk inside the hard drive. A drive is what is created when the physical disk is logically divided. The act of creating these drives is called partitioning. There are two partitioning schemes: MBR (master boot record) and GPT (GUID partition table). Each partition is assigned a file system. Volumes are the labels given to the partitions.

We are going to start talking about the two partitioning schemes, MBR and GPT. MBR, or master boot record, can have up to four primary partitions. If you would like to use more than four partitions then the last partition has to be set up as an extended partition. This extended partition can then have logical partitions inside of it. One of the drawbacks to MBR is that the boot code is only stored once so if that code becomes corrupted at all then the system cannot boot. MBR has a 2 TB partition size limit. Any partition labeled active has a bootable OS on it. MBR does support multiboot systems. MBR is considered legacy.

GUID partitioning table or GPT is the newer partitioning scheme. GPT is required to boot 64-bit Windows when using a UEFI or unified extensible firmware interface. GPT does away with a lot of the limitations of MBR. GPT allows 128 partitions for every disk. Also, GPT uses redundancy when it comes to the boot code. Meaning that if one of the boot code becomes corrupted then there is a backup and the system can still boot. There is a 16 EB (exabytes) partition size limit.

Each partition uses a separate file system. File systems dictate how the physical disks are used to store data. There are three “levels” or storage units of data: sectors, clusters, and files. This can be configured during the setup of the file system. 512 bytes is the smallest sector size. Because most files are larger than that, 4k byte sectors are usually used. A cluster is a grouping of sectors. Files use clusters to store data. Files cannot share clusters so if there is any unused space within a sector than that data is lost.

NTFS (New Technology File System) is the file system that Windows uses. This file system allows for 64-bit addressing. It also allows for very big volumes and file sizes. The theoretical size of these is 16 exabytes. Although, in practice, 137 256 TB volumes or files are used. NTFS utilizes sector sparing and transaction tracking to provide reliable data transfer. This means that after a sector is written, it is checked to see if it was written. If it is discovered that the sector is bad, then that data is written to the spare sector and marks the bad sector as unusable. NTFS also uses file permissions and ownership, auditing, quota management, and Encrypting File System (EFS). The permissions and users can be set under file properties. File auditing allows the system to track who used the file and what was done with the file. Quota management allows us to manage how much of a disk is used by users. Encrypting file system is a feature of NTFS that allows encryption at a file and folder level instead of an operating system level. NTFS allows for compression at a folder level. NTFS also allows for indexing. The indexing service creates a catalog of file and folder locations and properties, which allows for faster searching. NTFS can use dynamic disks. This allows space on multiple physical disks to be combined into one volume. NTFS really is not supported outside of Windows.

FAT16 is a file system that was used for the first PCs that had hard disk drives. This file system only allows for max volumes of 2 for 4 GB depending on how it is configured. Unlike NTFS, FAT16 only allows 32-bit cluster sizes. The nice thing about FAT16 is that it is supported by almost any operating system.

FAT32 is a file system that is very similar to FAT16. It uses 32-bit clusters. FAT32 increases the max volume size to 2TB. The max file size stays at the 4GB restriction. Again, FAT32 is supported on most operating systems. FAT32 is a good choice for mutiboot scenarios or removable storage because of the interoperability between operating systems.

EXFAT is an upgrade to FAT32. It uses 64-bit clusters. It supports up to 128 PB (petabyte) volumes. The max file size is 16 EB. Because EXFAT does not use all the extra features that NTFS uses, EXFAT can actually outperform NTFS on the drive over 1 TB.

CDFS and UDF are file systems used on optical media. Compact Disk File System is used on read-only write-once CD-ROMS. CDFS is cross-platform so if it is created on a Windows machine, it is still readable on a macOS machine. CDFS can only support small file sizes so we started using UDF. Universal Disk Format can support much larger sizes. We use UDF on CD, DVD, and Blu-Ray.

Disk Manager is the primary way to manage disks in Windows. By right-clicking on each volume or disk it will give you most of the options of that volume or partition like creating new partitions, extending partitions, changing the partition scheme, and much more. You can see where the active partitions are and what each partition is being used for.

DiskPart is the program in Command Prompt to manage disks. By typing diskpart into the command line it will start DiskPart. Here are some of the common commands that can be used in DiskPart.

  • “list disk” will show all the disks in the system, whether it is online or offline, the size of the disk, whether it is dynamic, whether it uses a GPT, and how much space is unallocated.
  • “list volume” will show the drive letter, what the label is of the volume, the file system, what kind of volume it is, and what size it is.
  • “select” then followed by either the disk, volume, or partition. This will select that specific object.
  • “delete” deletes the selected object
  • “online” takes the specific object online
  • “offline” takes the specific object offline
  • “exit” will exit DiskPart
  • “remove” will remove the drive letter or mount point
  • “shrink” reduces the size of the selected volume
  • “filesystems” will display the current file systems on the selected volume
  • “extend” will extend a volume
  • “format” will format the selected object
  • “help” will give you a list of commands that can be used

Leave a comment