Windows NT Server 4.0 Notes


Module 5: Managing File Systems

File Allocation Table (FAT) File System
  •  Under NT, FAT supports
    • LFN,
    • has No local security and
    • Maximum file/partition size of 4 GB.
  • FAT naming conventions:
    • Filenames up to 255 characters including the full path.
    • Filenames may not contain: "/\[ ] ; : | = ,^ * ?
    • May contain multiple spaces and "." (periods), characters after last period are seen as file extensions.
    • Names preserve case, but are not case sensitive.
  • Some other factors that are important to implementing FAT on Windows NT:
    • FAT has minimal overhead (less than 1 MB) (NTFS had 1-5 MB overhead)
    • Most efficient file system on partitions smaller then 400 MB.
    • Performance declines with large number of files because it uses a linked list for the folder structure. Also files can get fragmented and the process for retrieving the file from the disk gets slower.
    • System partitions on RISC-based computer must be formatted with FAT, they will only start from a FAT file system. This means that RISC-based computers are vulnerable. You can add security with disk manager or a third party utility.
    Note: Windows NT prevents deleted files from being undeleted (after they are removed from the recycle bin), this is because undelete utilities require direct access to the hardware. If the deleted file is on a FAT partition, and the system is restarted under DOS, it is possible to undelete it as long as it hasn't been written over.
Windows NT File System (NTFS)

NTFS naming conventions:

  • File and folder names can be up to 255 characters, including extensions.
  • Filenames are case-preserving, but not case sensitive.
    Note: NTFS allows two filenames to coexist that differ only in case!

     

  • There is an exception: a file name IS case-sensitive when it is used on a POSIX application.
  • Names may not contain: ? " / \ < > * | :   (9 characters)
Note:
You can assign permissions to a file or folder regardless if it is shared or not.
  • It is the only file system supported by NT that allows file level permissions.

NTFS supports

  • LFN,
  • local security and
  • maximum partition size16 exabytes (theoretical) 2 terabytes (actual).

NTFS Security

  • The theoretical file and partition size is 16 exabytes.
  • In reality, the maximum file size is 4 GB to 64 GB depending on the computer hardware. The functional maximum partition size is 2 terabytes due to industry-standard limitations on maximum number and size of disk sectors.
  • The recommended minimum partition size for an NTFS partition is 50 MB because of the overhead involved in using NTFS.
Note: NTFS volume sets can be extended so that it exceeds the 2-terabyte limit, but the volume set cannot be reformatted if there is a problem.

Comparisons

  • Microsoft recommends always using FAT for partitions of 50 MB or smaller, and NTFS for partitions of 400 MB or larger. In the “gray area” between 50 and 400 MB, other factors come into play. Chief among these is file-level security: If this is important, NTFS is the way to go, although FAT will work as well (but gets slower as the size increases).

    In relation to file size, FAT partitions can be up to 2 GB, VFAT 4 GB, and FAT32 4 TB; however, FAT partitions work best when they are 200 MB or less, because of the way the FAT itself is organized. NTFS partitions can be as much as 16 EB; however, they currently are restricted to 2 TB by hardware and other system constraints.

 Additional NTFS Features

  • Support for file compression: Reduces text-oriented application or data file size by 50% and executable file size by 40%.
  • Transaction-based recoverability. NTFS uses transaction logging to log all folder and file updates automatically.
  • Support for cluster remapping. If a bad sector causes error, NTFS allocates a new cluster to replace the cluster with the bad sector. NTFS then stores the address of the cluster containing the bad sector so that the bad sector is not reused.
  • Support for Macintosh files. Installing Services for Macintosh on NT server will allow Macintosh computers to store their files on the computer running Services for Macintosh.
    • With NTFS you can support Macintosh computers to access the NTFS disk and store MAC files on it. Be aware that MAC supports hard disks up to 2 GB. If your NTFS disk is larger MAC users will get the message that there is 0 bytes available if more than 2 GB of partition space are in use.
  • Support for POSIX requirements:
    • Case-sensitive naming.
    • Additional time stamp: This supplies the time the file was last accessed.
    • Hardlinks. A hard link occurs when two different file names point to the same data.
  • Note: You can run POSIX applications from any NT file system. However, if the application requires access to file system resources, then NTFS is required.
    • Support for file and folder security.
    • Provides a separate Recycle Bin for each user.
    • Reduces file fragmentation.
    Converting to NTFS
    • You can convert a FAT partition with Windows NT by using the following command:
    • convert drive: /fs:ntfs
    • An error message will appear when the file is in use at that moment, giving you also the option to schedule the conversion of the partition at the next reboot.
    • To convert NTFS to FAT, you have to reformat the disk, specifying the file system, using either the format command or Disk Administrator.
    Working with File Names

    Autogenerated 8.3 File Names

    • Long file names are generated as follows:
    • The first 6 characters of the file name are used, then uses a "~number" suffix to keep it unique. This can be up to ~4, (MYDOCS~4.doc), after that only the first two characters will be used, the next four will be randomly generated characters (MY0f53~1.doc). Only when a file name exits with the same first 6 characters, the ~1 will become ~2.
    • All file name characters that are not allowed under MS-DOS are removed, like spaces.
    • The following illustration shows the long file name to 8.3 alias generation.
        1. My Term Paper A.doc------MYTERM~1.DOC
        2. My Term Paper B.doc------MYTERM~2.DOC
        3. My Term Paper C.doc------MYTERM~3.DOC
        4. My Term Paper D.doc------MYTERM~4.DOC
        5. My Term Paper E.doc------MY0F58~1.DOC
        6. My Term Paper F.doc------MY6968~1.DOC
    • After the fourth file with the same first 6 characters and the exact same 3 characters after the last period in the LFN, the naming convention changes. The fifth iteration keeps the first 2 characters of the LFN, but the next 4 characters are generated by a HASHING ALGORITHM. Only when the hashing of the middle 4 characters fails to produce a unique name is the ~1 incremented to ~2.
    •  The method is the same for both FAT and NTFS.

     Long File Name Considerations

    • NT does not generate an alias for files created by a POSIX based applications so MS-DOS and Win16-based applications won't be able to access a file created by a POSIX-based applications if it's filename exceeds the 8.3 file naming convention.
    • When you deal with a long file name with spaces in command prompt, the path must be I quotes except CD command.
      NB NOTE: Some 16 bit applications save data to a temporary file, delete the original file and then rename the temp file to the original file name. In some cases this deletes the long file name and when the file is on an NTFS partition, any permissions that were associated with the original file.

    Long File Names on FAT Partitions

    • LFN creates one folder entry for its alias and a hidden secondary folder entry for every 13 characters of the LFN. For example, for the file name, This is a Long Name.txt, you will have one folder entry for the alias and two secondary folder entries for the LFN.
      • Alias Directory Entry--------------------THISIS~1.TXT
      • Secondary Directory Entry 1---------This is a lon
      • Secondary Directory Entry 2---------g Name.txt
    • Two ways to view alias name
      • Dir /x in command prompt
      • In NT explorer, select the file and then select File--Properties
    • FAT Root folder has a hard-coded limit of 512 entries, if you use too many LFN's, you may run out of entries.
    • You may prevent the use of LFNs on FAT partitions by setting the following registry value as 1: LOCAL_MACHINE\SYSTEM\CurrentControlSet\

    Control\FilSystem\Win31FileSystem

    • NT preserves case, so even if the original file on FAT partition meets 8.3 requirements, a mixed-case file name generates an uppercase alias. For example, MyFile.txt generates an alias of MYFILE.TXT on FAT, but not on NTFS.
    • When you are using long file names from the command prompt, you will have to put the complete path within quotation marks ("d:\Word for Windows\winword.exe").
      • Note: this is not required for the chdir (cd command.)
    Managing NTFS Compression

    Compressing and Decompressing Files and Folders

    • NTFS supports automatic compression and decompression of files, folders and even the entire drive with NTFS partition.
    • For performance reasons, compression is not supported on NTFS partitions with cluster sizes greater than 4 KB.
    • In NT explorer, files and folders that have a compressed attribute can be configured to display in blue text (blue is the only supported color, if you use blue background, you may not see it). To display it, View-->Options-->View tab-->Click Display compressed files and folders with alternate color.
    • There are two methods to compress files or folders:
    1. You can use the Windows NT Explorer:
      • Use the checkbox on the general properties tab of the file. If it is checked for a folder, you can also check a box to compress all subfolders of the directory. In Explorer the files and folders can be presented in a blue color (use View-->Options) the blue color cannot be adjusted to another color..
    2. Use the compact.exe command: It is a command line utility that can use the following options:
    Option Action performed Option Action performed
    /c Compress the specified files, directories will be marked to compress new added files. /i Continue performing the operation even if errors occur.
    /u Uncompress (also marks directories). /f Forces compression on all specified files even if already compressed This also compresses files that are compressed partially due to a power lost.
    /s Files in directory and all sub directories will be compressed. /q Reports only the summary information.
    /a Displays files with the Hidden or System attribute; these files are omitted by default.
    • If the command is used without any parameters, it displays the compression state of the current folder and any files within the folder.

    Some notes:

    • Neither explorer nor compact.exe can compress an open file.
    • You can not compress NTLDR (NT Boot Loader) if you are booting from an NTFS partition on an Intel x86-based computer.
    • Paging file cannot be compressed when it is in use as for any other file. A closed paging file can be compressed, but when it starts, it will immediately be decompressed.
    • Any user with Read and Write permission will be able to perform the commands.
    • The entire \winnt_root\ folder and all of it's subfolders can be compressed after installation.

    Compression attributes change during copying and moving

    Copying

    • When a file is copied from one folder to another,
      • its compression properties change to that of the target folder. This is the same with permissions.
    Because the file is copied to a compressed folder, it will be copied in its original state and after that it will be compressed. So you will need enough disk space for the entire file in its original state!

     Moving

    • When a file is moved
    • Same partition:
      • it retains it original attributes, like permissions and compression settings.
    • but when moved across partitions:
      • in will inherit the settings of the target folder, this happens because a move between two partitions is actually a copy-and-delete operation!!!!

     

    NOTE: When a compressed file is moved to a folder that does not contain any compressed files, the folder does not appear in blue in WinNT Explorer. The only time a folder appears in blue is when the folder has the compression attributes set, so that new files put in the folder will be compressed.

     


    E-mail Me! Comments and suggestions? E-mail me at grantwil@sk.sympatico.ca
    Last Updated: Wednesday, March 10, 1999 Grant Wilson, Tisdale, SK. Canada