A rchive Date
[ 14-09-2000 ]
Category
[ Information Technologies ]
sub-Categoy
[ Microsoft ]
|
[November 1997
Working with NTFS volumes - tips and benefits
As you know, Windows NT's NTFS file system offers several benefits that the FAT file system doesn't--primarily the ability to set individual file and directory permissions. But did you know that the NTFS file system is also more efficient and faster in its use of hard disk space? Did you know that when you copy NTFS files, they don't retain their original NTFS permissions? Were you aware that using NTFS file compression reduces slack and recovers disk space? What's more, you can easily convert partitions to NTFS without overwriting their file contents. Let's take a look.
Space-saving benefits of NTFS
Under the FAT file system, the smallest amount of disk space a file can use is based on the size of a cluster, not the size of the file. Typically, clusters on FAT-formatted hard disks consist of 2,048 bytes. However, on today's popular large disks (larger than 1.5GB), clusters range in size from 4,096 bytes on a 250MB hard disk to as large as 32,738 bytes on a 1.7GB hard disk.
This means that storing a 50-byte AUTOEXEC.BAT file on a 1.7GB hard disk actually requires a whole cluster, or 32,768 bytes. In other words, there's a waste of 32,718 bytes! On a 512MB hard disk formatted with the NTFS file system, a cluster consists of only 512 bytes. On hard disks that range in size from 512MB to 1GB, the cluster size moves up to 1,024 bytes. From 1GB to 2GB, the cluster size doubles to 2,048 bytes. From 2GB on up, the cluster size has a maximum of 4,096 bytes. Therefore, the NTFS file system makes the most efficient use of the available hard disk space.
To store the same 50-byte AUTOEXEC.BAT file on a 1.7GB hard disk formatted with the NTFS file system would require only 2,048 bytes: a savings of 30,720 bytes compared to the FAT file system. In the speed department, accessing sequential access files over 512MB is significantly faster than on a FAT-formatted hard disk. Access to all random access files is faster as well.
Moving files versus copying
If you're using NTFS permissions to secure access to specific files or folders, you'll want to pay close attention whenever you move or copy a file. Here's why.
When you right-click a folder and adjust its security settings, every file you create in that folder inherits those attributes. So, if you save a file in a Drafts folder whose default permissions give the Everyone group full control, anyone who can see the file will be able to read, edit, or delete it.
But what happens when you finish your draft and transfer the completed document to a folder whose default permissions give the Everyone group only read and add rights? That depends. If you copy the file, it picks up the permissions from the new folder. If you move the file, it retains the original permissions--and in this example, the file you think is safe in its protected folder will actually be available for anyone to change or delete.
One exception to this rule occurs when you move files between folders on different volumes. When you do so, the files will inherit the permissions of the destination folder. Therefore, you'll always need to remember to reset the permissions for files that you've moved or copied between volumes. As a general strategy, we recommend that you set folder permissions to uniformly control access to files. If you adopt that policy, there's a simple rule you can follow to ensure that file permissions are always in sync with the folder they're stored in: Never move a file. Instead, copy the file to its new location and then delete the original.
When you want to copy a block of files from one place to another with their original permissions intact, use the SCOPY command, which is available in the NT Resource Kit. This command-line utility is ideal for making backup copies of sensitive folders when you don't have a tape drive.
File compression
NTFS's file compression is built directly into the operating system, making it far safer and more reliable than DriveSpace. Unlike DriveSpace, which requires you to create an entire compressed volume with its own unique drive letter, NT compression allows you to squeeze the slack out of a single folder, an entire drive, or anything in between--without changing drive letters, affecting settings or installed applications, or going through a lengthy conversion process. You don't even need administrative privileges to compress files--if you can see the file in Internet Explorer, you can reduce the amount of disk space it uses.
Keep in mind that you can only use NTFS file compression with volumes that have a cluster size of less than 4KB. If you display the properties for volumes with a larger cluster size, you'll see that the Compression option is grayed out--compressing these volumes would result in such a large performance hit that NT won't allow you to do it.
To compress one or more files, open an Explorer window, select the files you want to compress, right-click, and choose Properties from the shortcut menu. Select the Compressed check box at the bottom of the General tab, and click OK.
As NT performs the compression, you'll see a progress dialog box that details how much disk space you've saved. Curiously, NT displays only the final compressed size on a file or folder's Properties sheet. The exact amount of compression varies, depending on the characteristics of the original data, with bitmap graphics files and databases likely to squeeze down most efficiently.
To compress a folder on the entire drive, select the appropriate icon and follow the same steps. If there are subfolders, you'll see an additional dialog box after you click OK. By default, NT compresses only the files within the current folder; if you want to compress subfolders as well, you'll have to select the Also Compress Subfolders check box, found in that follow-up dialog box. This option can recover huge amounts of disk space when used on folders full of graphics files, databases, and other types of files that use inefficient storage formats.
To uncompress a file or folder, display its Properties sheet and deselect the Compressed check box. NT will warn you if there's insufficient disk space to complete the operation.
To see at a glance which files are compressed, open any Explorer or folder window and choose View | Options.... Click the View tab and select the Display Compressed Files And Folders With Alternate Color check box. After making that adjustment, NT will display the names of compressed objects in blue, while leaving uncompressed objects in black.
Finally, in regard to copying or moving, NTFS compression behaves in a manner similar to NTFS permissions, as we described in the section above. When you move a compressed folder or file into an uncompressed folder on the same volume, NT doesn't automatically decompress the moved file. On the other hand, copying a compressed folder or file to an uncompressed folder on the same volume will automatically decompress the folder or files.
8.3 filenames
In the article "Windows' Long Filename Support Explained," which appeared in last month's issue, we told you how Windows NT automatically generates DOS-compatible 8.3 format filenames from long filenames. If you have no need for DOS-compatible filenames, you may be able to improve performance on NTFS volumes that contain large numbers of similarly-named files by disabling the automatic generation of short filenames.
To do so, you must edit the registry key and value:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
\Control\FileSystem
Value: NtfsDisable8Dot3NameCreation
Change the value to 1 to disable the generation of short filenames on all the machine's NTFS volumes. Change the value to 0 to enable this feature. Note: You can't disable this feature for specific volumes--changing this registry key's value effects the change on all of the machine's NTFS volumes.
Converting partitions to NTFS
The NT setup program will allow you to convert FAT- and HPFS-formatted partitions to NTFS while preserving their file contents. However, if you're forced to quit the setup program before completion, it won't convert the partitions to NTFS. Therefore, you'll probably find it more convenient to convert non-NTFS partitions after running the Setup program. You may also find it useful to convert non-NTFS partitions to take advantage of some of the benefits we've described in this article.
Note: Once you've converted a partition to NTFS, you can't convert it to a non-NTFS format without reformatting.
First, open the Command Prompt and enter the command
where drive is the drive letter for the partition that you want to convert. You can't convert the system partition without restarting your system. When you try to convert the system partition, NT will warn you that Convert cannot perform the conversion immediately and ask if you want to perform the conversion at next restart. Choose Yes and restart your system. NT may require several restarts before completing the conversion.
Much of the material used in this article is based on articles written by Ed Bott.
Copyright © 1999, ZD Inc. All rights reserved. ZD Journals and the ZD Journals logo are trademarks of ZD Inc. Reproduction in whole or in part in any form or medium without express written permission of ZD Inc. is prohibited. All other product names and logos are trademarks or registered trademarks of their respective owners.
Copyright Terms & Conditions ]
|