Formatting and Managing File Systems
A new computer has one or more physical drives that might be combined into a single visible drive in a highly available configuration (for example, Redundant Array of Inexpensive Disks [RAID] 1 mirror drives or individual drives). Before these disk areas can be used, partitions must be created on the disk space. This can be done during the operating system installation or within the installed operating system using the Disk Management Microsoft Management Console (MMC) snap-in. Both graphical and command-line interfaces exist for managing disk partitions.
Disk Management Microsoft Management Console Snap-In
The Disk Management MMC snap-in is part of the Computer Management console. It is available in the Administrative Tools program group within the Storage section of the navigation pane.
The physical drives are shown in the bottom part of the details pane. Within each physical disk space volume, the various partitions and any available unallocated disk space are shown. At the top of the details window is a list of the actual partitions with their type, layout, file system, and status.
The layout refers to the type of the volume. For example, a volume comprising of space on a single disk is known as a simple volume. Just as hardware disk configuration such as mirroring and striping with parity (RAID 5) is possible, software versions of these disk configurations are part of the Windows operating system. The complete list of disk configurations is as follows:
- Simple: A single block of contiguous space on a single physical disk
- Spanned: Multiple blocks of contiguous space on single or multiple physical disks
- Striped (RAID 0): Multiple blocks of contiguous space on multiple physical disks
- Mirrored (RAID 1): Two blocks of equal contiguous space on two separate physical disks with the same information
- RAID 5: Multiple blocks of contiguous space on at least three physical disks with parity information stored across the disks
Only mirroring and RAID 5 increase availability because data is spread over multiple physical drives with data redundancy. If one disk is unavailable, its content is either duplicated on another disk in the set or can be calculated by parity information spread over the other members of the set.
The type of disk refers to whether the disk is a basic disk, dynamic disk, or GUID Partition Table (GPT) disk. A basic disk is the traditional disk type of storage, similar to that used by MS-DOS, and is based on partition tables that can contain basic volume types such as primary, extended, and logical drives. The only type of volume you can have on a basic disk is a simple volume. Dynamic disks contain dynamic volume types, such as spanned, striped, mirrored, and RAID 5. Dynamic disks are not understood by pre-Windows 2000 operating systems. A basic disk can be upgraded to a dynamic disk by right-clicking on the disk and selecting Convert to Dynamic Disk from the context menu. After you convert a disk to dynamic, the only way to convert it back to basic is to delete all volumes on the disk. The third type of available disk is the GPT disk. GPT was created as part of the Extensible Firmware Interface (EFI) initiative and is designed to give a far more flexible approach to volume management. GPT disks support 128 primary partitions, a lot compared to the four supported by traditional MBR type disks, and volumes greater than 2TB (the MBR limit).
Windows Vista and Windows Server 2008 introduced the capability via the Disk Management snap-in to shrink and extend volumes via the context menu of a partition.
If you select the Shrink Volume option, the disk management interface ascertains the amount of space at the end of the disk that can be shrunk. This can be modified as required. After the amount of space is selected, click Shrink to resize the partition.
The Extend Volume option selects free space next to the partition to increase the partition size and keeps it as a simple volume, or selects disk space from another area on the disk or another disk entirely to create a spanned volume.
To create a volume, perform the following steps:
- Right-click on an area of unallocated disk space and select a new type of volume (simple, mirrored, and so forth).
- Click Next to the New Volume Wizard introduction screen.
- Depending on the type of volume selected, select disk space from the selected disk or multiple disks. Click Next.
- Assign a drive letter for the new volume or mount the partition as a folder on an existing volume as a junction point. If you want to assign letters or paths later, select the option to not assign a letter or folder. Click Next.
- The final dialog formats the new volume. After options are selected, click Next. The Quick Format option does not perform the normal bad sector check. If you are formatting a disk that you have used for a while and that you know is good, you could perform a quick format. The Enable File and Folder Compression option means that all data on the new volume should be compressed. The allocation unit defines how big the smallest unit of allocation is on a volume. The larger the allocation unit, the fewer number of units are required for each file, resulting in more efficient and faster disk access. However, you also risk wasting space. If you have many 1KB files and the allocation unit is 64KB, each file has 63KB of wasted space. If you know you are storing large files, set a large allocation unit size; if you are storing lots of small files, set a low allocation unit size. Normally the default works fine. Click Next.
- A summary of the new volume creation is displayed. After confirming options, click Finish.
A partition format can be performed by right-clicking on the partition and selecting Format from the context menu. This can also be performed via Explorer by right-clicking on the volume and selecting Format.
Command-Line Management
As with the graphical interfaces, all the same options can be performed from the command line, which is mostly facilitated via the diskpart command-line utility.
The basic read type operations are available with diskpart, such as listing all the disks and viewing partitions on a disk, as shown here:
DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ---------- ------- ------- --- --- Disk 0 Online 16 GB 280 MB * Disk 1 Online 31 GB 4399 MB * * Disk 2 Online 16 GB 15 GB * * DISKPART> select disk 0 Disk 0 is now the selected disk. DISKPART> list part Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 2 Dynamic Data 993 KB 32 KB Partition 1 Dynamic Data 15 GB 1024 KB Partition 3 Dynamic Data 1382 MB 15 GB DISKPART> select part 3 Partition 3 is now the selected partition. DISKPART> detail partition Partition 3 Type : 42 Hidden: Yes Active: No Volume ### Ltr Label Fs Type Size Status Info ---------- --- ------ ---- ------- ------- -------- ----- * Volume 3 F RAID1 NTFS Mirror 500 MB Healthy
To create volumes, use the Create Volume context menu action on dynamic disks or Create Partition on basic disks.
The power of diskpart is useful for scripting. For example, the following commands to create and format partitions can be saved as a text file and then passed to the diskpart command:
select disk 0 clean create partition primary select partition 1 assign letter=c: active format exit
To pass the text to diskpart, use the /s switch:
diskpart /s partcleanandcreate.txt
To create more complex disk sets, such as a RAID 5, you need to pass the disks you want to use as part of the set; for example:
DISKPART> create volume raid size=6000 disk=1,2,3 DiskPart successfully created the volume.
Here, the disk= are the disks to use and the size= is the space to take from each disk. To see a list of all commands, run help from within diskpart.
In this tutorial:
- Windows Server File System and Print Management
- File System Types and Management
- New Technology File System (NTFS)
- New NTFS Features in Windows Server 2008
- Formatting and Managing File Systems
- Converting File Systems
- File Management
- File Permissions
- Shares
- NTFS Quotas
- Encrypted File System (EFS)
- Shadow Copy Feature
- File Server Resource Manager
- File Server Resource Manager Options
- Reporting
- Quotas
- File Screening
- Exporting and Importing File Screens and Quotas
- Print Management
- Print Management MMC
- Printer Properties
- Listing a Printer in the Active Directory
- Connecting Users to Network Printers
- Deploying Printers
- Allowing Nonadministrators/Power Users to Install Printers
- Migrating a Printer
- Automatic Network Print Addition
- Print Server Configuration
- Customizing Views of Information