Managing Existing Partitions and Drives

from Chapter 10, Microsoft Windows 2000 Administrator's Pocket Consultant by William R. Stanek.

Disk Management provides many ways to manage existing partitions and drives. Use these features to assign drive letters, delete partitions, set the active partition, and more. In addition, Windows 2000 provides other utilities to carry out common tasks such as converting a volume to NTFS or checking a drive for errors.

Assigning Drive Letters and Paths

Drives can be assigned one drive letter and one or more drive paths, provided the drive paths are mounted on NTFS drives. Drives don't have to be assigned a drive letter or path. A drive with no designators is considered to be unmounted and can be mounted by assigning a drive letter or path at a later date. You need to unmount a drive before moving it to another computer.

To manage drive letters and paths, right-click the drive you want to configure in Disk Management, and then choose Change Drive Letter And Path. This opens the dialog box shown in Figure 10-9. You can now:

  • Add a drive path Click Add, select Mount In This NTFS Folder, and then type the path to an existing folder or click Browse to search for or create a folder.

    Figure 10-9: Use this dialog box to change the drive letter and path assignment.

    Figure 10-9: Use this dialog box to change the drive letter and path assignment.

  • Remove a drive path Select the drive path to remove, click Remove, and then click Yes.

  • Assign a drive letter Click Add, select Assign A Drive Letter, and then choose an available letter to assign to the drive.

  • Change the drive letter Select the current drive letter, and then click Edit. Select Assign A Drive Letter, and then choose a different letter to assign to the drive.

  • Remove a drive letter Select the current drive letter, click Remove, and then click Yes.

Note: If you try to change the letter of a drive that's in use, Windows 2000 displays a warning. You'll need to exit programs that are using the drive and try again or allow Disk Management to force the change by clicking Yes when prompted.

Changing or Deleting the Volume Label

The volume label is a text descriptor for a drive. Because this label is displayed when the drive is accessed in various Windows 2000 utilities, such as Windows Explorer, you can use the label to help provide information about the contents of a drive. You can change or delete a volume label using Disk Management or Windows 2000 Explorer.

Using Disk Management, you can change or delete a label by doing this:

  1. Right-click the partition, and then choose Properties.

  2. In the General tab of the Properties dialog box, use the Label field to type a new label for the volume or delete the existing label. Click OK.

Using Windows Explorer, you can change or delete a label by doing this:

  1. Right-click the drive icon and then choose Properties.

  2. In the General tab of the Properties dialog box, use the Label field to type a new label for the volume or delete the existing label. Click OK.

Deleting Partitions and Drives

To change the configuration of an existing drive that is fully allocated, you may need to delete existing partitions and logical drives. Deleting a partition or a drive removes the associated file system, and all data in the file system is lost. So before you delete a partition or a drive, you should back up any files and directories the partition or drive contains.

You can delete a primary partition or logical drive by doing this:

  1. In Disk Management, right-click the partition or drive you want to delete, and then choose Delete Partition or Delete Logical Drive, as appropriate.

  2. Confirm that you want to delete the partition by clicking Yes.

  3. If you delete a partition on a physical drive that contains the Windows 2000 operating system, the number of the boot partition may change. If so, you'll need to update the BOOT.INI file as described in the section of this chapter entitled "Updating the Boot Disk." Be sure to note the new partition number to use.

To delete an extended partition, do this:

  1. Delete all the logical drives on the partition following the steps outlined above.

  2. You should now be able to select the extended partition area itself and delete it.

Converting a Volume to NTFS

Windows 2000 provides a utility for converting FAT volumes to NTFS. This utility, called Convert (CONVERT.EXE), is located in the %SystemRoot% folder. When you convert a volume using this tool, the file and directory structure is preserved and no data is lost. Keep in mind, however, that Windows 2000 doesn't provide a utility for converting NTFS to FAT. The only way to go from NTFS to FAT is to delete the partition by following the steps outlined in the previous section and then to recreate the partition as a FAT volume.

The Convert Utility Syntax

Convert is a command-line utility run at the Command prompt. If you want to convert a drive, use the follow syntax:

convert volume /FS:NTFS

where volume is the drive letter followed by a colon, drive path, or volume name. For example, if you wanted to convert the D drive to NTFS, you would use the following command:

convert D: /FS:NTFS

The complete syntax for Convert is shown in Table 10-2.

Table 10-2 Convert Syntax and Usage

Syntax

convert volume /FS:NTFS [/V]

The options and switches for Convert are used as follows:

volume

Sets the volume to work with.

/FS:NTFS

Converts to NTFS.

/V

Sets verbose mode.

Syntax

convert c:\drive1 /FS:NTFS /V

Using the Convert Utility

Before you use the Convert utility, double-check to see if the partition is being used as the active boot partition or a system partition containing the operating system. With Intel x86 systems, you can convert the active boot partition to NTFS. Doing so requires that the system gain exclusive access to this partition, which can only be obtained during startup. Thus, if you try to convert the active boot partition to NTFS, Windows 2000 displays a prompt asking if you want to schedule the drive to be converted the next time the system starts. If you click Yes, you can restart the system to begin the conversion process.

Tip Often it'll take several restarts of a system to completely convert the active boot partition. Don't panic. Let the system proceed with the conversion.

RISC-based systems are hardware configured and don't use an active boot partition. RISC computers, however, do use a system partition that contains the necessary files for the operating system. This partition must be a FAT file system, so you shouldn't convert the system partition to NTFS on RISC-based computers.

Before the Convert utility actually converts a drive to NTFS, the utility checks to see if the drive has enough free space to perform the conversion. Generally, Convert needs a block of free space that is roughly equal to 25 percent of the total space used on the drive. For example, if the drive stores 100 MB of data, Convert needs about 25 MB of free space. If there isn't enough free space, Convert aborts and tells you that you need to free up some space. On the other hand, if there is enough free space, Convert initiates the conversion. Be patient. The conversion process takes several minutes (longer for large drives). Don't access files or applications on the drive while the conversion is in progress.

Checking a Drive for Errors and Bad Sectors

The Windows 2000 utility for checking the integrity of a disk is Check Disk (CHKDSK.EXE). You'll find this utility in the %SystemRoot% folder. Use Check Disk to check for and optionally repair problems found on FAT, FAT32, and NTFS volumes.

While Check Disk can check for and correct many types of errors, the utility primarily looks for inconsistencies in the file system and its related metadata. One of the ways Check Disk locates errors is by comparing the volume bitmap to the disk sectors assigned to files in the file system. But beyond this, the usefulness of Check Disk is rather limited. For example, Check Disk can't repair corrupted data within files that appear to be structurally intact.

Running Check Disk from the Command Line

You can run Check Disk from the command line or within other utilities. At the Command prompt you can test the integrity of the E drive by typing the command

chkdsk E:

To find and repair errors that are found in the E drive, use the command

chkdsk /f E:

Note: Check Disk can't repair volumes that are in use. If the volume is in use, Check Disk displays a prompt that asks if you want to schedule the volume to be checked the next time you restart the system. Answer Yes to the prompt to schedule this.

The complete syntax for Check Disk is shown as Table 10-3.

Table 10-3 Check Disk Syntax and Usage

Syntax

chkdsk [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]	 

The options and switches for Check Disk are used as follows:

volume

Sets the volume to work with.

filename

FAT only: Specifies files to check for fragmentation.

/F

Fixes errors on the disk.

/V

On FAT/FAT32: Displays the full path and name of every file on the disk.

 

On NTFS: Displays cleanup messages, if any.

/R

Locates bad sectors and recovers readable information (implies /F).

/L:size

NTFS only: Changes the log file size.

/X

Forces the volume to dismount first if necessary (implies /F).

Syntax

 

/I

NTFS only: Performs a minimum check of index entries.

/C

NTFS only: Skips checking of cycles within the folder structure.

Running Check Disk Interactively

You can also run Check Disk interactively by using either Windows Explorer or Disk Management.

Using Disk Management, access Check Disk by doing the following:

  1. Right-click the drive, and then choose Properties.

  2. In the Tools tab of the Properties dialog box, click Check Now.

Using Windows 2000 Explorer, access Check Disk by doing the following:

  1. Right-click the drive, and then choose Properties.

  2. In the Tools tab of the Properties dialog box, click Check Now.

Figure 10-10 shows the dialog box for the interactive version of Check Disk. Use this dialog box to check a disk for errors and then to repair them if you like.

  • To check for errors without repairing them, click Start without selecting either of the check boxes.

  • To check for errors and fix them, make the appropriate selections in the check boxes to fix file system errors or to recover bad sectors, or both.

Defragmenting Disks

Anytime you add files to or remove files from a drive, the data on the drive can become fragmented. When a drive is fragmented, large files can't be written to a single continuous area on the disk. As a result, the operating system must write the file to several smaller areas on the disk, which means more time is spent reading the file from the disk. To reduce fragmentation, you should periodically analyze and defragment disks using Disk Defragmenter.

Figure 10-10: Check Disk is available by clicking the Check Now button on the Properties dialog box. Use it to check a disk for errors and repair them, if you wish.

Figure 10-10: Check Disk is available by clicking the Check Now button on the Properties dialog box. Use it to check a disk for errors and repair them, if you wish.

You can analyze a disk to determine the level of fragmentation and defragment a disk by completing the following steps:

  1. In Computer Management, expand Storage, and then select Disk Defragmenter.

  2. Select the logical drive or volume that you want to work with by clicking it, as shown in Figure 10-11.

  3. To analyze the amount of fragmentation on a partition or volume, click Analyze. The progress of the analysis is shown in the Analysis Display area. Fragmented files, contiguous files, system files, and free space are highlighted in different colors using the color code shown at the bottom of the display area. You can pause or stop the analysis if necessary.

  4. When the analysis is complete, Disk Defragmenter recommends a course of action based on the amount of fragmentation. If there is a lot of fragmentation, you'll be prompted to defragment the disk. Otherwise you'll be told the disk doesn't need to be defragmented.

  5. To defragment the disk, click Defragment. The progress of the defragment operation is shown in the Defragmentation Display area. You can pause or stop the operation, if necessary.

  6. To view a report of the analysis or defragmentation, click View Report.

    Figure 10-11: Disk Defragmenter analyzes and defragments disks efficiently. The more frequently data is updated on drives, the more often you'll need to run this utility.

    Figure 10-11: Disk Defragmenter analyzes and defragments disks efficiently. The more frequently data is updated on drives, the more often you'll need to run this utility.

Compressing Drives and Data

When you format a drive for NTFS, Windows 2000 allows you to turn on the built-in compression feature. With built-in compression, all files and directories stored on a drive are automatically compressed when they're created. Because this compression is transparent to users, compressed data can be accessed just like regular data. The difference is that you can store more information on a compressed drive than you can on an uncompressed drive.

Compressing Directories and Files

If you decide not to compress a drive, Windows 2000 lets you selectively compress directories and files. To compress a file or directory, complete these steps:

  1. Right-click the file or directory that you want to compress, and then select Properties.

  2. In the General tab of the related property dialog box, click Advanced. Select Compress Contents To Save Disk Space, shown in Figure 10-12. Click OK twice.

For an individual file, Windows 2000 marks the file as compressed and then compresses it. For a directory, Windows 2000 marks the directory as compressed and then compresses all the files in it. If the directory contains subfolders, Windows 2000 displays a dialog box that allows you to compress all the subfolders associated with the directory. Simply select Apply Changes To This Folder, Subfolders, And Files and then click OK. Once you compress a directory, any new files added or copied to the directory are compressed automatically.

Note: If you move an uncompressed file from a different drive, it's compressed. However, if you move an uncompressed file to a compressed folder on the same NTFS drive, the file isn't compressed. Note also that you can't encrypt compressed files.

Figure 10-12: With NTFS, you can compress a file or directory by selecting the Compress check box in the Advanced Attributes dialog box.

Figure 10-12: With NTFS, you can compress a file or directory by selecting the Compress check box in the Advanced Attributes dialog box.

Expanding Compressed Directories and Files

If you decide later that you want to expand a compressed file or directory, reverse the process by completing the following steps:

  1. Right-click the file or directory in Windows Explorer.

  2. In the General tab of the related property dialog box, click Advanced. Clear the Compress Contents To Save Disk Space check box. Click OK twice.

With files, Windows 2000 removes compression and expands the file. With directories, Windows 2000 expands all the files within the directory. If the directory contains subfolders, you'll also have the opportunity to remove compression from the subfolders. To do this, select Apply Changes To This Folder, Subfolders, And Files when prompted and then click OK.

Tip Windows 2000 also provides command-line utilities for compressing and decompressing your data. The compression utility is called Compact (COMPACT.EXE). The decompression utility is called Expand (EXPAND.EXE).

Encrypting Drives and Data

Windows 2000 supports file encryption of data on NTFS volumes. Encryption allows users to store data in encrypted format. Files in encrypted format can only be read by the person who encrypted the file. Before other users can read an encrypted file, the file must be decrypted by the user. Otherwise, encrypted files can be copied, moved, and renamed just like any other file—and these actions don't affect the encryption of the data.

The process that handles encryption and decryption is called the Encrypting File System (EFS). The default setup for EFS allows users to encrypt files without needing special permission. Files are encrypted using a public/private key that is automatically generated by EFS on a per user basis.

Tip The encryption algorithm used is the expanded Data Encryption Standard (DESX), which is enforced using 56-bit encryption by default. For stricter security, North American users can order the Enhanced CryptoPAK from Microsoft. The Enhanced CryptoPAK provides 128-bit encryption. Files that use 128-bit encryption can only be used on a system that supports 128-bit encryption. Administrators designated as Recovery Agents can decrypt files, if necessary.

Encrypting Directories and Files

With NTFS volumes, Windows 2000 lets you select files and folders for encryption. When you encrypt files, the file data is converted to an encrypted format that can only be read by the person who encrypted the file. Users can only encrypt files if they have the proper access permissions. When you encrypt folders, the folder is marked as encrypted, but actually only the files within it are encrypted. All files that are created in or added to a folder marked as encrypted are encrypted automatically.

To encrypt a file or directory, complete the following steps:

  1. Right-click the file or directory that you want to encrypt, and then select Properties.

  2. In the General tab of the related property dialog box, click Advanced. Then select Encrypt Contents To Secure Data. Click OK twice.

Note: You can't encrypt compressed files, system files, or read-only files. If you try to encrypt compressed files, the files are automatically uncompressed and then encrypted. If you try to encrypt system files, you'll get an error.

For an individual file, Windows 2000 marks the file as encrypted and then encrypts it. For a directory, Windows 2000 marks the directory as encrypted and then encrypts all the files in it. If the directory contains subfolders, Windows 2000 displays a dialog box that allows you to encrypt all the subfolders associated with the directory. Simply select Apply Changes To This Folder, Subfolders, And Files and then click OK.

Note: On NTFS volumes, files remain encrypted even when they're moved, copied, and renamed. If you copy or move an encrypted file to a FAT or FAT32 drive, the file is automatically decrypted before being copied or moved. Thus, you must have proper permissions to copy or move the file.

Decrypting Files and Directories

If you decide later that you want to decrypt a file or directory, reverse the process by completing the following steps:

  1. Right-click the file or directory in Windows Explorer.

  2. In the General tab of the related property dialog box, click Advanced. Clear Encrypt Contents To Secure Data. Click OK twice.

With files, Windows 2000 decrypts the file and restores it to its original format. With directories, Windows 2000 decrypts all the files within the directory. If the directory contains subfolders, you'll also have the opportunity to remove encryption from the subfolders. To do this, select Apply Changes To This Folder, Subfolders, And Files when prompted and then click OK.

Tip Windows 2000 also provides a command-line utility for encrypting and decrypting your data. This utility is called Cipher (CIPHER.EXE). Typing CIPHER at the command line by itself shows you the encryption status of all folders in the current directory.

from Microsoft Windows 2000 Administrator's Pocket Consultant by William R. Stanek. Copyright © 1999 Microsoft Corporation.

Link
Click to order