Software
Software

When we talk about software in computers, we realistically come across two main types.
OPERATING SYSTEM SOFTWARE
APLLICATION SOFTWARE
Operating System software is software that is used to run the computer. In my opinion, it is the language of the computer, a language that the computer uses to communicate with it’s different devices, to regulate, control, authorize and request procedures from them.
We can also call the operating system as a kind of interface between us and the various hardware devices our computers are made of. Without the Operating system we wouldn’t be able to preform the various tasks that we use computers for and the computer would be a totally worthless piece  of equipment lying on our desk.

There are different types of operating systems available in the market, each working a little differently than the other, but all performing the primary task of operating the computer. Let’s list them outMicrosoft has a family of operating systems and they are presently, by far, the most favourable and most popular of operating systems.
Microsoft has Operating systems for use on a personal computer, which would normally be used at home, a workstation, which would normally be used at work, and on a server which would be used at work and used as a central computer to coordiante the work of the computers under it
.

The Operating system produced and sold by Microsoft for personal use isMS-DOS (upgrade upto 6.22)
                                                                                                                           Windows 3.1
                                                                                                                            Windows 95
                                                                                                                            Windows 98
                                                                                                                           Windows Me (millenium)

The Operating Systems sold by Microsoft for the work envoirnment are: Windows NT (upgrades upto 4.0)
                                                                                                                        Windows Professionsl 2000
                                                                                                                       Windows 2000 server
                                                                                                                       Windows 2000 Advanced server

These 3 Operating systems were specifically designed with the average consumer in mind and his needs at home or in a personalized envoirnment

Windows 95 was designed and developed to provide enhanced capabilites at the hands of the consumer and came out after Windows 3.1. It is the first true Multitasking and Multithreading Operating system designed by Microsoft for the Consumer
What I mean by Multitasking is that this operating system makes use of the CPU (central processing unit, like the Intel pentium, AMD, Cyrix, Motorola etc...) in a very effeicient  way. This means that the Operating system uses one of three methods to ensure that one process does not the resources of the CPU infinitly.Should one process use up the resources of the CPU for an extended length of time, the other resources requesting CPU attention would starve and this would lead to an extended delay in running other programs you may want to run and may even delay the running of processes so critical to the computers functioning that it may just crash.
The three methods that this operating system uses to make sure that each process gets sufficient time at the CPU is,

A ROUND ROBIN TIME SCHEDULER OR A TIME-SLICED EXECUTIVE, where a process taking too much time will be interrupted after the elapse ofa fixed amount of time to make way for a new process
IF THE PROCESS FINISHES IT’S USE OF THE CPU within the fixed amount of time, or
IF THE PROCESS VOLUNTARILY SUSPENDS IT’S USE OF THE CPU.
Significant gains have been achieved in terms of speed, reliability, and decrease in the percentage of idle time of the computer due to this principle
Just as multitasking allows the Operating System to run different processes on the CPU concurrently, Multithreading allows the different parts of this process to execute it’s instructions independently. Remember a process can and is mostly made of different parts which need to be executed on different hardware devices on the computer besides th CPU. Thus, asa part of the process waits it’s turn to use the cpu the other part can go ahead and execute it’s instructions at a different hardware device provided that this part of the process is independent of it’s parent process that needs CPU time.

Another aspect of the Windows 95 Operating system is it’s file system known as FAT ( File Allocation Table). The inital versions of Windows 95 had the FAT 16 file system, which essentially defines it as a 16 bit operating system. This existing File Allocation Table (FAT) file system was invented in 1977 as a way to store data on floppy disks for Microsoft  Stand-alone Disk Basic. Although originally intended for floppy  disks, FAT has since been modified to be a fast, and flexible system  for managing data on both removable and fixed media.

WHAT IS FAT AND HOW DOES IT WORK?

In order to grasp the inadequacies of the FAT 16 system, you need to understand  what the FAT is and how it manages your hard disk. To do so, imagine that your  hard disk is a filing cabinet. In a filing cabinet, you store information on  pieces of paper as files. You store the files in folders within folder dividers.  To keep track of what's in the folders and dividers, you place tabs on them  noting their contents. Basically, the FAT system works the same way with your  hard disk. It provides the electronic equivalent of papers, folders, dividers,  and tabs. The FAT system stores the tabs indicating the file locations in a  special database called the file allocation table, or FAT for short. To carry  our analogy further, on a hard disk the pieces of paper are known as sectors.  Sectors are the smallest units of storage on your hard disk and measure 512  bytes in size. To keep track of the sectors, the FAT  system organizes them  into units called blocks (clusters), which are similar in function to the file folders.  When you save a file on your hard disk, the operating system looks in the FAT  for free space in the cabinet. It finds the free clusters on your hard disk,  writes the data to the sectors, and makes notations of the filename and the  cluster's location in the FAT. Overall, the FAT system works pretty efficiently  as far as keeping track of your files goes. However, the problem with the FAT is  that it's limited in size. It can store only so many items at a time. The reason  for this can be traced back to the FAT system's origin

THE ORIGINS OF FAT

The FAT system was  invented in 1977 as a way to store data on floppy disks for Microsoft  Stand-alone Disk Basic. At that time, floppies stored 180KB of data. Soon,  floppies grew to larger capacity and PCs began shipping with hard disks. Back in  those days, the memory models used for designing operating systems had limits.  For example, when the FAT was invented, it was capable of holding only 64KB of  data. This limit was imposed because DOS was a 16-bit operating system designed  to work with 16-bit computer architecture. Let's take a moment to examine this  further. As we mentioned in our analogy, a hard disk is divided into 512-byte  pieces called sectors. In order to keep track of its sectors and perform as a  16-bit operating system, DOS assigns a 16-bit binary number to each sector on  the hard disk and stores that number in the FAT. In decimal terms, the largest  number you can write with 16-bits is 65,535 (2^16) which is equivalent to 64KB. Thus,  the FAT can keep track of at most 65,535 sectors, or 64KB of data.
This 64KB  limit was fine for the storage capacities at the time. Even FAT entries on the  seemingly mammoth 10MB disks wouldn't exceed 64KB. However, by the mid-1980s,  hard-disk sizes began to increase. Disks holding 40MB and 60MB were becoming  common. It was also beginning to become apparent that the FAT had reached its  limit. With 65,535 sectors of 512 bytes, the maximum hard disk size that the FAT  could keep track of was 32MB (65,535 * 512). This meant that if you had a large  disk, you had to partition it into 32MB pieces in order to stay within FAT's  limits. For example, to use a 40MB hard disk, you'd have to partition it into  two drives: one would be 32MB and the other would be 8MB. As you can imagine,  this wasn't very efficient. To compensate for the 64KB limit on the FAT,  Microsoft developed a workaround which it implemented in MS-DOS 4.0. To extend  the FAT's capabilities, MS-DOS 4.0 grouped the sectors on the hard disk into  clusters and then replaced the sector addresses in the FAT with cluster  addresses. Thus, the FAT could store addresses for 65,535 clusters. This  meant that you could now create partitions larger than 32MB and still stay  within FAT's 64KB limit. When you create a partition in DOS that's larger than  32MB, DOS increases the number of sectors contained in a cluster in order to  keep the FAT under its 64KB limit. Table A shows the sizes of the clusters used  by different hard-disk sizes. Table A The bigger your disks, the bigger your  Cluster Size

SIZE OF DISK                 SIZE OF CLUSTER

  0 - 32MB                                   1/2KB
33MB - 64MB                                1KB 
64MB - 128MB                              2KB 
129MB - 256MB                           4KB
257MB - 512MB                           8KB 
513MB - 1GB                              16KB 
1.1GB - 2GB                               32KB 
2.1GB - 4GB                              64KB 

 Fat FAT disks = fat clusters
As you can see from Table A, when the standard  hard disk got larger, DOS was forced to increase the cluster size to remain  within the 64KB limit. This system worked fine until hard disks surpassed the  gigabyte level. Once that happened, cluster sizes jumped to a whopping 32KB.  Having such a large cluster size can be a huge problem for most  users; especially if you store lots of small files on your hard disk.  No matter how small the file, it will consume at least one cluster. For example,  if you store a 1KB file on a 1.2GB hard disk, that small file will take up an  entire 32KB of space. The other 31KB will remain empty. This unused space in a  cluster is called slack space. Since the operating system can't write data into  slack space, it's completely wasted. So again, it became obvious that the FAT  had reached another limit


FAT 16 IS SLOW FOR BIG FILES:

Now you have to know that all files and data stored in hard-drives have to be a closed loop,and parts of data are stored at different spaces in the hard-drive with links between these datas. Using the example mentioned above, on a 1.2Gb hard-disk, with a 32 KB cluster (block) suppose we have a file which is 40KB in size, it will be allocated one whole cluster another 8 KB on a different cluster with links between them. Now the address for this file will only be the address of the cluster where it’s data begins and thus if the Operating system, needs a part of data from this 40KB file which resides in the last 8KB stored on the other cluster, then the O.S. has to run though the whole 32KB cluster to reach it’s link and then be guided to the cluster that holds the last 8KB of data. this process takes a long time and slows down the operating efficiency. it is analogus to  running through an audio tape to get to the song you want to listen to.

New versions of Windows 95 and Windows 98 were updated with a newer version of FAT named FAT 32, which is a true 32 bit operating system.
The FAT 32 File system has only 4KBytes per block thus making each block much smaller in size and thus there is savings in space and it also makes the operating system much faster compared to FAT 16.

FAT 32
HOW IS FAT 32 MORE EFFICIENT?
Now that you have a basic understanding of how  the FAT works and the problems that are inherent in its design, you'll  appreciate the advantages of the FAT 32 system. Before we go on, it's important  to understand that FAT 32 is still based on the original FAT system and works  very similarly in order to remain compatible with existing programs, networks,  and device drivers. The biggest improvement in FAT 32 is its ability to  efficiently manage storage space on today's large hard disks.
Smaller  cluster size
To improve storage efficiency, the FAT 32 system uses a 4KB  cluster size for all hard disks under 8GB. This reduces the amount of slack  space on your hard disk when you save small files. For example, saving a 1KB  file on a 1GB hard disk using the old FAT system takes up 32KB of space. Saving  the same file on the same hard disk using the FAT 32 system, however, takes up  only a 4KB of space; that's a savings of 28KB. While this may sound  trivial, when you look at an entire hard disk with thousands of small files, the  savings is dramatic. In fact, Microsoft guarantees that the average large hard  disk will use its disk space at least 10 to 15 percent more efficiently.  However, in some cases, it has been determined that the space savings is even  larger; reaching almost the 50-percent range. Of course, the results  vary depending on the number of small files on the hard disk.

IMPROVED RELIABILITY IN CASE OF FAT 32
FAT 32 also offers advantages that fall into the category of improved  reliability. For instance, under the FAT 16 system, the root directory could be  located only at the beginning of the hard disk. If anything happened to that  section of the hard disk, the whole thing was unusable. Under the FAT 32 system,  the root directory can be located anywhere on the hard disk. This means that if  something does happen to the section of the hard disk storing the root  directory, the new FAT 32 hard disk utilities will be able to easily move the  root directory and repair the defective area. Another advantage FAT 32 has over  FAT 16 is that it can use both the default and the back-up copy of the FAT. The  FAT 16 system can use only the default copy to run your system; the backup copy  is used only by low-level disk utilities when repairing the default FAT. FAT 32,  on the other hand, can use both copies of the FAT. Thus, if something happens to  the default FAT, the system will continue to run off the backup copy until the  default can be repaired. This ability to run off either copy of the FAT  has opened the door for more dramatic improvements that are available in the present age. For example,  this technology has now enabled us to resize and increase the size of our hard-drive partitions without reformatting the dirve or without loss or dmamge to existing data

A LARGER ROOT DIRECTORY
In addition to being able to  locate the root directory anywhere on a hard disk, the FAT 32 system has  eliminated the 512 entry limit of the root directory. The FAT 16 system uses 32  sectors of 512 bytes each to store the root directory. Thus, the size of the  root directory on a hard disk is limited to 16KB, or 512 entries. In other  words, the FAT 16 system will let you store at most 512 files and folders in the  root directory. Under the FAT 32 system, you can have as many files and folders  in the root directory as you want.

LARGER HARD DISKS
If you thought a 60  gigabyte hard disk was large, hard disk manufacturers have already released their  first terabyte (TB) hard disks. (A terabyte is equal to 1,099,511,627,776  bytes; roughly one trillion bytes!) In preparation for this,  Microsoft has given FAT 32 the ability to support hard disks as large as 2TB.
Conclusion
If you have a gigabyte or larger hard disk, you've probably  been surprised at how quickly your hard disk is filling up. The reason behind  this problem is that the FAT 16 system is out-dated and can't manage disk space  very efficiently on the new large hard disks.

Remember though that Windows NT that shipped with Windows 95  still works on  FAT 16 envoirnment because FAT 16 is more reliable and much more secure in a work envoirnment. Present versions of Windows NT with the service pack 4, though work on the NTFS file system which i will explain later on.
Let us now review the features of FAT 32

FEATURES OF FAT 32:

FAT32 provides the following enhancements over  previous implementations of the FAT file system: - Supports drives  up to 2 Terabytes in size(2,048 Giga Bytes). - Uses space more efficiently. FAT 32  uses smaller clusters (e.g. 4kb clusters for drives up to 8GB in  size), resulting in 10 to 15% more efficient use of disk space  relative to large FAT drives. - More robust. FAT32 has the ability  to relocate the root directory and use the backup copy of the FAT  instead of the default copy. In addition, the boot record on FAT32  drives has been expanded to include a backup of critical data  structures. This means that FAT32drives are less susceptible to a  single point of failure than the existing FAT 16. - More flexible.  The root directory on a FAT32 drive is, these days, an ordinary cluster  chain, so it can be arbitrarily large and located anywhere on the  drive. In addition, FAT mirroring can be disabled, allowing a copy  of the FAT other than the first one to also be active. This means that we can have 2 or more bootable partitions with an operating system on each with the FAT 32 file system. These features  allow for dynamic resizing of FAT32 partitions.

COMPATIBILITY  CONSIDERATIONS
In order to maintain the greatest compatibility  possible with existing applications, networks and device drivers,  FAT32 was implemented with as little change as possible to Windows  95's existing architecture internal data structures, Application  Programming Interfaces (APIs) and on-disk format. However, because the size of one block has decreased from 64K in case of FAT 16 to 4K incase of FAT 32, to store cluster values,  many internal and on-disk data structures and published API’s had to be revised 
 and/or  expanded. In some cases, the existing APIs  failed on FAT32 drives.  however Most applications were unaffected by these changes. 

All of Microsoft's bundled disk utilities (Format,  FDISK, Defrag, MS-DOS and Windows ScanDisk, and DriveSpace) were  revised to work with FAT32. In addition, Microsoft is worked with leading device driver and disk utility vendors to support them  in revising their products to support FAT32.

PERFORMANCE
For most users, FAT32 will have a determinable  performance impact. Some applications may see a  performance  gain from FAT16. In other applications, particularly those heavily  dependent on large sequential write operations, FAT32 may result in  a modest performance degradation.

CREATING FAT32 DRIVES
In Windows 95 OEM Service Release 2 and all versions of Windows 98, if you run the FDISK utility on a  system with a drive over 512MB, it will ask whether you want to enable large  disk support. If you answer yes, any partition you create that's  greater than 512MB will be marked as a FAT32 partition, which essentially measn that you cannot format another partition with a different file system like NTFS or NFS or the Linux or Unix file systems.

WHY NOT JUST ADD NTFS TO WINDOWS 95 AND WINDOWS 98?
NTFS is an advanced file  system, with support for many features not present in FAT32,  including per-file compression, security and transactioning. It is  not feasible to implement NTFS within the memory and compatibility  constraints of the Windows 95 or windows 98 platform. Windows 95 and windows 98 still support  real-mode MS-DOS for booting and running some MS-DOS based games.  Adding NTFS support to the MS-DOS kernel would have required a  significant amount of MS-DOS memory, and thus would have precluded  the use of many MS-DOS mode games and applications. Protect-mode  only support for NTFS would not have allowed Windows to boot from an  NTFS volume.

TECHNICAL IMPLEMENTATION
 Two new partition types are defined: 0xB and 0xC. Both indicate FAT32 volumes; type 0xC indicates a FAT32 partition that  requires Extended Int13h support (LBA). - The boot record on FAT32 drives requires 2 sectors (due to expansion and addition of fields within the BPB). As a result, the number of reserved sectors on  FAT32  drives is higher than on FAT16, typically 32. This expanded  reserved area allows two complete copies of the boot record to be  stored there, as well as a sector in which the free space count and  other file system information is stored. - The FAT is now larger,  because each entry now takes up 4Kbytes and there are typically many  more blocks (clusters) than on FAT16 drives. - The root directory is no  longer stored in a fixed location. A pointer to the starting cluster  of the root directory is stored in the extended BPB (Base Partition Block). - The on-disk  format for directory entries is unchanged, except that the two bytes  previously Reserved for Extended Attributes now contain the high  order word of the starting cluster number.

THE NTFS FILE SYSTEM

Above, we have looked at how Windows 95 and Windows 98 handle partitions using the FAT 16 and FAT 32 FIle System, and the various sorts of entities that may be constructed from them. Well complete this picture by considering file systems under Windows NT and how it works.

TYPES OF FILE SYSTEMS:
Let us recap on what we have read so far so as be aware of how theis concept of file systems work and how it will affect what weare going to learn furhter on with the NTFS file system

Over the years, Windows NT has supported the following file systems:

FAT:
The 16-bit file system type supported by DOS and Windows 3.1/ Windows 95 systems. However, Windows NT does not support the Windows 95 FAT-32 file system, a 32-bit version of FAT.

 CD-ROMs:
Windows NT provides transparent support for reading CDs in the standard ISO 9660 format.

 HPFS:
Previous versions of Windows NT supported the HPFS file system, which is the native OS/2 file system type. However, support for HPFS was removed from Version 4.0.

 NTFS:
The NTFS file system is a file system type created especially for Windows NT. NTFS is a vast improvement on the FAT file system. It can be used for all file systems on Windows NT systems. I recommend it in all cases except when you need to share a partition with a dual-booted UNIX or DOS operating system in read-write mode. The NTFS file system includes the following common features of modern file systems:

JOURNALING:
  Like many modern file systems found on UNIX, the NTFS file system is journaled. All changes to the file system structure are recorded in a log file before being carried out, for example, what file a particular disk cluster belongs to (beware that this does not include the actual contents of files, that is, the data stored in that particular cluster). When the system boots, the NTFS file system structure is automatically synchronized with the contents of its log. This technique, borrowed from real-time transaction processing, ensures that the file system is always in some consistent state. Note, however, that this does not always prevent data loss. For example, in the event of a power failure, the file system may be restored to some consistent state that existed shortly before the power went out, and subsequent additions to the file system may not be recoverable.

A LAZY-WRITE SCHEME:
  Disk writes are made to a cache in memory rather than directly to disk, and the cache is periodically written to disk as a background operation. The purpose of such write strategies is to optimize overall system I/O performance. In some cases, it can result in file changes being lost in the event of a power failure. Note that FAT file systems on Windows NT also use a lazy-write strategy (in contrast to the DOS careful-write scheme).

DISCRETIONARY ACCESS CONTROL (DAC):
  DAC provides for enhanced file security over the more primitive schemes used on Windows and UNIX systems. Access control lists (ACLs) enable permitted and forbidden access to be specified in considerable detail on a file-by-file basis.

Table: IMPORTANT MFT METADATA FILES:

$Mft           --  Master file table (MFT) table of contents
$MftMirr   --  Location of the copy of the metadata files elsewhere on disk
$LogFile --  Transaction log (deployed as a circular buffer)
$Volume --  Information about file system volume (including its name and NTFS version)
$AttrDef   --  Attribute definition table
$.               --  Root directory
$Bitmap   --  Cluster bitmap file indicating the used/ free status for each cluster in the file system
$Boot       --  Boot file
$BadClus-- List of bad clusters
$Quota    --  Reserved for future use for disk quotas (unused at present)
$Upcase -- Unicode lowercase-to-uppercase conversion table (for translating file names)

MIRRORED MASTER FILE TABLE AND BOOT SECTOR:
 
The NTFS file system stores a second copy of the files specifying the file systems structural and boot-related data in the middle of the disk.

MASTER FILE TABLE (MFT):
  The NTFS file system is structured around the MFT. The first 16 records of the MFT hold structural information about the file system, and all other files/directories in the file system exist as later records in the MFT. The table above shows the most important MFT metadata files.
A file itself is a collection of attributes stored in an MFT record (and possibly elsewhere on disk). The following are the most important attributes:
Basic file information such as the files DOS attributes (the read-only, hidden, system and archive bits), its creation, modification and access times and the number of hard links to the file.
The name of the file. Note that more than one file name attribute is usually present, holding the files long file name, its short (eight-plus-three) DOS-style file name and alternate file names for files to which there are multiple hard links.
A security attribute holds the files Windows NT DAC-based access permissions.
The data attribute, comprising some or all of the data stored in the file.
Additional indexing data for directories. For all but the smallest files, the data attribute is too large to fit into the MFT record. In this case, the attribute indicates the disk locations of the actual data. In some cases, the security attribute is too large to fit into the MFT record and so is handled similarly. Occasionally, the MFT record data itself grows beyond a single record. In this case, additional MFT records are used an attribute list is created for the record detailing the list of the attributes for the file along with their respective MFT record locations.
I recommend two reference works that describe the NTFS
file system in more detail: Inside the Windows NT File System
by Helen Custer, Microsoft Press, ISBN 1-55615-660-X; and
Windows NT File System Internals: A Developers Guide by
Rajeey Nagar, OReilly & Associates, ISBN 1-56592-249-2.

CREATING AN NTFS FILE SYSTEM:
An NTFS file system may be created on a disk partition (or other defined entity such as a stripe set) using the Disk Administrator tool or from the command line using the ‘format’command. (On Alpha systems, the Disk Setup facility of the AlphaBIOS program can also be used to format disk partitions.) In the first method, start the Disk Administrator and select the desired partition (or other item). Then, use the ‘Tools=>Format’ menu path to format the selected disk partition. If this menu item is disabled, select the ‘Partition=> Commit Changes Now menu’ path to force any modifications to the current disk configuration to be written to the device. The resulting dialog box is illustrated in Figure 1. The various fields in the dialog box indicate the file systems total capacity and allow you to specify the file system type, the allocation unit size (discussed below) and a volume label. The check boxes at the bottom request a quick format operation (if possible) and specify whether or not automatic file com-pressionis turned on by default for this file system.
The ‘format’command can be used to create (or re-create) a file system on any defined disk drive from the command line.
For this purpose, it has the following basic syntax:
format [/fs :ntfs] [ v/: label] [/C] [/A : n] x:
where x is the drive letter of the partition you want to format.
The ‘/fs’option specifies the type of file system to be created;
its argument must be either ‘ntfs’or ‘FAT’ beware that FAT is the default for a new file system. The ‘/V’option sets the label of the new file system to label; the ‘/C’enables automatic file compression for the file system. The ‘/A’option specifies the file systems allocation unit size. This parameter specifies the unit in which disk space is allocated (the cluster size). It defaults to 512 bytes for file systems of 512 MB or less, to 1 KB for file systems between 513 MB and 1 GB, to 2 KB for file systems between 1 GB and 2 GB, and to 4 KB for file systems 2 GB or higher.It’s valid range is any power of 2 from 512 bytes to 64 KB. How-ever file compression cannot be performed on file systems using a cluster size of more than 4 KB.
In most cases, the default value works fine. You might want to use a smaller size if you anticipate that the file system will be used for many very small files (smaller than the default allocation unit size). In this case, a smaller size might reduce the amount of internal wasted space. At the other extreme, if the file system will be used exclusively by an application that performs very large I/O operations (say, hundreds of KB at a minimum), then a larger cluster size will sometimes improve its I/O performance. For example, the following command creates an NTFS file system on drive D: with an allocation unit size of 4 KB and automatic file compression enabled, labeling the file system as ‘John’:

C:\> format /C /fs:ntfs /A:4096 /V: John D:

CHECKING AND REPAIRING FILE SYSTEMS:

All file systems become corrupt from time to time. The ‘chkdsk’ utility can be used to check the file systems structural integrity and repair any problems within it. This utility is similar to the UNIX ‘fsck’command, which compares items such as the volume bitmap against the disk portions assignedto files in the file system. As with ‘fsck’, chkdsk’s scope is limited to repairing the structure of the file system; it can do nothing for corrupted data within otherwise intact files.
A systems administrator will only rarely need to run this utility manually for NTFS file systems, when flaky system behavior leads you to suspect there may be file system corruption. However, because FAT file systems in traditional Windows environments are notoriously prone to corruption, I still run chkdsk manually on them once in a while (whether they need it or not). This is probably just superstition on my part, but it comforts me.
chkdsk’s ‘/f’ option says to find and repair any problems with the specified file system. The following command checks and repairs the file system on drive D:, for example:

C:\>  chkdsk /f D:

If the file system is in use when you execute this command, you will get a message allowing you to schedule the check at the next system boot:

this is the message you will get when trying to run ‘chkdsk’ while the file system is in use.

The type of File System is NTFS. Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts? (Y/N): Y

AUOTMATIC FILE COMPRESSION:

As weve just noted, optional automatic file compression is available for NTFS file systems. When such file compression is  enabled, it occurs transparently to the user: No special actions  are needed to access compressed files, and files are compressed in place. Compression can be enabled for the file system as awhole when it is created, or individually for directory trees and individual filesthe former effectively enables compression for the file systems root directory. Note that the compression status of a directory is used as a default value for its component files, and it is propagated to all files and subdirectories subsequently created within it. Compression can also be enabled for individual files even if their parent directory has it disabled.
You can modify the compression setting for a particular file or directory via the General tab of the items Properties. For a directory, checking the Compress box in the Attributes area at the bottom of the panel (see Figure 2) will enable automatic file compression for that directory and immediately compress all files within it (you also have the option of enabling and compressing any subdirectories within it at the same time). For an individual file, checking the same box (labeled Compress) will compress that file. Similarly, clearing the check box for a compressed item will disable automatic file compression and expand the corresponding compressed file(s).
The ‘compact’ command may be used to enable and disable automatic file compression and compress/expand files via the command line. It has the following syntax:

compact  [ /C | /U ] [options] [file(s)]

The first option specifies whether the items are to be compressed ‘[ /C]’ or uncompressed ‘[ /U]’. If neither of these is included, the command displays the current compression state of the specified  items, which defaults to files in the current directory.

Other useful options include:
[ /S]
Recurse all subdirectories under specified directories.
[ /I]  Continue processing after an error.
[ /Q]
Quiet mode: request terse command output.
For example, the following command will compress all of the files in the Data subdirectory and any subdirectories it may have, marking all of them as compressed directories.

C:\> compact / C / S data\*

In contrast, the following command will simply mark the ‘praks25’ subdirectory for automatic compression without affecting any of its current files or subdirectories, specifying terse command output:

c:\> compact /C /Q praks25

The Resource Kit includes the’compress’ command for more traditional manual file compression and expansion. It can create compressed or uncompressed versions of a set of specified files in place or in a separate directory location. For example, the following command creates a compressed version of each file in C:\Manhattan  in C:\New York:

c:\> compress C:\Manhattan\*.* C:\New York

The standard Windows NT ‘ expand’command performs the reverse operation using similar syntax. Both commands also have a ‘/R’ option that says to rename the created files using the standard renaming method: replace the final character of the file extension for the compressed version with an underscore,

for example, ‘Test.exe’ will become ‘Test.ex’

The Resource Kit also includes the ‘Expnd32’ command, a graphical utility for expanding files manually from the Windows NT distribution CD or other Windows distribution media.
Existing FAT file systems may be converted to NTFS file systems using the ‘convert’ utility. For example, the following command converts the file system on drive D: to an NTFS file system:

C:\> convert /fs:ntfs D:

The conversion process is nondestructive and preserves all existing files within the specified file system. NTFS file systems cannot be converted back to FAT, however. There are many ways of viewing information about a file system. For example, selecting a file system in the ‘My Computer’ view will display its total capacity and free space in the windows information bar (bottom center and right). Alternatively, the General tab of the Properties dialog box will display a file systems total capacity and current used and free space.

Joachim Marder has written a  utility which was sometime back featured on the website “www.bhs.com”named ‘TreeSize’. It summarizes disk usage on a directory-by-directory basis in a similar way to the UNIX ‘du’ command  Once the utility is running, you specify the directory you are interested in by selecting the File=>Select Directory menu path. The free space within the file system, the total number of files in it and its allocation unit size are displayed in the windows information bar.
There are several versions of the UNIX ‘df’ utility for Windows NT; most are part of various UNIX-compatibility packages. Listing 1 gives a simple Perl script that performs this same task. Here is an example of its use:

C:\> perl df . pl

Drive    Total      Free      Used

              MB         MB       MB

C:\        598          52        546

D:\        499          4         495

G:\      1019       1015          4

H:\       509         505           4

I:\         683        679           4

J:\       1161     1006        155

K:\       300            5        295

L:\        439       273        166

OTHER USEFUL UTILITIES

Well conclude this months column by considering some other freely available utilities related to file systems under Windows NT.
The freely available NTSync utility may be used to manually force all disk buffers to be written out at any time, thus performing the identical function to the standard UNIX ‘Sync’utility. Here is an example
of its use:

C:\> ntSync

NTSync 1.2 - Disk Flusher

          Flushing: C D G H I J K L
Drive letters display as each one is synched.

The utilitys ‘/R’ option may be used to include removable media (for example, Zip drives) in the operation. Note that the utility must be run from an Administrator account. There is also a freely available utility named ‘unmount’which can be used to unmount Windows NT file systems (provided there are no open files). It is designed primarily for use with removable media such as Zip, Jaz and EZ drives. This command will unmount the file system referred to by drive letter G:, for example:

C:\> unmount G:

The command will fail if there are any references to the file system. It will also not unmount partitions on disks containing multiple active partitions. The package also provides a ‘mnt’command for mounting unmounted file systems.
Mark Russinovich has also written ‘ntHandle’ another free utility that displays information about current open files
within the current file system.
NThas the following general syntax:

ntHandle [ /A] [ /P proc] [which-files]

By default, information on all open files is given. The ‘/P’ option limits the command to files belonging to the specified processes; its argument is a string that is used to match the process name (usually the executable name). The optional which-files argument may be used to limit the display to files matching the specified string. The ‘/A’option provides detailed information about each file handle.
For example, the following command lists information about all open files whose names contain ‘John D’Souza’:

C:\> ntHandle John D’Souza

EXCEL.EXE                    pid:         ff               D:\Work\John D’Souza.xls

CMD.EXE                         pid:      113              D:\WORK\John D’Souza.txt

more.com                          pid:      126               D:\Work\John D’Souza.txt

Thus I have  covered a lot of important functions and commands besides discussing on the filesystem in general using NTFS. I have reserached a lot to find, compile and put forth literature on this topic as a topic of personal interest and also in the interest of providing information on File Systems, not so widely available.

Should you be further  interested, I have on the next page, a Topic on the Distributed file system and the Network file system , both used by UNIX and other Unix based Operating systems

NETWORK FILE SYSTEM

DISTRIBUTED FILE SYSTEM

[Praks25] [Nexus] [Cities] [What's New] [My Profile] [The Year 2001]