Windows Server 2008 Inside Out- P12

Chia sẻ: Thanh Cong | Ngày: | Loại File: PDF | Số trang:50

0
50
lượt xem
12
download

Windows Server 2008 Inside Out- P12

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Tham khảo tài liệu 'windows server 2008 inside out- p12', công nghệ thông tin, quản trị mạng phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả

Chủ đề:
Lưu

Nội dung Text: Windows Server 2008 Inside Out- P12

  1. Advanced NTFS Features 517 If you are trying to determine whether a file is used by FRS or the DLT Client service, you could use the FSUtil ObjectID command to see if the file has an object identifier field set. Type fsutil objectid query FilePath at the command prompt, where FilePath is the path to the file or folder you want to examine. If the file has an object identifier field set, it is displayed. If a fi le doesn’t have an object identifier field set, an error message is displayed stating “The specified file has no object ID.” Reparse Points On NTFS volumes, a file or folder can contain a reparse point. Reparse points are file system objects with special attribute tags that are used to extend the functionality in the I/O subsystem. When a program sets a reparse point, it stores an attribute tag as well as a data segment. The attribute tag identifies the purpose of the reparse point and details how the reparse point is to be used. The data segment provides any additional data needed during reparsing. Reparse points are used for directory junction points and volume mount points. Direc- tory junctions enable you to create a single local namespace using local folders, local volumes, and network shares. Mount points enable you to mount a local volume to an empty NTFS folder. Both directory junction points and volume mount points use reparse points to mark NTFS folders with surrogate names. When a file or folder containing a reparse point used for a directory junction point or a volume mount point is read, the reparse point causes the pathname to be reparsed and a surrogate name to be substituted for the original name. For example, if you were to create a mount point with the file path C:\Data that is used to mount a hard disk drive, the reparse point is triggered whenever the file system opens C:\Data and points the fi le Chapter 16 system to the volume you’ve mounted in that folder. The actual attribute tag and data for the reparse point would look similar to the following: Reparse Tag Value : 0xa0000003 Tag value: Microsoft Tag value: Name Surrogate Tag value: Mount Point Substitute Name offset: 0 Substitute Name length: 98 Print Name offset: 100 Print Name Length: 0 Substitute Name: \??\Volume{3796c3c1-5106-11d7-911c-806d6172696f}\ Reparse Data Length: 0x0000006e Reparse Data: 0000: 00 00 62 00 64 00 00 00 5c 00 3f 00 3f 00 5c 00 ..b.d...\.?.?.\. 0010: 56 00 6f 00 6c 00 75 00 6d 00 65 00 7b 00 33 00 V.o.l.u.m.e.{.3. 0020: 37 00 39 00 36 00 63 00 33 00 63 00 31 00 2d 00 7.9.6.c.3.c.1.-. 0030: 35 00 31 00 30 00 36 00 2d 00 31 00 31 00 64 00 5.1.0.6.-.1.1.d. 0040: 37 00 2d 00 39 00 31 00 31 00 63 00 2d 00 38 00 7.-.9.1.1.c.-.8. 0050: 30 00 36 00 64 00 36 00 31 00 37 00 32 00 36 00 0.6.d.6.1.7.2.6. 0060: 39 00 36 00 66 00 7d 00 5c 00 00 00 00 00 9.6.f.}.\.....
  2. 518 Chapter 16 Managing Windows Server 2008 File Systems The reparse attribute tag is defined by the first series of values, which identifies the reparse point as a Microsoft Name Surrogate Mount Point and specifies the surrogate name to be substituted for the original name. The reparse data follows the attribute tag values and in this case provides the fully expressed surrogate name. Examine Reparse Points Using the FSUtil ReparsePoint command, you can examine reparse information associ- ated with a file or folder. Type fsutil reparsepoint query FilePath at the command prompt, where FilePath is the path to the file or folder you want to examine. Reparse points are also used by file system filter drivers to mark files so they are used with that driver. When NTFS opens a file associated with a file system filter driver, it locates the driver and uses the filter to process the file as directed by the reparse infor- mation. Reparse points are used in this way to implement Remote Storage. Sparse Files Often scientific or other data collected through sampling is stored in large fi les that are primarily empty except for sparsely populated sections that contain the actual data. For example, a broad-spectrum signal recorded digitally from space might have only sev- eral minutes of audio for each hour of actual recording. In this case, a multiple-gigabyte audio file such as the one depicted in Figure 16-5 might have only a few gigabytes of Chapter 16 meaningful information. Because there are large sections of empty space and limited areas of meaningful data, the file is said to be sparsely populated and can also be referred to as a sparse file. Stored normally, the fi le would use 20 GB of space on the volume. If you mark the file as sparse, however, NTFS allocates space only for actual data and marks empty space as nonallocated. In other words, any meaningful or nonzero data is marked as allocated and written to disk, and any data composed of zeros is marked as nonallocated and is not explicitly written to disk. In this example, this means the file uses only 5 GB of space, which is marked as allocated, and has nonallocated space of 15 GB. For nonallocated space, NTFS records only information about how much nonallocated space there is, and when you try to read data in this space, it returns zeros. This allows NTFS to store the fi le in the smallest amount of disk space possible while still being able to reconstruct the file’s allocated and nonallocated space. In theory, all this works great, but it is up to the actual program working with the sparse file to determine which data is meaningful and which isn’t. Programs do this by explicitly specifying the data for which space should be allocated. In Windows Server 2008, several services use sparse files. One of these is the Indexing Service, which stores its catalogs as sparse fi les.
  3. Advanced NTFS Features 519 Unused Space 20 GB Data File Used Space Unused Space 15 GB Actual Space Used by Data 5 GB Size of Sparse File on Disk 5 GB Figure 16-5 Using sparse files. Using the FSUtil Sparse command, you can easily determine whether a file has the sparse attribute set. Type fsutil sparse queryflag FilePath at the command prompt, Chapter 16 where FilePath is the path to the file you want to examine, such as fsutil sparse queryflag c:\data\catalog.wci\00010002.ci If the file has the sparse attribute, this command returns This file is set as sparse You can examine sparse files to determine where the byte ranges that contain meaning- ful (nonzero) data are located by using FSUtil Sparse as well. Type fsutil sparse query- range FilePath at the command prompt, where FilePath is the path to the file you want to examine, such as fsutil sparse queryrange c:\data\catalog.wci\00010002.ci The output is the byte ranges of meaningful data within the file, such as sparse range [0] [28672] In this particular case, the output specifies that there’s meaningful data at the start of the file to byte 28672. You can mark files as sparse as well. Type fsutil sparse setflag FilePath at the command prompt, where FilePath is the path to the file you want to mark as sparse.
  4. 520 Chapter 16 Managing Windows Server 2008 File Systems Transactional NTFS Windows Server 2008 supports transactional NTFS and Self-Healing NTFS. Transac- tional NTFS allows file operations on an NTFS volume to be performed transactionally. This means programs can use a transaction to group together sets of fi le and Registry operations so that all of them succeed or none of them succeed. While a transaction is active, changes are not visible outside of the transaction. Changes are committed and written fully to disk only when a transaction is completed successfully. If a transaction fails or is incomplete, the program rolls back the transactional work to restore the file system to the state it was in prior to the transaction. Transactions that span multiple volumes are coordinated by the Kernel Transaction Manager (KTM). The KTM supports independent recovery of volumes if a transaction fails. The local resource manager for a volume maintains a separate transaction log and is responsible for maintaining threads for transactions separate from threads that per- form the file work. Using the FSUtil Transaction command, you can easily determine transactional infor- mation. You can list currently running transactions by typing fsutil transaction list at the command prompt. You can display transactional information for a specific file by typing fsutil transaction fileinfo FilePath at the command prompt, where FilePath is the path to the file you want to examine, such as fsutil transaction fileinfo c:\journal\ls-dts.mdb Traditionally, you have had to use the Check Disk tool to fi x errors and inconsisten- cies in NTFS volumes on a disk. Because this process can disrupt the availability of Windows systems, Windows Server 2008 uses Self-Healing NTFS to protect file Chapter 16 systems without having to use separate maintenance tools to fi x problems. Because much of the self-healing process is enabled and performed automatically, you might need to manually perform volume maintenance only when you are notified by the operating system that a problem cannot be corrected automatically. If such an error occurs, Windows Server 2008 will notify you about the problem and provide possible solutions. Self-Healing NTFS has many advantages over Check Disk, including the following: Check Disk must have exclusive access to volumes, which means system and boot volumes can be checked only when the operating system starts up. On the other hand, with Self-Healing NTFS, the file system is always available and does not need to be corrected offline (in most cases). Self-Healing NTFS attempts to preserve as much data as possible if corruption occurs and reduces failed file system mounting that previously could occur if a volume was known to have errors or inconsistencies. During restart, Self-Healing NTFS repairs the volume immediately so that it can be mounted. Self-Healing NTFS reports changes made to the volume during repair through existing Chkdsk.exe mechanisms, directory notifications, and update sequence number (USN) journal entries. This feature also allows authorized users and
  5. Using File-Based Compression 521 administrators to monitor repair operations through Verification, Waiting For Repair Completion, and Progress Status messages. Self-Healing NTFS can recover a volume if the boot sector is readable but does not identify an NTFS volume. In this case, you must run an offl ine tool that repairs the boot sector and then allow Self-Healing NTFS to initiate recovery. Although Self-Healing NTFS is a terrific enhancement, at times you might want to (or might have to) manually check the integrity of a disk. In these cases, you can use Check Disk (Chkdsk.exe) to check for and, optionally, repair problems found on FAT, FAT32, and NTFS volumes. Using File-Based Compression File-based compression allows you to reduce the number of bits and bytes in files so that they use less space on a disk. The Windows operating system supports two types of compression: NTFS compression, which is a built-in feature of NTFS, and com- pressed (zipped) folders, which is an additional feature of Windows available on both FAT and NTFS volumes. NTFS Compression Windows allows you to enable compression when you format a volume using NTFS. When a drive is compressed, all files and folders stored on the drive are automatically compressed when they are created. This compression is transparent to users, who can open and work with compressed fi les and folders just as they do with regular files and Chapter 16 folders. Behind the scenes, Windows decompresses the file or folder when it is opened and compresses it again when it is closed. Although this can decrease a computer’s performance, it saves space on the disk because compressed files and folders use less space. You can turn on compression after formatting volumes as well, or if desired turn on compression only for specific files and folders. After you compress a folder, any new files added or copied to the folder are compressed automatically and they remain com- pressed even if you later move them to an uncompressed folder on an NTFS volume. Moving uncompressed files to compressed folders affects their compression attribute as well. If you move an uncompressed fi le from a different drive to a compressed drive or folder, the file is compressed. However, if you move an uncompressed fi le to a com- pressed folder on the same NTFS drive, the fi le isn’t compressed. Finally, if you move a compressed fi le to a FAT16 or FAT32 volume, the file is uncompressed because FAT16 and FAT32 volumes do not support compression. To compress or uncompress a drive, follow these steps: 1. Right-click the drive that you want to compress or uncompress in Windows Explorer or in the Disk Management Volume List view, and then select Properties. This displays the disk’s Properties dialog box, as shown in Figure 16-6.
  6. 522 Chapter 16 Managing Windows Server 2008 File Systems Figure 16-6 You can compress entire volumes or perform selective compression for specific files and folders. 2. Select or clear the Compress This Drive To Save Disk Space check box as appropriate. When you click OK, the Confi rm Attribute Changes dialog box shown in Figure 16-7 is displayed. Chapter 16 Figure 16-7 Choose a compression option. 3. If you want to apply changes only to the root folder of the disk, select Apply Changes To X Only. Otherwise, accept the default, which will compress the entire contents of the disk. Click OK. CAUTION ! Although Windows Server 2008 will let you compress system volumes, this is not recom- mended because the operating system will need to decompress and compress system files each time they are opened, which can seriously impact server performance. Addi- tionally, you can’t use compression and encryption together. You can use one feature or the other, but not both.
  7. Using File-Based Compression 523 You can selectively compress and uncompress files and folders as well. The advantage here is that this affects only a part of a disk, such as a folder and its subfolders, rather than the entire disk. To compress or uncompress a fi le or folder, follow these steps: 1. In Windows Explorer, right-click the file or folder that you want to compress or uncompress, and then select Properties. 2. On the General tab of the related Properties dialog box, click Advanced. This displays the Advanced Attributes dialog box shown in Figure 16-8. Select or clear the Compress Contents To Save Disk Space check box as appropriate. Click OK twice. Figure 16-8 Use the Advanced Attributes dialog box to compress the file or folder. Chapter 16 3. If you are changing the compression attributes of a folder with subfolders, the Confirm Attribute Changes dialog box is displayed. If you want to apply the changes only to the files in the folder and not files in subfolders of the folder, select Apply Changes To X Only. Otherwise, accept the default, which will apply the changes to the folder, its subfolders, and files. Click OK. Windows Server 2008 also provides command-line utilities for compressing and uncompressing your data. The compression utility is called Compact (Compact.exe). The decompression utility is called Expand (Expand.exe). You can use Compact to quickly determine whether files in a directory are compressed. At the command line, change to the directory you want to examine and enter compact without any additional parameters. If you want to check the directory and all subdirec- tories, enter compact /s. The output will list the compression status and compression ratio on every file and the final summary details will tell you exactly how many fi les and directories were examined and found to be compressed, such as: Of 15435 files within 822 directories 0 are compressed and 15435 are not compressed. 2,411,539,448 total bytes of data are stored in 2,411,539,448 bytes. The compression ratio is 1.0 to 1.
  8. 524 Chapter 16 Managing Windows Server 2008 File Systems Compressed (Zipped) Folders Compressed (zipped) folders are another option for compressing files and folders. When you compress data using this technique, you use Zip compression technology to reduce the number of bits and bytes in files and folders so that they use less space on a disk. Compressed (zipped) folders are identified with a zipper on the folder icon and are saved with the .zip file extension. Note At the time of this writing, compressed (zipped) folders were not available on 64-bit edi- tions of Windows Server 2008. Further, if you install a Zip utility, the compressed folder icon for this utility might be used and some of the built-in compressed (zipped) folder features can change. Compressed (zipped) folders have several advantages over NTFS compression. Because Zip technology is an extension of the operating system rather than the file system, com- pressed (zipped) folders can be used on both FAT and NTFS volumes. Zipped folders can be password protected to safeguard their contents and can be sent by e-mail. They can also be transferred using File Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), or other protocols. An added benefit of zipped folders is that some programs can be run directly from compressed folders without having to be decompressed. You can also open files directly from zipped folders. Chapter 16 You can create a zipped folder by selecting a file, folder, or a group of files and folders in Windows Explorer, right-clicking, pointing to Send To, and clicking Compressed (Zipped) Folder. The zipped folder is named automatically by using the fi le name of the last item selected and adding the .zip extension. If you double-click a zipped folder in Windows Explorer, you can access and work with its contents. As shown in Figure 16-9, the zipped folder’s contents are listed according to file name, type, and date. The fi le information also shows the packed file size, the original file size, and the compression ratio. Double-clicking a program in a zipped folder runs it (as long as it doesn’t require access to other files). Double-clicking a file in a zipped folder opens it for viewing or editing. Figure 16-9 Compressed (zipped) folders can be accessed and used like other folders.
  9. Managing Disk Quotas 525 While you’re working with a zipped folder, you can perform tasks similar to those you can with regular folders. You can do the following: Add other files, programs, or folders to the zipped folder by dragging them to it. Copy a file in the zipped folder and paste it into a different folder. Remove a fi le from the zipped folder using the Cut command so that you can paste it into a different folder. Delete a file or folder by selecting it and clicking Delete. You also have the option to perform additional tasks, which are unique to zipped fold- ers. You can choose File, Extract All to start the Extraction Wizard, which can be used to extract all the files in the zipped folder and copy them to a new location. You can click File, Add A Password to add a password to the zipped folder to control access to it. Managing Disk Quotas Even with the large disk drives available today, you’ll often find that hard disk space is at a premium, and this is where disk quotas come in handy. Disk quotas are a built-in feature of NTFS that help you manage and limit disk space usage. How Quota Management Works Using disk quotas, you can monitor and control the amount of disk space people who access the network can use. Without quota management it is hard to monitor the Chapter 16 amount of space being used by individual users and even harder to control the total amount of space they can use. I refer to monitoring and controlling separately because there’s a very important difference between monitoring disk space usage and control- ling it—and the disk quota system allows you to perform these tasks separately or together. You can, in fact, do the following: Configure the disk quota system to monitor disk space usage only, allowing administrators to check disk space usage manually Configure the disk quota system to monitor disk space usage and generate warn- ings when users exceed predefi ned usage levels Configure the disk quota system to monitor disk space usage, generate warnings when users exceed predefi ned usage levels, and enforce the limits by denying disk space to users who exceed the quota limit Your organization’s culture will probably play a major role in the disk quota technique you use. In some organizations the culture is such that it is acceptable to monitor space usage and periodically notify users that they are over recommended limits, but it wouldn’t be well received if administrators enforced controls that limited disk space usage to specific amounts. In other organizations, especially larger organizations where there might be hundreds or thousands of employees on the network, it can make sense
  10. 526 Chapter 16 Managing Windows Server 2008 File Systems to have some controls in place and users might be more understanding of specific controls. Controls at some point become a matter of necessity to help ensure that the administrative staff can keep up with the disk space needs of the organization. Disk quotas are configured on a per-volume basis. When you enable disk quotas, all users who store data on a volume will be affected by the quota. You can set exceptions for individual users as well that either set new limits or remove the limits altogether. As users create files and folders on a volume, an ownership flag is applied that says that this particular user owns the fi le or folder. Thus, if a user creates a file or folder on a volume that user is the owner of, the fi le or folder and the space used counts toward the user’s quota limit. However, because each volume is managed separately, there is no way to set a specific limit for all volumes on a server or across the enterprise. Note For NTFS compressed files and sparse files, the space usage reported can reflect total space of files rather than the actual space the files use. This happens because the quota system reads the total space used by the file rather than its reduced file size. Ownership of files and folders can change in several scenarios. If a user creates a copy of a file owned by someone else, the copy is owned by that user. This occurs because a file is created when the copy is made. File and folder ownership can also change when files are restored from backup. This can happen if you restore the fi les to a volume other than the one the files were created on and copy the fi les over to the original volume. Chapter 16 Here, during the copy operation, the administrator becomes the owner of the files. A workaround for this is to restore fi les and folders to a different location on the same volume and then move the fi les and folders rather than copying them. When you move files and folders from one location to another on the same volume, the original owner- ship information is retained. Administrators can be assigned as the owners of files in other ways as well, such as when they install the operating system or application software. To ensure that admin- istrators can always install programs, restore data, and perform other administrative tasks, members of the Administrators group don’t have a quota limit as a general rule. This is true even when you enforce disk quotas for all users. In fact, for the Administra- tors group, the only type of quota you can set is a warning level that warns administra- tors when they’ve used more than a set amount of space on a volume. When you think about it, this makes a lot of sense—you don’t want to get into a situation where adminis- trators can’t recover the system because of space limitations. That said, you can apply quotas to individual users—even those who are members of the Administrators group. You do this by creating a separate quota entry for each user. The only account that cannot be restricted in this way is the built-in Administrator account. If you try to set a limit on the Administrator account, the limit is not applied.
  11. Managing Disk Quotas 527 Finally, it is important to note that all space used on a volume counts toward the disk quota—even space used in the Recycle Bin. Thus, if a user who is over the limit deletes files to get under the limit, the disk quota might still give warnings or if quotas are enforced, the user still might not be able to write files to the volume. To resolve this issue, the user would need to delete files and then empty the Recycle Bin. Configuring Disk Quotas By default, disk quotas are disabled. If you want to use disk quotas, you must enable quota management for each volume on which you want to use disk quotas. You can enable disk quotas on any NTFS volume that has a drive letter or a mount point. Before you configure disk quotas, think carefully about the limit and warning level. Set values that make the most sense given the number of users who store data on the volume and the size of the volume. For optimal performance of the volume, you won’t want to get in a situation where all or nearly all of the disk space is allocated. For optimal user happi- ness, you want to ensure that the warning and limit levels are adequate so the average user can store the necessary data to perform job duties. Quota limits and warning lev- els aren’t one size fits all either. Engineers and graphic designers can have very different space needs than a typical user. In the best situations you’ll have configured network shares so that different groups of users have access to different volumes, and these vol- umes should be sized to meet the typical requirements of a particular group. In some organizations, I’ve seen administrators set very low quota limits and warning levels on data shares. The idea behind this was that the administrators wanted users to save most of their data on their workstations and only put files that needed to be shared on the data shares. I would discourage this for two reasons. Low quota limits and warning levels frustrate users—you don’t want frustrated users; you want happy users. Chapter 16 Second, you should be encouraging users to store more of their important fi les on cen- tral file servers, not less. Central file servers should be a part of regular enterprise-wide backup routines because corporate servers and backing up data safeguards it from loss. In addition, with the Volume Shadow Copy service, shadow copies of fi les on shared folders can be created automatically, allowing users to perform point-in-time file recov- ery without needing help from administrators. To enable disk quotas on an NTFS volume, follow these steps: 1. In Computer Management, expand Storage, and then select Disk Management. In the details pane, right-click the volume on which you want to enable quotas, and then select Properties. 2. Click the Quota tab, and then select the Enable Quota Management check box as shown in Figure 16-10.
  12. 528 Chapter 16 Managing Windows Server 2008 File Systems Figure 16-10 Enable quota management on the volume, and then configure the disk quota settings. 3. Define a default disk quota limit for all users by selecting Limit Disk Space To and then using the fields provided to set a limit in KB, MB, GB, TB, PB, or EB. Afterward, use the Set Warning Level To field to set the default warning limit. In most cases, you’ll want the disk quota warning limit to be 90 to 95 percent of the disk quota limit. This should give good separation between when warnings occur and when the limit is reached. Chapter 16 4. To prevent users from going over the disk quota limit, select the Deny Disk Space To Users Exceeding Quota Limit check box. This sets a physical limitation for users that will prevent them from writing to the volume after the limit is reached. 5. NTFS sends warnings to users when they reach a warning level or limit. To ensure that you have a record of these warnings, you can configure quota logging options. Select the Log Event check boxes as appropriate. 6. Click OK. If the quota system isn’t currently enabled, you’ll see a prompt asking you to enable the quota system. Click OK to allow Windows Server 2008 to rescan the volume and update the disk usage statistics. Keep in mind that actions might be taken against users who exceed the current limit or warning levels, which can include preventing additional writing to the volume, notifying users the next time they try to access the volume that they’ve exceeded a warning level or have reached a limit, and logging applicable events in the application log.
  13. Managing Disk Quotas 529 Customizing Quota Entries for Individual Users After you enable disk quotas, the configuration is set for and applies to all users who store data on the volume. The only exception, as noted previously, is for members of the Administrators group. The default disk quotas don’t apply to these users. If you want to set a specific quota limit or warning level for an administrator, you can do this by creat- ing a custom quota entry for that particular user account. You can also create custom quota entries for users who have special needs, requirements, or limitations. To view and work with quota entries, access Disk Management, right-click the volume on which you enabled quotas, and then select Properties. In the Properties dialog box for the disk, click the Quota tab, and then click Quota Entries. You’ll then see a list of quota entries for everyone who has ever stored data on the volume, as shown in Figure 16-11. The entries show the following information: Status The status of the disk entries. Normal status is OK. If a user has reached a warning level, the status is Warning. If a user is at or above the quota limit, the status is Above Limit. Name The display name of the user account. Logon Name The logon name and domain (if applicable). Amount Used The amount of disk space used by the user. Quota Limit The quota limit set for the user. Warning Level The warning level set for the user. Percent Used The percentage of disk space used toward the limit. Chapter 16 Figure 16-11 Any existing quota entries are shown. Quota entries get on the list in one of two ways: either automatically if a user has ever stored data on the volume or by an administrator creating a custom entry for a user. You can customize any of these entries—even the ones automatically created—by double- clicking them, which displays the Quota Settings For dialog box shown in Figure 16-12, and selecting the appropriate options either to remove the disk quota limits or set new ones.
  14. 530 Chapter 16 Managing Windows Server 2008 File Systems Figure 16-12 You can customize quota entries for individual users as necessary. Note You can’t create quota entries for groups. The only group entry that is allowed is the one for the Administrators account, which is created automatically. Chapter 16 If a user doesn’t have an entry in the Quota Entries For dialog box, it means that user has not yet saved files to the volume. You can still create a custom entry for the user if you want. To do this, choose Quota, New Quota Entry. This displays the Select Users dialog box shown in Figure 16-13. Use this dialog box to help you fi nd the user account you want to work with. Type the name of the user account or part of the name, and click Check Names. If multiple names match the value you entered, you’ll see a list of names and will be able to choose the one you want to use. Otherwise, the name will be filled in for you, and you can click OK to display the Add New Quota Entry dialog box, which has the same options as the Quota Settings For dialog box shown in Figure 16-12. Use Locations to Access User Accounts from Other Domains By default, the Select Users dialog box is set to work with users from your logon domain. If you want to add a user account from another domain, click Locations to display the Locations dialog box. Then either select the entire directory or the specific domain in which the account is located, and click OK.
  15. Managing Disk Quotas 531 Figure 16-13 Type the name of the user account or part of the name, and click Check Names. In the Quota Entries dialog box, there are a couple of tricks you can use to add or manage multiple quota entries at once. If you want to add identical quota entries for multiple users, you can do this by choosing Quota, New Quota Entry. This displays the Select Users dialog box. Click Advanced to display the advanced Select Users dialog box, as shown in Figure 16-14. Chapter 16 Figure 16-14 The advanced Select Users dialog box has additional options. You can now search for users by name and description or by clicking Find Now without entering any search criteria to display a list of available users from the current location. You can select any of the users listed. Select multiple user accounts by holding down the Ctrl key and clicking each account you want to select or by holding down the Shift key, selecting the first account name, and then clicking the last account name to choose a range of accounts. Click OK twice, and then use the Add New Quota Entry dialog box to configure the quota options for all the selected users.
  16. 532 Chapter 16 Managing Windows Server 2008 File Systems To manage multiple quota entries simultaneously, access the Quota Entries dialog box, then select the entries by holding down the Ctrl key and clicking each entry you want to select or by holding down the Shift key, selecting the first entry, and then clicking the last entry to choose a range of entries. Afterward, right-click one of the selected entries, and then choose Properties. You’ll then be able to configure quota options for all the selected entries at once. Managing Disk Quotas After Configuration Users are notified that they have reached a warning level or quota limit when they access the volume on which you’ve configured disk quotas. As an administrator, you’ll want to check for quota violations periodically, and there are several ways you can do this. One way is to access Disk Management, right-click the volume that you want to check on, and then select Properties. In the Properties dialog box for the disk, click the Quota tab, and then click the Quota Entries button. You can then check the current disk usage of users and see whether there are any quota violations. You can also copy selected entries to the Clipboard by pressing Ctrl+C and then pasting them into other applications, such as Microsoft Excel, using Ctrl+V to help you create reports or lists of disk space usage. You can check quota entries from the command line as well. Type fsutil quota query DriveDesignator at the command prompt, where DriveDesignator is the drive letter of the volume followed by a colon, such as D:. If disk quotas are enabled on the volume, you’ll then get a summary of the disk quota settings on the volume, as follows: FileSystemControlFlags = 0x00000031 Quotas are tracked and enforced on this volume Chapter 16 Logging enabled for quota limits and threshold The quota values are up to date Default Quota Threshold = 0x0000000038400000 Default Quota Limit = 0x0000000040000000 SID Name = CPANDL\edwardh (User) Change time = Saturday, April 12, 2008 Quota Used = 528164252 Quota Threshold = 943718400 Quota Limit = 1073741824 SID Name = CPANDL\mollyp (User) Change time = Monday, April 14, 2008 Quota Used = 627384965 Quota Threshold = 943718400 Quota Limit = 1073741824 In this example, disk quotas are tracked and enforced on the volume, logging is enabled for both quota limits, and the warning levels and the disk quota values are cur- rent. In addition, the default warning limit (listed as the quota threshold) is set to 900 MB (0 × 038400000 bytes) and the default quota limit is set to 1 GB (0 × 040000000 bytes).
  17. Managing Disk Quotas 533 The disk quota summary is followed by the individual disk quota entries for each user who has stored data on the volume or has a custom entry regardless of whether the user has ever written data to the volume. The entries show the following information: SID Name The logon name and domain of user accounts or the name of a built-in or well-known group that has a quota entry. Change Time The last time the quota entry was changed or updated. Quota Used The amount of space used in bytes. Quota Threshold The current warning level set for the user in bytes. Quota Limit The current quota limit set for the user in bytes. When you configure disk quotas, you also have the option of logging two types of events in the system logs: one for when a user exceeds the quota limit and another for when a user exceeds the warning level. By default, quota violations are written to the system log once an hour, so if you checked the logs periodically, you could see events related to any users who have disk quota violations. It’s much easier to check for quota violations from the command line, however. Simply type fsutil quota violations at the command prompt, and the FSUtil Quota command will check the system and applica- tion event logs for quota violations. Note Wondering why FSUtil Quota Violations checks the system and application logs? Well, in Chapter 16 some cases, quota violations for programs running under user accounts are logged in the application log rather than the system log. So, to ensure all quota violations are checked for, FSUtil Quota Violations checks both logs. If there are no quota violations found, the output is similar to the following: Searching in System Event Log... Searching in Application Event Log... No quota violations detected If there are quota violations, the output shows the event information related to each vio- lation. In the following example, a user reached the warning level (listed as the quota threshold): Searching in System Event Log... **** A user hit their quota threshold ! **** Event ID : 0x40040024 EventType : Information Event Category : 2 Source : Ntfs User: CPANDL\harryt (User) Data: D: Searching in Application Event Log...
  18. 534 Chapter 16 Managing Windows Server 2008 File Systems As you can see, the output shows you the event ID, type, category, and source. It also shows the user who violated the disk quota settings and the volume on which the viola- tion occurred. SIDE OUT You can change the notification interval for quota violations As mentioned previously, quota violations are written to the event logs once an hour by default. You can check or change this behavior using the FSUtil Behavior command. Keep in mind, however, that any changes you make apply to all volumes on the system that use disk quotas. To check the notification interval, type fsutil behavior query quota- notify. If the notification interval has been set by you or another administrator, the noti- fication interval is shown in seconds. To set the notification interval, type fsutil behavior set quotanotify Interval, where Interval is the notification interval you want to set l expressed as the number of seconds. For example, if you want to receive less-frequent notifications, you might want to set the notification interval to 7200 seconds (2 hours), and you would do this by typing fsutil behavior set quotanotify 7200. Exporting and Importing Quota Entries If you want to use the same quotas on more than one NTFS volume, you can do this by exporting the quota entries from one volume and importing them on another volume. When you import quota entries, if there isn’t a quota entry for the user already, a quota Chapter 16 entry will be created. If a user already has a quota entry on the volume, you’ll be asked if you want to overwrite it. To export and import quota entries, access Disk Management, right-click the volume from which you want to export quota settings, and then select Properties. In the Proper- ties dialog box for the disk, click the Quota tab, and then click the Quota Entries but- ton. You’ll then see the Quota Entries dialog box. Select Export from the Quota menu. This displays the Export Quota Settings dialog box. Use the Save In selection list to choose the save location for the fi le containing the quota settings, and then set a name for the fi le using the File Name field. Afterward, click Save. Next, access the Quota Entries dialog box for the drive on which you want to import settings. Select Import on the Quota menu. Then, in the Import Quota Settings dialog box, select the quota settings fi le that you saved previously. Click Open. If prompted about whether you want to overwrite an existing entry, click Yes to replace an existing entry or click No to keep the existing entry. Select Do This For All Quota Entries prior to clicking Yes or No to use the same option for all existing entries.
  19. Maintaining File System Integrity 535 Maintaining File System Integrity As part of routine maintenance, you should periodically check disks for errors. The primary tool to do this is Check Disk, which is implemented in both a graphical and a command-line version. How File System Errors Occur File data is stored in clusters, and the Windows operating system uses a fi le table to determine where a file begins and on which clusters it is stored. With FAT, the fi le table used is called the root directory table. It defines the starting cluster of each file in the file system. This cluster has a pointer to the second cluster, and the second cluster has a pointer to the next, and so on until you get to the final cluster used by the file, which has an EOF marker. With NTFS, an MFT is used. If a file’s data can’t fit within a single record in this table, clusters belonging to the file are referenced using VCNs that map to starting LCNs on the disk. If a file’s pointer or mapping is lost, you might not be able to access the file. Errors can also occur for pointers or mappings that relate to the fi le tables themselves and to the pointers or mappings for folders. FAT tries to prevent disk integrity problems by maintaining a duplicate fi le allocation table that can be used to recover the primary file allocation table if it becomes cor- rupted. Beyond this, however, FAT doesn’t do much else to ensure disk integrity. NTFS, on the other hand, has several mechanisms for preventing and correcting disk integrity problems automatically. NTFS stores a partial duplicate of the MFT, which can be used for failure recovery. NTFS also stores a persistent history of all changes made to files on the volume in a log file, and the log file can be used to recover NTFS metadata files, Chapter 16 regular data fi les, and folders. What these fi le structure recovery mechanisms all have in common is that they are automatic and you as an administrator don’t need to do any- thing to ensure that these disk housekeeping tasks are performed. These mechanisms aren’t perfect, however, and errors can occur. The most common errors relate to the following areas: Internal errors in a file’s structure Free space being marked as allocated Allocated space being marked as free Partially or improperly written security descriptors Unreadable disk sectors not marked as bad Fixing File System Errors by Using Check Disk Using Check Disk, you can check for and correct any of the common disk errors dis- cussed previously. Check Disk works on FAT, FAT32, and NTFS volumes and primarily looks for inconsistencies in the file system and its related metadata. It locates errors by comparing the volume bitmap to the disk sectors assigned to fi les. For files, Check Disk
  20. 536 Chapter 16 Managing Windows Server 2008 File Systems looks at structural integrity, but won’t check for or attempt to repair corrupted data within files that appear to be structurally intact. Check Disk has two modes in which it can be run. It can analyze a disk, checking for errors, but not repairing them. Or it can analyze a disk and attempt to repair any errors found. New for Windows Server 2008 is that Check Disk has been optimized so that it runs faster than previous versions. You can run the graphical version of Check Disk by using either Windows Explorer or Disk Management. Right-click the volume, and choose Properties. On the Tools tab of the Properties dialog box, click Check Now to display the Check Disk dialog box, as shown in Figure 16-15. If you want to analyze the disk but not repair errors, click Start without selecting either of the available options. If you want to check for errors and repair them, select the Automatically Fix File System Errors check box, and click Start. You can also check for and repair bad sectors by selecting the Scan For And Attempt Recovery Of Bad Sectors check box. Figure 16-15 Check the disk for errors and repair them or perform analysis only. Chapter 16 To fi x errors, Check Disk needs exclusive access to the volume. If Check Disk can’t get exclusive access to files (because they have open file handles), Check Disk will prompt you, as shown in Figure 16-16. If you click Schedule Disk Check, Check Disk will ana- lyze and repair the disk the next time the system is started. Figure 16-16 Check Disk needs exclusive access to some Windows files to fix errors.
Đồng bộ tài khoản