The late, great comic George Carlin once observed, “All you need in life is a little place for your stuff.” Unless you use your computer exclusively as a game machine, learning to manage your digital “stuff”—your documents, programs, and communications—is probably the single most critical computing skill you need to acquire. The addition of cloud services adds extra flexibility as well as new organizational challenges, especially as you juggle multiple devices with different storage capacities.
In this chapter, we cover how to set up and manage the places where we put all that stuff: old-fashioned hard drives, fast solid-state drives, and removable devices that make it possible to move stuff from one device to another. (We get to the tools and techniques for managing and organizing those files in Chapter 9, “Using File Explorer.”)
In the modern era, there’s also the option to put your stuff in the cloud, where it’s accessible from any device with an internet connection. Microsoft’s cloud storage service, OneDrive, offers a generous allotment of storage with every free Microsoft account and much more with a Microsoft 365 subscription. Its sync engine, built into Windows 11, allows you to browse through your cloud storage without having to fill all of your local storage. In this chapter, we explain how to configure OneDrive so that your most important files are available when you need them, even if you’re not connected to the internet.
Finally, this chapter also covers the tools and techniques for working with existing local drives—internal, external, and removable—including managing volumes and monitoring disk usage.
Like its predecessors, Windows 11 includes two tools that are useful for setting up a new storage device:
Disk Management This console offers a graphical interface for initializing, partitioning, and formatting storage devices. It’s accessible from the Quick Link menu, which appears when you right-click Start or press Windows key+X.
DiskPart For those who need to incorporate disk-management tasks in scripts or who simply prefer carrying out administrative tasks using a command line, Windows also provides this utility, which is in the Windows\System32 folder.
Everything you can do with Disk Management you can also do by using DiskPart; you just have to work harder and more carefully.
The Windows 11 Settings app includes some additional tools for inspecting the properties of storage devices, managing disk usage by category, and cleaning up unwanted files. We cover these options later in this chapter.
Knowing when to use which tool is the secret of disk wizardry in Windows 10 and Windows 11. Disk Management, for example, is ideal for shrinking and expanding volumes, whereas the Clean command in DiskPart makes short work of preparing a disk to be formatted for a new role. That command has no counterpart in Disk Management.
In this section, we cover the commands required to prepare a new drive for use on a Windows PC and to maintain and reconfigure existing storage devices.
To run Disk Management, type diskmgmt.msc
at a command prompt; as an alternative, you can press Windows key+X (or right-click the Start button) and then click Disk Management on the Quick Link menu. If you’re signed in with a standard account, you need to supply administrative credentials. Figure 8-1 shows the Disk Management console on a typical PC, with two fixed disks and one removable drive.
Figure 8-1 Use the Disk Management console to gather information about and manage fixed and removable disk drives.
Disk Management provides a wealth of information about physical disks and the volumes, partitions, and logical drives in place on those disks. You can use this utility to perform the following disk-related tasks:
Check the size, file system, status, and other properties of disks and volumes.
Create, format, and delete volumes, partitions, and logical drives.
Assign drive letters to hard disk volumes, removable disk drives, and optical drives.
Create mounted drives.
Extend or shrink a volume.
Disk Management displays information in two panes. In its default arrangement, the upper pane lists each volume on your system and provides information about the volume’s type, status, capacity, available free space, and so on. You can carry out commands on a volume by right-clicking any entry in the first column of this pane (the column labeled Volume) and choosing a command.
In the lower pane, each row represents one physical device. The heading at the left of each row shows the name by which that device is known to the operating system (Disk 0, Disk 1, and so on), along with its type, size, and status. To the right are areas that display information about the volumes of each device. Note that these areas are not by default drawn to scale. To change the scaling used by Disk Management, click View and then Settings. You find various options on the Scaling tab of the Settings dialog.
Right-clicking one of the headings at the left in the lower pane (labeled by a disk number) displays commands pertinent to an entire storage device. Right-clicking an area representing a volume provides a menu of actions applicable to that volume.
To use DiskPart, start by running Windows PowerShell or Command Prompt (Cmd.exe) with admin privileges.
For more information about PowerShell and Cmd.exe, see Chapter 16, “Windows Terminal, PowerShell, and other advanced management tools.”
When you run DiskPart, it switches to a command interpreter, identified by the DISKPART> prompt. If you type help and press Enter, you see a screen that lists all available commands.
Even if you prefer to avoid the command line and don’t intend to write disk-management scripts, you should know about DiskPart. Consider it an essential survival skill: If you ever find yourself needing to manage hard disks from the Windows Recovery Environment (Windows RE), you will have access to DiskPart, but you won’t have access to the Disk Management console. (Windows RE is a special environment you can use for system-recovery purposes if a major hardware or software problem prevents you from starting Windows.)
Caution
DiskPart is not for casual experimentation. Its primary purpose is for scripting rather than for interactive use. The DiskPart command-line interpreter is dense and cryptic, with a complex structure that requires you to list and select objects before you act on them. For more details about DiskPart, see “DiskPart Commands” (https://bit.ly/diskpart-commands). The details about the syntax and usage of DiskPart in this article are invaluable.
Whether you’re installing Windows on a brand-new disk or simply adding a new disk (internal or external) to an existing system, you should consider how you want to use the new storage space before you begin creating volumes. If your goal is to set up a large space for backup or media storage, for example, you might want to devote the entire disk to a single volume. On the other hand, if your plan is to establish two or more separate volumes—one for Windows system files and another for data files, for example—decide how many gigabytes you want to assign to each partition. You can change your mind later, but it’s easiest to adjust the number of volumes on a disk and their relative sizes before you fill a volume with a large amount of data.
When you run the Windows 11 Setup program on a computer with a single, raw hard disk (such as a desktop computer you built yourself from new parts or any PC in which you’ve replaced the system drive or completely wiped its partitioning details), you’re presented with a screen identifying the disk and its size. If you want to create a single volume encompassing the entire disk, you can click Next to proceed, and Setup takes care of initializing the disk, creating a new volume, and formatting it. Otherwise, you can click New, and then in the same screen, you can choose the size of the volume you want to create for your Windows installation.
If you decide not to use the entire disk capacity for the Windows system drive, you can create additional volumes from within the Setup program. But there’s no particular need to do this. After you install Windows, you can use Disk Management to create one or more additional volumes in the unallocated space remaining on the disk.
For more information about setting up Windows, see Chapter 2, “Setting up a new Windows 11 PC.”
When you open Disk Management for the first time after installing a new hard disk, Windows offers to initialize the disk, as shown in Figure 8-2. (If you don’t see this dialog automatically, or if you dismissed it earlier, you can force it to appear by right-clicking the box to the left of the disk in Disk Management’s lower pane and clicking Initialize Disk.) This action defines the partition style for the disk and is an essential first step before you can use Disk Management to perform any further actions.
Figure 8-2 You must initialize a disk using one of these two partition styles before you can create a new volume and format it for data storage.
MBR (Master Boot Record) and GPT (GUID Partition Table) are terms describing alternative methods for maintaining the information that defines how a disk stores data. Which partition style should you choose? GPT is required on drives that contain the Windows partition on UEFI-based systems—a description that applies to every PC that is compatible with Windows 11. Choose MBR only in those rare circumstances when compatibility with older operating systems on legacy hardware is required. GPT disks support larger volumes (up to 18 exabytes) and more partitions (as many as 128 on a basic disk).
After this task is complete, you need to create one or more volumes in the unallocated space, assign a drive letter to each volume, label the volumes (if you don’t want them to be identified in File Explorer as simply New Volume), and format them. You can carry out all these steps with the help of a wizard. To begin, right-click anywhere in the area marked Unallocated and then click New Simple Volume. The New Simple Volume Wizard appears. Complete the following steps to create your new volume:
Specify Volume Size. This page displays the maximum and minimum amounts of space you can devote to the new volume. The wizard doesn’t give you the option of designating volume space as a percentage of unallocated space, so if your goal is to create two or more volumes of equal size, you need to do a bit of arithmetic before proceeding.
Assign Drive Letter Or Path. You can assign any available drive letter to the new volume. (Note that the letters A and B, which used to be reserved for floppy disks, are no longer reserved.) You also have the option to assign no drive letter. (An additional option, Mount In The Following Empty NTFS Folder, allows you to access the volume as if it were a subfolder on an existing volume. For details, see “Mapping a volume to an NTFS folder,” later in this chapter.)
Format Partition. You don’t have to format the new volume immediately, but there is rarely a good reason to wait. Your choices, as shown in Figure 8-3, are as follows:
File System A file system is a method for organizing folders (directories) and files on a storage medium. For hard disk volumes larger than 4 GB (4,096 MB), your only options are NTFS (the default) and exFAT. If you’re formatting removable media such as USB flash drives or a writable optical disc, other file systems are available. For more information, see “Choosing a file system” later in this chapter.
Allocation Unit Size The allocation unit size (also known as the cluster size) is the smallest space that can be allocated to a file. The Default option, in which Windows selects the appropriate cluster size based on volume size, is the best choice here.
Volume Label The volume label identifies the drive in File Explorer. The default label is New Volume. It’s a good idea to replace this generic label with one that describes the volume’s purpose.
Figure 8-3 Use the Format Partition page to specify your new volume’s file system, allocation unit size, and volume label.
Select the Perform A Quick Format check box if you want Disk Management to skip the sometimes lengthy process of checking the disk media. Although you might be tempted by the Enable File And Folder Compression option, we recommend leaving the check box cleared. NTFS compression is not appropriate for disks that contain Windows system files or for drives containing data files that are already compressed, such as MP3 audio files. It’s most useful on secondary data volumes that contain large quantities of data files in uncompressed formats, such as audio WAV files.
After making those selections, click Next to advance to the wizard’s final page, where you have one more chance to review your specifications. You should take a moment to read this display before you click Finish.
After Disk Management has done its work and disk formatting is complete, a dark blue bar appears over the new volume in the console’s graphical view pane. Figure 8-4 shows the result after we added a second drive and created a partition using half of the available space for storing an archive of video files.
Figure 8-4 The dark blue bar above the newly created volume on Disk 1 means it’s ready for use. The black bar and Unallocated label means the remaining space is available for a second volume.
If your disk still has unallocated space (as the disk in this example does), you can add another volume by right-clicking that part of the disk map, clicking New Simple Volume, and running through the wizard again.
Formatting a disk prepares it for data storage; the first step in formatting is choosing a file system. Windows 11 supports the following file systems: FAT (File Allocation Table), NTFS, exFAT (Extended File Allocation Table, optimized for use with flash drives), CDFS (Compact Disc File System, also sometimes identified as ISO-9660), and UDF (Universal Disk Format). Windows 11 provides read/write ability for the relatively new Resilient File System (ReFS), but creating and formatting a new ReFS volume requires Windows Pro for Workstations editions.
The formatting choices available for a specific volume depend on the type of media you’re formatting. With hard disks, the only options made available by Disk Management are NTFS and exFAT. If you want to format a hard disk in FAT32, you need to use the Format command with the /FS
switch at a command prompt. (Type format /? at the command prompt for details.) The only good reason to do this, however, is for the sake of compatibility with devices running non-Microsoft operating systems that don’t natively support NTFS.
If you’re formatting a USB flash drive or a MicroSD card, on the other hand, either FAT32 or exFAT is a reasonable choice. Because NTFS is a journaling file system, reading and writing files on NTFS disks involves more disk input/output than similar operations on FAT32 and exFAT disks. Flash drives can perform a finite number of reads and writes before they need to be replaced—hence, they might have a longer life expectancy under FAT32 or exFAT than under NTFS. On UEFI systems, FAT32 is required for bootable installation media. (For more information about exFAT, see the “exFAT versus FAT32” sidebar later in this section.) For a tabular comparison of file systems, see the Microsoft Docs article, “File System Functionality Comparison,” at https://bit.ly/file-systemcomparison.
In general, for any fixed drive, NTFS is your best choice. It offers a number of important advantages over the earlier FAT and FAT32 file systems:
Security On an NTFS volume, you can restrict access to files and folders by using permissions. (For information about using NTFS permissions, see “What are ACLs?” in Chapter 10, “Managing user accounts, passwords, and credentials.”) You can add an extra layer of protection by encrypting files if your edition of Windows supports it. (Windows Home edition does not support file encryption using EFS; all other editions do.) On a FAT or FAT32 drive, native encryption options are not available; anyone with physical access to your computer can access any files stored on that drive.
Reliability Because NTFS is a journaling file system, an NTFS volume can recover from disk errors more readily than a FAT32 volume. NTFS uses log files to keep track of all disk activity. In the event of a system crash, Windows 11 can use this journal to repair file-system errors automatically when the system is restarted. In addition, NTFS can dynamically remap clusters that contain bad sectors and mark those clusters as bad so that the operating system no longer uses them. FAT and FAT32 drives are more vulnerable to disk errors.
Expandability Using NTFS-formatted volumes, you can expand storage on existing volumes without having to back up, repartition, reformat, and restore.
Efficiency On partitions greater than 8 GB, NTFS volumes manage space more efficiently than FAT32. The maximum partition size for a FAT32 drive created by Windows 10 or Windows 11 is 32 GB; by contrast, you can create a single NTFS volume of up to 16 terabytes (16,384 GB) using default settings, and by tweaking cluster sizes, you can ratchet the maximum volume size up to 256 terabytes.
Optimized storage of small files Files on the order of 100 bytes or less can be stored entirely within the Master File Table (MFT) record, rather than requiring a minimum allocation unit outside the MFT. This results in greater storage efficiency for small files.
Storage Spaces is a technology that has been a part of Windows server and desktop editions for more than a decade. Using this technology allows you to aggregate collections of physical disks into “storage pools” and then create virtualized volumes (“storage spaces”) within those pools. For example, you could start with two external USB drives, each with a capacity of 3 TB, and use Storage Spaces to combine those physical disks into a single virtualized disk with a capacity of 6 TB.
You can also use Storage Spaces to establish resiliency for critical data. For example, using your two 3-TB disks, you could create a mirrored storage space in which each file saved on one of the physical disks is mirrored on the other; if one of the physical disks fails, your data is preserved.
Three types of resiliency are available:
Two-way mirror The system writes two copies of your data. You can lose one physical disk without data loss. A minimum of two physical disks is required. The amount of storage available is half of the total storage pool or the capacity of the smaller disk, whichever is less.
Three-way mirror The system writes three copies of your data. You can lose two physical disks without data loss. A minimum of three physical disks is required, and the amount of storage available is approximately one-third of the storage pool.
Parity The system stripes data across physical disks while also maintaining parity information that allows it to protect and recover your data more efficiently in the event of drive failure. A minimum of three drives is required.
Simple (nonresilient) storage spaces are recommended if you prefer a single large virtual disk instead of separate physical disks. You might make this choice, for example, if you have a large media collection and several older (hence smaller) disks that are not currently in service. Simple storage spaces are also a good choice for space-intensive operations (video editing, for example) that do not require resiliency. Files in a simple storage space are striped across physical disks, resulting in better performance.
Use parity for maximum resiliency, but note that write performance is degraded by the requirement for the system to calculate and store parity information. This choice might be appropriate for archival storage.
Note the following:
You can create a storage space only on disks that contain unallocated space. The Windows 11 version of Storage Spaces does not allow you to create a storage pool using disks that you have already partitioned, even if those volumes are unformatted and empty.
You can have multiple storage pools and multiple storage spaces on a single PC.
Each storage pool you create appears in Disk Management as if it were a physical drive. Its properties identify it as a Microsoft Storage Space Device. Each storage space within that storage pool appears in Disk Management as a basic volume.
Storage spaces should not be used as your only backup option. They do not protect your data against theft, fire, or other catastrophic events that affect the entire collection of physical disks.
In Windows 10, the controls for setting up and managing a storage space were buried in the old-style Control Panel; in Windows 11, those controls have been redesigned using a more modern interface. Go to Settings > System > Storage, click Advanced Storage Settings, and then click Storage Spaces.
If you don’t currently have any storage spaces available, this page contains only a single control, labeled Add A New Storage Pool. Click Add to begin. That opens the dialog shown in Figure 8-5.
Figure 8-5 Create a new storage pool by combining two or more unallocated disks.
After confirming that you want to add the selected disks to your new storage pool, replace the generic name with a descriptive one and click Create. After you create a storage pool, Windows prompts you to create a new storage space. Figure 8-6 shows the New Storage Space dialog.
Figure 8-6 The most important setting here is the resiliency type. We’ve chosen to create a simple space that combines multiple drives into a single, larger drive.
Once again, you can change the generic name to one that’s more descriptive. (If you skip this step, it’s easy to adjust later.) Choose a resiliency type and a size. Note that you can create a storage space that’s larger than the space in your current storage pool. You might choose to do this if you know you’ll be adding additional disks to the pool later.
Click Create to save your changes. The dialog that appears next allows you to choose a drive letter and file system for your new space (the default of NTFS is usually appropriate). Add a drive label, if you want, and then format the new storage space.
To manage existing storage spaces, open the Storage Spaces page in Settings and expand the pane for the storage pool you want to work with. The resulting page should look like the one shown in Figure 8-7.
Figure 8-7 Use this page to increase the size of a storage pool by adding a new disk. If you’ve created multiple storage pools, use the Rename button at the top to give each one a descriptive name.
You can rename a pool or space, add a new space, and increase the capacity of an existing pool by adding a new disk.
To delete a storage space, click the Properties button to the right of the space and then click the Delete button. Note that deleting a storage space permanently deletes all data associated with it. There’s no Recycle Bin for a storage space.
To remove a disk from a simple storage pool, you first need to delete any storage spaces associated with that pool. Then click the Properties button to the right of the disk you want to remove and click Prepare For Removal. After Storage Spaces completes its housekeeping, you can click Remove.
For much more information about Storage Spaces, see the support information at https://bit.ly/storage-spaces-help. Some architectural details about the feature are at https://bit.ly/storage-spaces. At the time we wrote this chapter, the latter article had not been updated for Windows 11, but the information it contains is still accurate.
OneDrive, Microsoft’s cloud-based file-storage service, is a crucial part of the Windows experience. When you sign in with a Microsoft account, Windows 11 synchronizes settings and stores recovery keys for encrypted storage using OneDrive. In addition, each free Microsoft account includes at least 5 gigabytes (GB) of OneDrive file storage, with the option to back up key data folders by automatically synchronizing their contents with OneDrive’s cloud-based servers. You can expand that capacity with paid upgrades to OneDrive storage or get a massively increased cloud storage allotment (1024 GB per user) with a Microsoft 365 Personal or Family subscription.
OneDrive for Business, which shares a sync client with the consumer OneDrive service, offers enterprise-class management capabilities and at least 1024 GB of file storage for each Microsoft 365 Business and Enterprise subscription. By definition, OneDrive for Business accounts are assigned and managed by an organization, which means that an administrator might place limits on your ability to share files and folders or to access OneDrive for Business files from a device that isn’t registered with your organization.
OneDrive offers a sync client for every major desktop and mobile operating system. In Windows 11, this sync client is built in and is updated automatically. Before we get to that sync client, though, let’s start with an overview of OneDrive and OneDrive for Business.
For details on how OneDrive integrates with File Explorer, see Chapter 9.
Microsoft’s two cloud-based file-storage services share a brand name and a common sync client, but there are some big differences in how the two services work.
OneDrive, the consumer service, is designed for personal use, with special views that showcase photo libraries and albums. (The OneDrive client on mobile devices offers the option to sync the device’s camera roll to OneDrive.) A free OneDrive account allows anyone to create and edit documents using common Office file formats and the online versions of Word, Excel, PowerPoint, and OneNote. Microsoft 365 Family and Personal editions automatically connect to OneDrive accounts, allowing subscribers to create and edit files using the Windows versions of those Office apps.
Files stored in OneDrive are organized into folders and subfolders just as they would be on a local drive. Figure 8-8 shows the top-level folders in a OneDrive account, as viewed in a web browser. Note the range of options available in the command bar for the selected folder, as well as the additional menu choices available from the More (ellipsis) menu.
Figure 8-8 When using OneDrive in a web browser, you can perform most file-management tasks and have the ability to create, edit, and collaborate on Office documents.
Clicking the usage graph in the lower-left corner opens a page with details about storage for that subscription. (The Premium OneDrive label indicates this account is attached to a Microsoft 365 subscription.)
OneDrive for Business offers a similar web-based view, with one crucial difference: Subscription settings aren’t accessible from the navigation pane on the left. That’s because a OneDrive for Business subscription is managed by a company administrator, with additional security and collaboration options appropriate for use in an organization.
Both services allow subscribers to share files and folders with other people. The consumer edition of OneDrive allows complete control of sharing: You can choose to make a file, a photo, or an entire folder public. You can also share access by using a link that doesn’t require signing in with a Microsoft account.
Sharing options for OneDrive for Business are managed by a company administrator, who might apply restrictions on sharing files with other people, especially in folders that contain confidential company information.
Both OneDrive and OneDrive for Business include built-in versioning, so you can see the history of a document and download an earlier version if you want to recover a portion of an earlier draft. The Recycle Bin for both services makes it possible to retrieve deleted documents for up to 30 days.
Although you can use OneDrive on the web and on mobile devices, it is most useful when synced with a PC running Windows, especially in combination with the Office desktop apps in Microsoft 365. You can link one and only one personal OneDrive account to a Windows 11 user profile. You can also link one or more OneDrive for Business accounts to each user profile.
On a PC running Windows 10, you’re prompted to link your Windows account to OneDrive as part of the initial setup for a new user profile. If you’d rather not sync your files with OneDrive, you can dismiss the sign-in prompt and deal with it later—or never. With Windows 11, however, this setup option has changed significantly.
When you use a Microsoft account to sign in for the first time on a new installation of Windows 11, the initial setup for the user profile connects your device to OneDrive using that account. (If you sign in with a local account or an Azure AD account, your PC is not automatically linked to OneDrive; you have to make that connection manually.)
When you sign in with a Microsoft account and choose the default options, Windows also enables a feature called OneDrive Backup. This feature is useful but potentially confusing. Here’s how it works.
OneDrive Backup is available for three folders in your user profile: Desktop, Documents, and Pictures. When you turn on OneDrive Backup, Windows checks your OneDrive account to see if you already have folders with those names and, if necessary, creates those folders. Next, Windows moves the files from your local folders to their OneDrive equivalents. Finally, Windows changes the location assigned to the shortcuts in your user profiles so that when you click on Documents, you open the synced location for the OneDrive\Documents folder instead of the local folder, C:\Users\username\Documents.
Although you have the option when you first set up a profile to store files locally instead of turning on OneDrive Backup, many people will simply click Next and enable this automatic integration. That can result in an unpleasant surprise if you’re not prepared for it.
If the newly configured computer is the only PC connected to this Microsoft account, the OneDrive Backup feature is probably a welcome addition. But if another PC is also backing up those folders to OneDrive, you see all of its files in the corresponding folders on your new PC, and any files you create, edit, or delete on either device are synced to both locations. That can cause problems with available space, especially if you have limited OneDrive storage. It can also cause problems with third-party programs that store configuration and data files in the Documents folder.
To confirm whether OneDrive Backup is set up, open File Explorer and click Home (on a PC running Windows 11 version 21H2, click Quick Access). If you see the OneDrive label beneath the Desktop, Documents, and Pictures folders, as in Figure 8-9, you can choose to turn the automatic backup off before proceeding any further.
Figure 8-9 When OneDrive Backup is configured for the current user profile, the OneDrive label appears beneath each backed-up folder in your user profile.
To turn OneDrive Backup off, right-click the OneDrive node in File Explorer’s navigation pane and then click OneDrive > Settings. In OneDrive Settings, click the Sync And Backup tab, and then click Manage Backup. That action opens the Manage Folder Backup dialog, shown in Figure 8-10.
Figure 8-10 When you stop OneDrive backup, the contents of individual folders remain in their respective OneDrive folders. Changes are no longer synced to your local PC.
Click Stop Backup for one or more folders to stop syncing the local folder to OneDrive. After you stop backup, Windows changes the File Explorer shortcuts for those folders back to the locations in your local user profile but does not move any files from OneDrive to the local folder. Instead, Windows adds a Where Are My Files? link to the folder. Don’t be alarmed if your files appear to be missing; they’re still available in the matching folder in OneDrive, and you can copy or move them to the local folder (or return to the Manage Folder Backup dialog and click Start Backup) to restore order.
Note that the Microsoft account you link in OneDrive does not have to be the same one you use to sign in to Windows, although that’s the most common (and logical) configuration. If you decide, for whatever reason, that you want to use a different OneDrive personal account than the one you sign in with, you first have to unlink the default account; open OneDrive Settings and, on the Account tab, click Unlink This PC.
To add a OneDrive for Business account, open OneDrive Settings, switch to the Account tab, and click Add An Account. After entering your credentials, go through the OneDrive setup wizard, which creates a local folder to hold your synced files. Repeat this process if you want to set up additional OneDrive for Business accounts.
The default location for synced files is a folder in your user profile, with the name OneDrive; if you have multiple accounts, the folder name is followed by a hyphen and either the word Personal or, in the case of OneDrive for Business accounts, the name of your organization. Although you can change the folder name and location, most people accept the default here.
By default, both versions of OneDrive turn on the space-saving Files On-Demand feature. A full listing of files and folders in your OneDrive account appears in File Explorer, and you can open any file by double-clicking it; if the file is currently available only online, the OneDrive sync client downloads it automatically and keeps the local copy in sync with the cloud. We discuss this feature in more detail in Chapter 9.
At any time, you can change your OneDrive configuration: Right-click the OneDrive folder in File Explorer’s navigation pane and then click Settings; or, in the taskbar, click the icon associated with that account (the OneDrive account icon is white; OneDrive for Business icons are blue), click the gear icon, and then click Settings. From the resulting dialog, you can add a new account, unlink an existing account, change the selection of folders that are visible, and limit the amount of bandwidth your system uses when syncing files.
The consumer version of OneDrive (but not OneDrive for Business) offers a feature called Personal Vault, a BitLocker-encrypted virtual folder that requires two-step authentication to access and that locks automatically after a period of inactivity (20 minutes, by default). You can use Personal Vault to store sensitive documents or images—such things as financial or insurance records, scans of drivers licenses and passports, tax and banking forms, and so on. Any time you want to view items in the vault or upload material to it, you’ll be prompted for a second form of authentication; if you’ve set up the Microsoft Authenticator app on a mobile device, you can respond to a push notification to approve the request, or you can ask OneDrive to send a code via text message or email. A shortcut for Personal Vault is in the top-level folder tree for your personal OneDrive account—either in File Explorer or in the corresponding location in the online view of OneDrive.
Two long-term trends have converged in recent years to change the way PC makers approach data storage. The plummeting cost of fast solid-state drives (SSDs) and flash memory means that even inexpensive devices can have fast, reliable storage. In addition, dramatic increases in internet speeds have made cloud storage more practical; as a result, system drives don’t need to be enormous to be useful.
On a desktop PC, you have the option to expand storage by replacing the primary drive with one that’s faster, larger, or both; on most full-size desktop PCs, you can also install additional drives to make room for extra data files. Many portable devices, on the other hand, provide built-in primary storage that is soldered to the system board and can’t be replaced easily. For some portable devices, the option to expand storage using inexpensive removable media is available. Some PCs, for example, include a slot that accepts removable storage in the form of a MicroSD card, which can be treated as dedicated storage and used for File History.
Managing storage on a Windows 11 device involves two separate challenges:
Setting default file locations to make the best use of available storage
Performing occasional maintenance to ensure that useful space (especially on the system drive) isn’t being wasted with unnecessary files
For an overview of how much total storage is available and what’s in use on a Windows 11 device, open Settings > System > Storage to see a page like the one shown in Figure 8-11. This example shows a high-end laptop PC with a C drive on which 557 GB of a total capacity of 951 GB is currently in use.
Figure 8-11 The Storage page in Settings shows how much storage is in use on each drive in the current system.
The initial view on this page shows only the top five categories, which in this example represents about 50% of total storage in use. To see the full list, click the Show More Categories link below this list. For more details about space consumption in a particular category, click the category name. Figure 8-12, for example, shows the breakdown of the System & Reserved category.
Figure 8-12 As you dig deeper into the details of storage usage, you get a clearer picture of which features and apps are using the most disk space.
Here are some examples of what’s in various top-level categories:
System & Reserved This category is typically large and includes files that are essential to the operation of the system. The actual amounts of storage in use depend on the type of device and how much memory it contains. More memory means a bigger paging file, for example, which is reflected in the Virtual Memory subcategory.
Temporary Files The total shown here includes files that are managed by Windows but are not typically necessary for the operation of a Windows 11 device.
Installed Apps This category includes default apps as well as legacy desktop apps and those you downloaded from the Microsoft Store.
Documents, Pictures, Music, Videos These separate categories show how much space is in use in each of the default save locations for the respective file types. Note that this value is not the total found in the libraries of the same names.
Mail This value measures the space used by local copies of messages saved using the default mail app. Clicking or tapping the Manage Mail button takes you to the default email app: Mail or Microsoft Outlook, for example.
OneDrive Check this category to see the total amount of space used by local copies of files synced from OneDrive.
Desktop This total should be small unless you use the desktop as a dumping ground for downloads and other potentially large files.
Maps If you have a large collection of offline maps, this category can get fairly large.
Other People This category displays the total amount of space in use for data files from other user accounts, not broken down by file types.
Other If you have large collections of files that don’t slot into the standard categories, you might see a very large Other category. The types of large files that might show up in this category include Hyper-V virtual machines and associated VHD files as well as ISO files.
As you click to navigate deeper into the categories in the Storage section of Settings, you find buttons and links for managing files contained in that category by using built-in Windows tools, including File Explorer.
If you have multiple storage devices available, click Advanced Storage Settings > Storage Used On Other Drives. The resulting display includes USB disks, flash disks, and other media. Click any drive to display a categorized list that you can navigate the same as the one available for the system drive.
On systems with multiple drives (including removable media), you can change the default location for specific file types. If you have a large music collection, for example, you might prefer to store MP3 files on a disk you dedicate for that purpose. To make that possible, go to Settings > Storage > Advanced Storage Settings > Where New Content Is Saved.
Note
Changing the default location for a file type affects the storage of new items. It does not move current items.
When you set the default save location for these categories to a secondary drive, Windows 11 creates folders on the secondary drive, with subfolders that correspond to the category name for each file type within a folder named after your user account name.
Note that if you are redirecting an item type that is currently stored in a library, Windows expands the library definition to include the new location.
For information about libraries, see “Using libraries” in Chapter 9.
A feature called Storage Sense is designed to free up disk space automatically by deleting files that Windows determines you no longer need. Because this feature has the potential to guess wrong and remove files you really do need, it is turned off by default. To turn Storage Sense on and fine-tune its capabilities, go to Settings > System > Storage and flip the Storage Sense switch to the On position. Then click the Storage Sense pane to open a page like the one shown in Figure 8-13.
Figure 8-13 The Storage Sense option automatically deletes files that Windows determines are unnecessary, based on the preferences you choose here.
Normally, Storage Sense runs only when you’re low on disk space. If you prefer to run a leaner disk operation, change the Run Storage Sense option to one of its alternatives: Every Day, Every Week, or Every Month.
In its default settings, Storage Sense empties the Recycle Bin every 30 days. You can change this value to 1, 14, or 60 days. Alternatively, if you have ample disk space and you would rather preserve the option to recover files from the Recycle Bin for as long as possible, you can set it to Never.
As we can attest from personal experience, the Downloads folder has the potential to swell to gargantuan size if left unchecked. The Delete Files In My Downloads Folder If They Haven’t Been Opened For More Than option allows you to automatically purge those old files to make room for a new batch of downloads.
Storage Sense also offers the option to purge locally available copies of files from OneDrive, OneDrive for Business, and SharePoint accounts. For each such category, you can specify an age for files: from 1 day to 60 days, or Never.
At any time, you can perform ad-hoc deletions of temporary or download files. Scroll to the bottom of the Settings page and click Run Storage Sense Now to carry out the specified deletions.
More options for tidying up are available via the legacy Disk Cleanup utility (Cleanmgr.exe). You can use the search box to locate this tool. Note that this utility initially opens in standard user mode, allowing you to manage files available to your user account but blocking access to system files. To enable the full range of Disk Cleanup options, click Clean Up System Files, entering the credentials for an administrator account if necessary. That restarts the utility and unlocks access to the full range of cleanup options.
Caution
You might be tempted to obsess over disk space usage and use every trick to create as much free space as possible. That strategy might come back to haunt you, however. If you remove previous Windows installations, for example, you lose the ability to roll back to a previous version to recover from compatibility problems. As a general rule, we recommend keeping at least 20 percent of total disk capacity free. That allows enough room to process temporary files properly without affecting performance dramatically. Beyond that baseline, think long and hard before deleting what might be important files.
No matter how well you plan, your approach to deploying storage resources is likely to change over time. The Disk Management tool (Diskmgmt.msc) can help you adjust to changing requirements. You can change a volume label, assign new drive letters, and reformat a secondary volume (but not the system drive). For advanced configurations, you can shrink, extend, and delete volumes and even map a volume so that it appears as a subfolder within a separate volume. We consider these options next.
This section assumes you are working with physical disks that have already been prepared for use with Windows and volumes that already contain data. For details on how to use Disk Management with new physical disks, see “Setting up hard disks and other storage devices” earlier in this chapter.
In Windows 11, as in previous versions of Windows, you can assign a descriptive text label to any volume. Assigning a label is purely optional, but it’s a good practice, especially if you have a multiboot system or if you set up separate volumes to keep your data organized. It’s especially helpful if you have a collection of removable drives (such as USB flash drives) that don’t contain physical labels. You can use Data as the label for your data volume, Music for the volume that holds your collection of digital tunes, and so on.
You can enter a volume label when you format a new volume, or you can do it at any time afterward by right-clicking a volume (in Disk Management or in File Explorer), clicking Properties, and entering text in the edit field near the top of the General tab. The volume label can be no longer than 32 characters.
You can assign one and only one letter to a volume. Windows assigns the drive letter C: to the system drive when you boot to an installed instance of Windows, and changing that assignment is impossible. In addition, you are unable to assign a drive letter to the EFI System Partition, the recovery partition, or the Microsoft Reserved (MSR) partition. For all other volumes, you can change or remove the drive letter at any time.
To change a drive-letter assignment, right-click the volume in Disk Management and then click Change Drive Letter And Paths. (You can do this in either the upper or lower pane.) To replace an existing drive letter, select it and click Change. To assign a drive letter to a volume that currently has none, click Add. Select an available drive letter from the Assign The Following Drive Letter list, and then click OK twice.
If the volume whose drive letter you’re changing is currently in use, you might need to restart Windows to make the change. Until you do so, both the old and new drive letters are available for the volume.
In addition to (or in place of) a drive letter, you can assign a volume so that its contents are mapped to the path for one or more NTFS folders. Assigning a drive path creates a mounted volume (also known as a mounted drive, mounted folder, or volume mount point). A mounted volume appears as a folder within another NTFS-formatted volume that has a drive letter assigned to it. Besides allowing you to sidestep the limitation of 26 drive letters, mounted volumes offer these advantages:
You can extend storage space on an existing volume that’s running low on free space. For instance, if your digital music collection has outgrown your drive C, you can create a subfolder of your Music folder and call it, say, More Music. Then you can add a new physical disk to your system, create a new volume on that disk, and assign a drive path from that new volume to the More Music folder—in effect increasing the size of your original Music folder. The More Music folder in this example appears to be part of the original Music folder but actually resides on the new volume.
You can make commonly used files available in multiple locations. Say you have a collection of boilerplate documents that you store on a secondary drive with the drive letter X. In each user’s Documents folder, you can create an empty subfolder called Boilerplate and assign that folder’s path to volume X. That way, the entire collection is always available from any user’s Documents folder, and no one has to worry about creating shortcuts to X or changing drive letters while they work.
Note that the volume you map to an NTFS folder path does not have to be empty, nor does it have to be formatted using NTFS. If you have a removable drive formatted as exFAT containing existing files, you can map it to an empty NTFS folder on another volume.
To create a mounted volume, follow these steps:
In Disk Management, right-click the volume you want to change (in either the graphical view pane or the volume list pane), and then click Change Drive Letter And Paths.
Click Add to open the Add Drive Letter Or Path dialog.
Select Mount In The Following Empty NTFS Folder. (This is the only option available if the volume already has a drive letter assigned.)
Click Browse. The Browse For Drive Path dialog that appears shows only NTFS volumes, and the OK button is enabled only if you select an empty folder or click New Folder to create one.
Click OK to add the selected location in the Add Drive Letter Or Path dialog, and then click OK to create the drive path.
You can manage files and subfolders within a mounted volume just as though they were stored in a regular folder. In File Explorer, the mounted volume appears within the list of folders, identified by a drive icon with a shortcut arrow. And as Figure 8-14 shows, when you right-click the folder icon and then click Properties, the General tab reveals that the folder is actually a mounted volume and provides more details about the drive to which the folder is mapped.
Figure 8-14 The properties dialog for a mounted volume identifies the folder that appears to hold files that are actually stored on another volume.
Click the Properties button on the General tab to see more details about the drive to which the folder is mapped.
If you use the Dir command in a Command Prompt window to display a folder directory, a mounted volume is identified as <JUNCTION> (for junction point, yet another name for a mounted volume), whereas ordinary folders are identified as <DIR> (for directory, the MS-DOS term for a folder).
Caution
When creating mounted volumes, avoid establishing loops in the structure of a drive—for example, by creating a drive path from drive X that points to a folder on drive D and then creating a drive path on drive D that points to a folder on drive X. Windows allows you to do this, but it’s invariably a bad idea because an application that opens subfolders (such as a search) can go into an endless loop.
To see a list of all the mounted drives on your system, click View > Drive Paths in Disk Management. A dialog like the one shown in Figure 8-15 appears. Note that you can remove a drive path from this dialog; if you do so, the folder remains in the same spot it was previously located, but it reverts to being a regular, empty folder. The files and folders remain in that volume, accessible if you assign a drive letter or a different empty folder to it.
Figure 8-15 This dialog lists all the mounted volumes on a system and shows the drive path and label, if any, of each mounted volume.
Provided space is available, you can shrink an NTFS-formatted volume to make more space available for other volumes. You might want to do this on a very large physical disk, on which you want to segregate different types of data using separate drive letters. Shrinking a volume also comes in handy if you want to create a separate volume so that you can install an alternative operating system (or a second copy of Windows 11) in a dual-boot configuration.
To accomplish this task, open Disk Management, right-click the volume in either the volume list or graphical view pane, and then click Shrink Volume. Disk Management responds by analyzing the disk, and then it reports the amount of shrinkage possible, as shown in Figure 8-16.
Figure 8-16 When working with a system drive, the amount of available space for shrinking a volume is usually less than the total empty space because of unmovable files.
Enter the number of megabytes by which you want to reduce your volume and then click Shrink. Disk Management defragments the disk, moving all its data to a contiguous block, and then performs the shrink.
Be aware that two types of system-managed files—paging files and volume shadow copy files—cannot be moved during the defragmentation process. This means you might not have as much room to shrink as you would like. Microsoft also advises that the amount by which you can shrink a volume is “transient” and depends on what is happening on the volume at the time. In other words, if you’re trying to eliminate, say, 10 GB from the volume and Disk Management can manage only 7, take the 7 and then try for more later.
On a disk that contains a single large volume, there’s no way to increase the size of a volume. But if you have a volume that uses less than the full amount of space on a disk, you might be able to extend that volume. This configuration is unusual and only likely to occur when the disk you’re working with was originally partitioned into multiple volumes and you have deleted one or more volumes—for example, if you previously shrank a volume so that you could install a second copy of Windows 11 in a dual-boot configuration and then removed the added volume.
To accomplish the expansion, right-click the volume you want to expand and then click Extend Volume. Click Next to move past the Extend Volume Wizard’s welcome page. The Select Disks page, shown in Figure 8-17, appears.
Figure 8-17 Use the Extend Volume Wizard to extend a volume into unallocated space on the same disk or another hard disk with free space.
The Selected list, on the right side of this dialog, initially shows the disk whose volume you intend to extend. The Maximum Available Space In MB box shows you how much larger you can make the volume, assuming you want to confine your expansion to the current disk. The Select The Amount Of Space In MB box, initially set to equal the maximum available space, is where you declare the number of megabytes you want to add to the volume, and the Total Volume Size In Megabytes (MB) box shows you how big your volume is about to become.
When you’re ready to continue, click Next, review your orders on the ensuing page, and then click Finish. Note that no separate formatting step is required; the newly expanded volume uses the same formatting options as the original.
To convert a FAT or FAT32 volume to NTFS, use the command-line Convert utility. The essential syntax is
convert d: /fs:ntfs
where d is the drive letter you want to convert. For information about optional parameters, type convert /? at the command prompt.
The Convert utility can do its work within Windows if the volume to be converted is not in use. If you see an error message when you run Convert, you must schedule the conversion to occur the next time you start Windows or use the /X switch to force the volume to be dismounted immediately. After you restart the computer, you see a prompt that warns you that the conversion is about to begin. You have 10 seconds to cancel the conversion. If you allow it to proceed, Windows runs the Chkdsk utility and performs the conversion, restarting automatically.
Note that the Convert utility does not work on volumes formatted using exFAT.
Deleting a volume is easy—and irreversible. All data is lost in the process, so be sure you have backed up or no longer need whatever the volume currently contains. Then right-click the volume and click Delete Volume. The volume reverts to unallocated space, and if it happens to have been the last volume on a dynamic disk, the disk itself is converted to basic.
Formatting a volume results in a root folder that appears to be empty. Because of the way formatting works, however, someone with data-recovery tools might be able to restore deleted files even after you format the volume. If you’re discarding or recycling an old computer or hard disk, you don’t want to risk the possibility of it landing in the hands of someone who might search it for recoverable data that can be used for identity theft or other nefarious purposes.
If your old disk has no salvage value and is headed for the dumpster, the best way to ensure that the data can’t be recovered is to remove the disk and physically destroy it. Using tools as varied as a power saw, drill, torch, or sledgehammer, you can render the disk inoperable. (Be sure you’re wearing safety goggles.) Although this method is effective, it has several disadvantages: It takes time and considerable physical effort, and it has all the usual risks associated with tools. In the case of an otherwise functional piece of hardware, you’re left with a disk that can’t be sold or donated to someone who can use it.
As we discuss earlier, you can use the Format command (with the /P switch) and the Cipher command (with the /W switch) to overwrite everything on a disk, but these tools are impractical for cleaning the system volume.
Another simple solution is to use a third-party disk-wiping tool. A free one that we like is Darik’s Boot And Nuke (DBAN), which you can download from https://dban.org. DBAN is a bootable disk that securely wipes a computer’s hard disks. If you’re worried that DBAN or another utility that is allowed to access your disks might surreptitiously steal your data before destroying it, consider disconnecting your computer from your network before using the program.
If your disk contains highly sensitive material and you want to be absolutely sure its data can’t be recovered, search for a utility that follows the guidelines set out in “NIST Special Publication 800-88: Guidelines for Media Sanitization” (https://bit.ly/nist-800-88). Software that adheres to these guidelines for clearing and sanitizing storage media can defeat even the most sensitive data-recovery tools.
Using Disk Management, you can create a virtual hard disk (VHD) in the same formats used by the Windows 11 Hyper-V Manager program. A VHD file encapsulates all the characteristics of a simple disk volume in a single file. Once you’ve created, initialized, and formatted a VHD file, you can mount the file so that it appears as a disk drive in File Explorer and Disk Management; unlike a physical disk, however, you can back up or move the entire disk by copying the VHD file. This type of file can be a useful alternative to Zip files for archiving and sharing large amounts of information with a detailed folder hierarchy.
For more information about Hyper-V Manager, see “Creating and managing virtual machines with Hyper-V Manager,” in Chapter 17.
To create a virtual hard disk, open Disk Management and click Action, Create VHD. Disk Management responds with the Create And Attach Virtual Hard Disk dialog, as shown in Figure 8-18.
Figure 8-18 You can create a virtual hard disk using either of two formats. The Dynamically Expanding option makes the best use of existing disk space.
Specify a file name with a fully qualified path. It’s easiest to do this with the help of the Browse button, but note that the file cannot be stored in your %SystemRoot% (usually C:\Windows) folder.
You can create a virtual hard disk in either of two file formats. The VHD format supports disks up to 2 TB; these can be used on systems running Windows 7 or later. The VHDX format supports much larger disks, up to 64 TB, but it’s supported only by Windows 10 and Windows 11. VHDX is the default format in Windows 11, and for good reason: It’s more resilient to power failures and is a better choice if you don’t require interoperability with older Windows versions.
If you want the disk to expand in size as you add files to it, select Dynamically Expanding. Otherwise, select Fixed Size. (The Recommended option changes depending on which VHD format you chose.) Either way, you must also specify a size (that’s a maximum size if you select Dynamically Expanding). The minimum size is 3 MB; the maximum is the amount of free space available on your (real) disk. After you finish with the Create And Attach Virtual Hard Disk dialog, Disk Management adds the new virtual disk to its graphical view pane as an unknown, uninitialized disk with unallocated space.
Right-click the area at the left side of this disk, click Initialize Disk, set it up just as if it were a newly attached physical disk, and then follow the procedures described earlier in this chapter to create one or more volumes on the new disk. After you have created a volume, formatted it, and assigned it a drive letter, the disk appears like any other in Disk Management and File Explorer.
To remove a virtual hard disk, right-click the disk-number box at the left side of Disk Management’s graphical view pane, and then click Detach VHD. Disk Management informs you that deleting the disk makes it unavailable until you reattach it. The dialog also reminds you of the location of the file that encapsulated your virtual hard disk.
To reattach a virtual disk, click Action > Attach VHD in Disk Management. Then type or browse to the location of the VHD or VHDX file. (It is identified in File Explorer as Hard Disk Image File.) You can also attach a virtual disk by right-clicking the VHD or VHDX file in File Explorer and choosing Mount.