Unallocated Space in DOS/MBR, Linux, and Windows Systems
In this article, we will discuss unallocated space in DOS/MBR, Linux, and Windows systems. Unallocated space is the area on a hard drive or solid-state drive (SSD) that has not been partitioned or formatted for use by an operating system (OS). This space can be used to create new partitions or expand existing ones. We will cover key concepts related to unallocated space in these systems, including partitioning, formatting, and managing disk space.
Partitioning and Formatting Drives
Partitioning is the process of dividing a hard drive or SSD into one or more logical sections, called partitions. Each partition can be formatted with a file system that is compatible with the operating system being used. Formatting a partition involves writing a file system to the partition, which makes it ready for use by the operating system. In DOS/MBR systems, the Master Boot Record (MBR) is used to manage the partitions on the drive. In Linux and Windows systems, the GUID Partition Table (GPT) is used for newer systems, while the MBR is used for older systems.
Managing Disk Space in Linux Systems
In Linux systems, unallocated space can be added to an existing partition or used to create a new partition. The fdisk command can be used to manage partitions and the mkfs command can be used to format the new partition with a file system such as ext4. The resize2fs command can be used to resize an existing ext4 partition to use the newly added unallocated space.
# fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 120 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a2d4a
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 83 Linux
/dev/sda2 206848 234441615 117117384 83 Linux
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First sector (206848-234441615): 206848
Last sector, +sectors or +size{K,M,G} (206848-234441615):
Created a new partition 1 of type 'Linux' and of size 117.1 GiB.
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.# mkfs.ext4 /dev/sda1
mke2fs 1.42.13 (17-May-2015)
Discarding device blocks: done
Creating filesystem with 29360512 4k blocks and 7327872 inodes
Filesystem UUID: 5e8e36f6-0a2e-4e1f-a26e-a2a3c2c8d46e
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: done
Writing inode tables:
Writing superblocks and filesystem accounting information: done# resize2fs /dev/sda1
resize2fs 1.42.13 (17-May-2015)
Resizing the filesystem on /dev/sda1 to 29360512 (4k) blocks.
The filesystem on /dev/sda1 is now 29360512 blocks long.Managing Disk Space in Windows Systems
In Windows systems, unallocated space can be managed using the Disk Management tool. This tool can be used to create new partitions, format partitions with a file system such as NTFS, and extend existing partitions to use unallocated space. The Disk Management tool can be accessed by right-clicking on the Start button and selecting Disk Management.
Managing Disk Space in DOS/MBR Systems
In DOS/MBR systems, unallocated space can be managed using the fdisk command. This command can be used to create new partitions, format partitions with a file system such as FAT, and delete partitions. The fdisk command can be accessed by typing fdisk at the command prompt.
In this article, we have discussed unallocated space in DOS/MBR, Linux, and Windows systems. We have covered key concepts related to partitioning, formatting, and managing disk space in these systems. By understanding these concepts, you can effectively manage unallocated space on your hard drives and SSDs.