Understanding the File System Hierarchy and Mounting Devices in Ubuntu

198

Exercise 1: Exploring the File System Hierarchy

  1. Use the ls command to list the contents of the root directory (/). Identify the directories mentioned in the tutorial.
  2. Dive deeper into these directories, use cd to navigate and ls to list contents. Try to match the contents with the purpose of the directory described in the tutorial.

Exercise 2: Understanding the Purpose of Different Directories

  1. Write a short paragraph describing the purpose of each of the following directories: /etc, /home, /var, and /usr.
  2. Find a file in each directory that serves the purpose you described.

Exercise 3: Working with Mounted Devices

  1. Use the mount command to see all currently mounted devices. Identify at least five devices and the directories they’re mounted on.
  2. Run the df -Th command to view disk usage statistics for the mounted filesystems. Identify the filesystem with the most available space and the filesystem with the least available space.
  3. Use the findmnt command to display a tree-oriented list of all mounted devices. Identify any relationships between mounts.

Exercise 4: Creating and Mounting a New Filesystem

  1. Use the dd command to create a new 1GB file. Use this file to create a new ext4 filesystem using the mkfs command.
  2. Create a new directory under /mnt and mount the new filesystem there.
  3. Verify the mount using the df -hT command and identify your new filesystem and mount point.
  4. Test the new filesystem by creating files and directories within the mounted directory.
  5. Unmount the filesystem using the umount command and verify it’s no longer mounted.

Exercise 5: Analyzing the /boot directory

  1. Navigate to the /boot directory and list its contents.
  2. Identify the kernel and initramfs files.
  3. Explain the purpose of these files and why they need to be in a separate /boot partition.

Please note, the fourth exercise should be performed by users who are comfortable with the command line and have a good understanding of filesystems. As always, be careful when executing commands as root or with sudo, especially when they relate to filesystems or disks.