Czech version
logolink

< Back to the list of lessons

Operating Systems II

ostatni-sinContent of the lesson:

  • Organization of Data on Drives (disk drives, files, directories, paths)
  • Types of File Systems (FAT, NTFS, EXT2, EXT3)

Organization of Data on Drives (disk drives, files, directories, paths)

Disk Drives

Disk drive can be used to store data in computer. It can be represented by a single hard drive, its part (partition) or a device for reading removable media (for example diskette drive, CD-ROM, DVD-ROM, ...).

In case you work with the operating system MS DOS or MS Windows, you will see that disk drives are labeled by letters from A to Z. These letters are usually assigned using the following way:

  • A: B: - diskette drives
  • C: - system partition of hard drive
  • D: E: F: ... - additional hard drives, additional partitions of hard drives (so called logical drives), CD, DVD, Flash disk, ...
Diskové oddíly
Hard drives

The rules which were mentioned above are valid only for operating systems MS DOS or MS Windows. In case that you want to work with the operating system GNU/Linux or Apple Mac OS (or other UNIX systems) you will have to use different layout of drives. The file system is created by the main root folder (marked as "/") which consists of single folders. These folders can represent folders on the system drive or on another disk drive. The situation can be like the following sample:

  • / ... system
  • /home ... partition with user data
  • /swap ... partition with virtual memory
  • /zaloha ... hard drive with data backup

File

A file is a basic object which is used to store data on recordable media. We can define it as a set of logically connected elements which can represent an application or specific data.

The name consists of two basic parts: name (which characterizes the content) and extension (which characterizes the type of file) - the extension is separated by a dot. The name should characterize the content as well as possible but you should keep several rules. Those rules depend on the operating system. Under operating system MS DOS users could use only 8 characters for the name and 3 characters for the extension (on the top of that you could only use characters from English alphabet and several special characters as for example '_'). Under the currently used operating system MS Windows 7 the rules are much more liberal, the file name can be up to 260 characters long (including the complete path to he file) and cannot contain the following characters: \ / ? : * " < > .

Characters ? and * can be used in different commands when searching files according to a given specification. The character * represents any number of characters and the character ? represents any single character.

File Extensions

The extension is a non-compulsory part of file which is separated by a dot. The extension usually contains 3 or 4 characters which characterize the type of the file.

Type of fileFile extension
Executable file exe (executable file)
bat (batch file)
Text document txt (non-formatted text file)
rtf (rich text format)
doc (Document MS Word 2003 and older)
docx (document MS Word 2007 and newer)
odt (document OpenOffice Writer)
pdf (Portable Document Format)
Table xls (Document MS Excel 2003 and older)
xlsx (document MS Excel 2007 and newer)
ods (document OpenOffice Calc)
Presentation ppt (Document MS PowerPoint 2003 and older)
pptx (document MS PowerPoint 2007 and newer)
odp (document OpenOffice Impress)
Graphical file (image) jpg, jpe, jpeg (Joint Photographic Experts Group)
gif (Graphical Interchange Format)
png (Portable Network Graphics)
bmp (Bitmap file)
pcx (PC Paintbrush format)
tif, tiff (Tag Image File Format)
Audio file mp3, mpeg3 (MPEG Audio Layer 3)
wav (Waveform sound)
mid (Musical Instrument Digital Interface – MIDI)
aac, mp4 (compression MPEG 4)
wma (Windows Media Audio from Microsoft)
Multimedia files (audio/video) mpg, mpeg (Moving Picture Experts Group)
avi (Audio Video Interleaved)
asf (Advanced Streaming Format)
qt, mov (QuickTime)
mp4 (compression MPEG 4)
wmv (Windows Media Video from Microsoft)
webm (Google WebM)
Archive files (compressed) zip, rar, arj, gz, gzip, ...
Additional formats ttf (True Type Font)
dwg (Autocad Drawing)
dll (Dynamic Link Library)

Associations

Association is using a file type to launch an action which is associated to this extension (for example a file with extension XLS is opened in MS Excel and automatically loaded). When setting the association you should pay attention because the application has to be able to open the requested format of files.

Asociace
Association

Directory

Directory (or subdirectory) is a space on the drive which can contain files or additional (sub) directories. Directories create a structure and when naming them you should follow the same rules as for files (you only cannot use the extension).

The top level directory is being called as root directory. It is usually marked with the letter of drive and the backslash (for example "C:\"), in case of the Linux operating system, it is marked only with the backslash ("/") and marks the root folder of the system disk.

There cannot be two subdirectories or files of the same name in one directory but you can use two identical names in different folders.

Shortcut

A shortcut is a file with link on another directory or file and contains no data or program.

Path

A path sets the exact place of file in the tree structure of directories. It is given by single folders and subfolders which are separated by a separating character. MS DOS and MS Windows use the character \ and GNU/Linux or Mac OS X use the character /.

A path can be written using two ways:

  • absolute (full) – it always begins with the root directory, sometimes also with the disk name - for example C:\Dokumenty\Záloha\photo.jpg
  • relative (not full) – it begins with the current folder - . current folder, - .. parent folder, for example recenze.doc (or .\recenze.doc).

Organization of Data on a Drive

Basic terms:

  • Cluster (allocation unit) – the smallest logical data unit on a drive which consists of several blocks (see the image below this text) - the number of sectors in the cluster depends on the drive capacity. The bigger is the drive, the bigger is the size of clusters - but if you save only 1B file, you will need one whole cluster to store it.
Struktura pevného disku - cluster
Structure of hard drive - cluster
  • Master Boot Record (MBR) – it is saved in the zero sector of zero track on the drive and has two parts: partition table and booting record. This is a short program which is launched by BIOS when computer is turned on, its task is to load the partition table and to find the active area to lead system.
  • Virtual memory – this is used to "enlarge" the capacity of operating memory. In case that the system requires more memory than the available RAM module can supply, data (unused memory blocks) are saved to a file on hard drive. It is only an emergency solution because the access to a hard drive is much slower than to the RAM memory. The virtual memory is represented by the file pagefile.sys under MS Windows, this file is usually saved on the system partition of the hard drive (if you do not change the settings). In case of the GNU/Linux operating system the virtual memory is saved to a separated disk partition which is usually named as /swap.
  • Data defragmentation – permanent working with files on a hard drive (saving, deleting) causes that files are broken to pieces. The defragmentation places these pieces together (to the following clusters) which can rapidly speed up the work with these files.
Nástroj pro defragmentaci ve Windows 7
Defragmentation tool under MS Windows 7

Types of File Systems (FAT, NTFS, EXT2, EXT3)

  • File system consists of two parts - set of files which contain saved information (data and programs) and structure of directories which consists of information about the files.

FAT (File Allocation Table)

The file system FAT firstly appeared in the predecessor of the operating system MS DOS and is used until now with several modifications. The advantage is its usability for the most of operating systems (for example MS Windows, GNU/Linux, Mac OS X), the disadvantage is limited size of hard drive and limited maximal size of file. The basic variants which are commonly used are summarized in the following table.

File systemMaximal drive sizeMaximal file size
FAT12 do 16 MB 4 GB
FAT16 16 MB až 2 GB
FAT32 512 MB až 2 TB

Structure of FAT:

  • The main boot record and the boot record of the extended partition
  • The boot record of the drive
  • Allocation table of files
  • Root directory
  • Clusters (single allocation units in the data area)
  • Diagnostic cylinders for reading and writing

NTFS (New Technology File System) – allows you to define access rights for single files and directories

The file system NTFS is a native file system in operating systems Windows NT/2000/XP/Vista/7 (it is not compatible with the previous versions).

This file system supports names of files up to 255 characters long. One file or partition can be up to 16 EB large (exabytes = billion of GB) and unlike the FAT file system it supports file encrypting and defining user rights.

Ext3

A native file system in the operating system GNU/Linux. The maximum file size is 2 TB and the maximum partition size is 32 TB. You can also see file systems ReiserFS, Reiser4, XFS or JFS under GNU/Linux operating system.

ExFAT

This file system replaced the FAT file system because it removes its main disadvantages - the limitation of partition and file sizes. The file size is limited to 16 EB (exabytes = billion of GB) and the maximum size of partition is limited to 128 EB (exabytes = billion of GB) .

This file system is copyrighted by Microsoft but you can use it in the most of nowadays operating systems. Unlike the NTFS system it is designed rather to be used for external devices to store data (for example flash disks, memory cards).

Support for file systems in operating systems

Podpora jednotlivých souborových systémů v operačních systémech
Support for file systems in operating systems

Questions

  1. What is a file and which extension can it have?
  2. Explain the term association.
  3. How can you use the virtual memory?
  4. What is the purpose of defragmentation?
  5. What is the difference between FAT32 and NTFS?
webdesign, xhtml, css, php - Mgr. Michal Mikláš