# LPI Linux Certification/LPIC2 Exam 201/Filesystems

* LPIC2 Exam 201
* Detailed Objectives
* Linux Kernel
* System Startup
* Filesystems
* Hardware
* File and Service Sharing
* System Maintenance
* System Customization and Automation
* Troubleshooting
* Exercises results

## Section Overview

* Operating the Linux filesystem
* Maintaining a Linux filesystem
* Creating and configuring filesystem options

## Operating the Linux filesystem
### Overview

Description: Candidates should be able to properly configure and navigate the standard Linux filesystem. This objective includes configuring and mounting various filesystem types. Also included, is manipulating filesystems to adjust for disk space requirements or device additions.
Key files, terms, and utilities include:

### Mounting and unmounting partition

To access an existing partition you need to mount it first using the mount command.
For example if you want to mount a ntfs partition on /mnt/windows you should issue the following command:
Of course you need to change hda3 with your ntfs partition.
To umount a partition you simply need to use umount
or
If you use mount without arguments it will print the currently mounted devices, you can also see /proc/mounts and /etc/mtab to discover which partition are currently mounted.

### Fstab

If you want to use a more automatic method to mount filesystem you should edit /etc/fstab
In the above example of /etc/fstab we have the ntfs partition mounted automatically during the system boot on /mnt/windows, while on the cdrom and floppy devices we have specified the noauto and user options, this means that they aren't mounted during boot but also that any user can mount it whenever they need. The sixth field should be 1 for root filesystem and 2 for other fs that need to be checked with fsck during boot.

### Swap

The swap partition can be used as virtual memory, to create a swap partition you should use mkswap
and need to be activated with swapon
you can also deactivate it with swapoff

### Sync

The sync utility can be used to force the change onto the partition, modern filesystem like ext3 or reiserfs sync the partition every time that a change is made so you don't need to issue the command manually.
=== Exercises ===.

## Maintaining a Linux filesystem
### Overview

Description: Candidates should be able to properly maintain a Linux filesystem using system utilities. This objective includes manipulating a standard ext2 filesystem.
Key files, terms, and utilities include:

### Formatting a partition

Before you format a partition you need to choose the right filesystem for your needs. The most common filesystem on linux is ext3 which is a journaled filesystem based on ext2. To format a partition with a filesystem you need to use the mkfs.* commands
to create an ext2/ext3 filesystem you can also use the mke2fs utility

### Configuring and repair filesystem

tune2fs it's an utility used to tune ext2/ext3 filesystem
you can also tune a reiserfs partition using reiserfstune
to check a filesystem for errors you can use fsck.*
you can also just run fsck /dev/hda1 directly and it will detect the filesystem
=== Exercises ===.

## Creating and configuring filesystem options
### Overview

Description: Candidates should be able to configure automount filesystems. This objective includes configuring automount for network and device filesystems. Also included is creating non ext2 filesystems for devices such as CD-ROMs.
Key files, terms, and utilities include: