CPS100 • INTRODUCTION TO COMPUTERS


SUMMER 2018 Semester • LAKELAND UNIVERSITY

Volumes and Folders

Filesystems keep files organized by placing them into directories. You have seen a directory before, many times: you call them folders. "Directories" and "folders" are the same thing.

Like volumes, folders contain data. However, while volumes are physical devices, folders are imaginary locations. You cannot touch a data folder. Because of this, folders are always inside volumes, but volumes are never actually inside folders.

However, what controls this? What controls the rules regarding filenames? What system is used to organize drives? How is the address of any data point decided and stored? This and many other points are decided by the filesystem.

The Filesystem


A filesystem is a set of rules about how storage works. The filesystem dictates how the volume is structured, how data is saved to which locations on the disk; how that data's location is recorded; how information about the data is kept; how the data is marked for deletion, and how it is deleted.

Modern computers use filesystems that fit the needs of modern computing. For example, older filesystems only allowed very short filenames, using limited character encodings. Newer filesystems allow very long filenames (255 characters long) using almost any language. Older filesystems could only allow files up to a few gigabytes in size; newer filesystems allow for huge file sizes. As computers grow more powerful and flexible, filesystems must change to allow for this growth. In addition, filesystems are always improving.

There are many different filesystems. Each operating system has its own favorite filesystem. This is similar to the way people organize their own files, or even their kitchens.

If you visit another person's house and try to use their kitchen, you will quickly become confused. Some things may be obvious—for example, you will probably find silverware in a flat drawer close to the sink, and you may find cleaning supplies under the sink. However, most items will be stored in ways different from your own kitchen. You will not be able to find anything without a search. This is because each person has their own system and preferences for how things are arranged.

The same is true for filesystems: each one has its own way of handling files.


Here are the major filesystems in use:

  • Microsoft Windows uses NTFS ("New Technology File System"), introduced in 1993.
    • FAT32 is an old alternate filesystem made by Microsoft in 1996.
    • ExFAT is an alternate filesystem made by Microsoft in 2006.
  • Mac OS X uses HFS+ ("Hierarchical File System Plus"), introduced in 1998.
  • Linux uses ext3 ("Third Extended Filesystem"), introduced in 2001.

Each operating system has it's own major filesystem. Windows has NTFS. MacOS has HFS+. Linux has ext3.

These primary filesystems are exclusive: NTFS is only used by Windows; HFS+ is only used by Macs; ext3 is only used by Linux. These could be called native filesystems. Each filesystem is developed to fit the features and needs of each operating system.

While a computer can read and use multiple filesystems, each one "prefers" the native filesystem, which was created especially for that operating system. The native filesystem will work better and faster with that computer.

Without special assistance, none of the operating systems can read disks formatted with the main filesystem of another operating system. Macs cannot read NTFS, Windows cannot read ext3, and Linux cannot read HFS+. However, it is possible to buy software which allows one operating system to read disks formatted by other major filesystems (for example, a program called "Paragon NTFS for Mac" allows Macs to read disks formatted with Windows' NTFS filesystem).


A volume, such as a hard drive, may be blankā€”it has no data, not even a filesystem. If you try to connect a blank disk to a computer, the computer will report that the disk cannot be read—and it asks you if you wish to format the drive. When you format the drive, you can choose a filesystem.

The computer's main HDD and SSD drives use the operating system's main filesystems. However, external storage might be shared between computers. So, which filesystems do they use?

The answer is usually FAT—either FAT32, exFAT, or a similar version of the FAT filesystem. The FAT filesystems are older ones used previously by Microsoft. These filesystems can be read and understood by any operating system. Therefore, they serve as popular filesystems for external and portable drives.

If you will use an external hard drive with only one kind of computer, you should format the drive as NTFS if you use Windows, or as HFS+ if you use a Mac. USB Flash drives will probably work best using ExFAT, unless you also use the USB drive with only one type of computer.

The Filesystem and Files

The filesystem must keep certain information about each file. Each file has the following information, called metadata, which is about the file:

  • file size: the filesystem much know how many bits of data are in any one particular file.
  • location on the disk: the filesystem must keep track of where all the data in the file is located, so it can be accessed. Some files are divided into parts in different locations on the disk.
  • dates associated with the file: the filesystem should know when the file was created, when it was last modified, and when it was backed up.

There are many, many other possible metadata; a common digital photograph might have dozens of kinds of metadata, including the camera name, the shutter speed, the aperture, the exposure levels, and more.

Very basic metadata is stored in a directory table. However, many types of metadata are stored within the file, and are carried with that file when it is moved to another computer. In fact, this can cause problems. For example, many years ago, when you posted an image on Facebook, the original image was displayed on the web site. However, that original image had the image's metadata, such as the date and time it was taken—but sometimes even the GPS coordinates were included!

This caused severe privacy issues. For example, if a parent took a photo of their child at school, at home, or in a playground, the metadata would show exactly where and when the child was. This could allow criminals to know where to find the child at various times of the day.

As a result, Facebook now removes the metadata from files before displaying them.

Why Else Should You Care? Deleting Files, That's Why.

This is important to know because of how your computer erases (or does not erase) data.

Consider how your computer saves and deletes data. If you save a 3 GB file on your hard drive, it may take 1 minute or longer for the copy to be completed. That's the amount of time necessary to write all the 1s and 0s in the file.

However, when you empty your recycle bin / trash, the file seems to disappear almost instantly.

If it took more than a minute to write the 1s and 0s, why did it take no time to delete the 1s and 0s?

The answer is simple: the data was not really deleted! The filesystem is designed to prevent accidental data loss. As a result, the computer tries to not delete the information until it is necessary.

At first, all the filesystem does is mark the file for deletion. In one example, the filesystem goes into the metadata in the directory table, and replaces the first character of the filename with a "sigma" (σ or Σ).

The file's data is still there. The metadata is still there. All the computer did was to tag the file, essentially saying, "This space is free to use, but we'll keep the data as long as we can."

In some filesystems, the data can easily be recovered. In other filesystems, you must use special recovery software to get the data back.

As time goes by, and you need more disk space, the filesystem will eventually use the file's space, over-writing the data. When that happens, then the data is erased.

It is important to understand that data still exists on a computer even after the files have been "erased."


How Can I REALLY Get Rid of the Data?

Some people imagine that all they have to do is re-format the disk. This could work, but only if you do it the right way. Sometimes, reformatting the disk only takes a few moments. If that is the case, then the data is not being erased!

Data is only truly erased when it is over-written, when you write new data on top of the old data. This is done automatically by writing different data in the same location, but that might take some time. Another way to truly erase data is to zero out the data's location: to write all zeroes in the data location.

To zero out a whole hard drive could take hours. Therefore, if you re-formatted the drive in just a few moments, the data was clearly not erased. The computer just erased the filesystem and created a new one. But the data is still on the disk.

Have you ever sold or given away a computer you owned to someone else without zeroing out the hard drive? If you did, then that person could have uncovered all your old files—even files you thought you had erased months before!

Neither macOS nor Windows has a zero-out feature built in, but you can get various utilities that let you do this for Windows or Mac.


Partitions

A filesystem can create something called a disk partition.

A partition can divide one volume so it appears to be two or more partitions.

In this case, we can take a USB flash drive (which is a volume) and create partitions.

formatting a USB flash drive in Mac OS X

As you can see above, there is a flash drive called "USB Disk." It is a 4GB volume with a single partition, using the FAT filesystem.

In this case, I want two partitions. Under "Partition Layout," I choose "2 Partitions," at which time I can adjust the size of either one. Note that I have chosen a filesystem better for the Mac:

formatting a USB flash drive in Mac OS X

I can make various kinds of adjustments. For example, I can set up the device so it can be a "boot" volume—that is, I could install an operating system on it and use it to start up a computer (as an emergency disk).

Once I am finished, the computer confirms what I have set up:

formatting a USB flash drive in Mac OS X

After I have finished, the one USB flash device now appears as two volumes on the computer!

formatting a USB flash drive in Mac OS X

You might wonder, why do this? There are many possible reasons. Maybe you want one partition formatted best for Windows, and the other formatted for Mac. On a hard drive, you might divide the disk so that one partition is running Windows 7 in English, and the other partition is running Windows 8 in Japanese (having two operating systems on separate partitions is called dual boot).

Another use is for a restore partition, used to keep the operating system installer.

Terms to Know

filesystema system for handling files on a computer.
volumea physical storage device (e.g., HDD, SSD, CD, DVD, USB Flash).
folderalso "directory"; a grouping of files in a volume, in order to organize files and other folders.
metadatainformation about data (i.e., data about data).
directory tableone example of a location where file metadata is kept.
zero outalso "secure delete"; to completely and safely erase data by over-writing the data with zeroes.
NTFSThe default filesystem for Windows.
HFS+The default filesystem for Mac OS X.
FAT32 / ExFATWindows filesystems commonly in use; ExFAT is more modern and well-featured.
partitionA section of a volume which is separately formatted so that it appears to be a separate volume. Commonly used for dual boot (having two operating systems on one disk) or creating a "restore partition" with the operating system installer plus special drivers and utilities for that model of computer.


Previous Chapter Chapter Quiz Next Unit