Linux Flashcards
File Sytem ext2
The Second Extended File System (ext2) is one of the oldest Linux file systems still available.
• ext2 stores data in a standard directory and file hierarchy.
• The maximum file size supported is 2 TB.
• An ext2 volume can be up to 4 TB in size.
• File names can be up to 255 characters long.
• Linux users, groups, and permissions are supported.
• It does not use journaling (which is used in most modern file systems). As a result, ext2 takes a long time to recover if the system shuts down abruptly.
File System ext3
The Third Extended File System (ext3) is an updated version of ext2 that supports journaling. Before committing a transaction to a storage device, the ext3 file system records the transaction to the journal and marks it as incomplete. After the disk transaction is complete, the file system marks the transaction as complete in the journal. By doing this, ext3 can keep track of the most recent file transactions and whether or not they were completed. This allows ext3 to recover much more quickly than ext2 in the event of an unclean system shutdown.
File System ReiserFS
The Reiser file system (ReiserFS) is an alternative to the ext3 file system. Like ext3, Reiser uses journaling to make crash recovery very fast. However, Reiser is a completely different file system from ext2 and ext3, using a dramatically different internal structure. ReiserFS supports a maximum file size of 8 TB and maximum volume size of 16 TB. In addition, the structure of Reiser allows it to perform much faster than ext2 or ext3.
File System ext4
ext4 is the fourth generation file system in the ext file system family. ext4 includes all of the features found with ext2 and ext3, with the addition of the following features:
• Support for file sizes up to 16 TB and disk sizes up to 1 exabyte (EB)
• Allows for up to four billion files in the file system
• Uses checksums to verify the integrity of the journal file itself
Checksums help improve the overall reliability of the system because the journal file is the most heavily used file of the disk.
Swap
A swap file system is used as virtual memory (the portion of the hard disk used to temporarily store portions of main memory) by the operating system.
A recommended practice is to make the swap file size between 1 and 1.5 times the amount of memory on the computer.
CDfs
CDfs is a virtual Linux file system that provides access to individual data and audio tracks on compact discs (CDs). A compact disc mounted with the “CDfs” driver appears as a collection of files, each representing a single track.
File System XFS
The XFS file system was developed for the Silicon Graphics IRIX operating system. An XFS file system is proficient at handling large files, offers smooth data transfers, and provides journaling. It also can reside on a regular disk partition or on a logical volume.
Btrfs
Btrfs is a Linux file system that uses a copy-on-write file system. Using copy-on-write technology, Btrfs provides several key features not found in earlier file systems:
• Storage pools - Instead of using traditional disk partitions, Btrfs allows you to create storage pools from the storage devices in your system. From the storage pool, you can then allocate space to specific storage volumes. Instead of mounting partitions, you mount storage volumes at mount points in the file system.
• Snapshots - The snapshot functionality provided by Btrfs protects data. It can be configured to take snapshots of your data at specified intervals and save it on separate media. If a file ever gets lost or corrupted, you can restore a previous version of the file from a snapshot.
Cmd. ls
Displays a list of files and subdirectories that exist within a directory. Some options commonly used with the ls command include the following:
• -a Displays all files, including hidden files.
• -l Displays a detailed (long) listing of directory contents including ownership, permissions, modification dates, and file sizes.
• -R Displays the contents of the directory as well as all of its subdirectories.
Cmd. cp
Copies files and directories from one location in the file system to another. For example, to copy the widget.odt file to the /home/rtracy directory, you would enter cp widget.odt /home/rtracy at the shell prompt.
To copy an entire directory structure, include the -R option, which specifies that the directory contents be recursively copied.
Cmd. mv
Moves files and directories from one location in the file system to another. For example, to move the widget.odt file to the /home/rtracy directory, you would enter mv widget.odt /home/rtracy at the shell prompt.
Cmd. rm
Deletes files and directories from the file system. For example, to delete the widget.odt file, you would enter rm widget.odt at the shell prompt.
Cmd. cat
Displays the contents of a text file on the screen. For example, to view the contents of the widget.txt file, you would enter cat widget.txt at the shell prompt.
Cmd. less
Displays the contents of a text file on the screen, pausing the output one screen at a time. For example, to view the contents of the widget.txt file one page at a time, you would enter less widget.txt at the shell prompt.
Cmd. head
Displays the first few lines of a text file on the screen. For example, to view the first lines of the widget.txt file, you would enter head widget.txt at the shell prompt.