CEST-CE Term_2 GNU/LINUX (Week 5)
40 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the maximum size of a disk supported by the MBR partition table?

  • 1TB
  • 2TB (correct)
  • 10TB
  • 5TB
  • What is the purpose of an extended partition?

  • To boot an OS
  • To store system files
  • To store data
  • To contain logical partitions (correct)
  • What is the naming convention for SATA/SCSI storage devices in Linux?

  • /dev/storageX
  • /dev/sdX (correct)
  • /dev/hdX
  • /dev/diskX
  • What is the purpose of a file system?

    <p>To store files and data</p> Signup and view all the answers

    What is the command-line tool used to create partition tables and partition disks in Linux?

    <p>fdisk</p> Signup and view all the answers

    What is the purpose of creating a file system inside a partition?

    <p>To allow the OS to store files</p> Signup and view all the answers

    What is the naming convention for partitions on a storage device in Linux?

    <p>/dev/sdXN</p> Signup and view all the answers

    What type of partition is used for data storage?

    <p>Logical partition</p> Signup and view all the answers

    What is the usual form of the device name used in file system creation?

    <p>/dev/sdXN</p> Signup and view all the answers

    What is not checked by the mkfs commands?

    <p>The type of partition in the partition table</p> Signup and view all the answers

    What is the purpose of the mkswap command?

    <p>To initialize a Linux partition as a swap partition</p> Signup and view all the answers

    What is the consequence of not specifying the correct device name when using mkfs?

    <p>The existing data in the partition will be destroyed</p> Signup and view all the answers

    What is the purpose of the fsck command?

    <p>To check a file system for inconsistencies or errors</p> Signup and view all the answers

    What happens when you run the mkswap command on an existing partition?

    <p>The partition is initialized as a swap partition, destroying any existing data</p> Signup and view all the answers

    What is the purpose of the swapon command?

    <p>To connect a swap area to the system</p> Signup and view all the answers

    What happens when you create a partition with fdisk?

    <p>Nothing is done to the partition</p> Signup and view all the answers

    How do you list all currently active swap areas?

    <p>Using the swapon -s command</p> Signup and view all the answers

    What is the benefit of using journalling file systems?

    <p>They are more resistant to power loss</p> Signup and view all the answers

    What is the purpose of the file -s command?

    <p>To find a file system inside a disk partition</p> Signup and view all the answers

    What is the purpose of the swapoff command?

    <p>To deactivate a swap area</p> Signup and view all the answers

    What happens when you create a file system with mkfs?

    <p>The file system is created but not mounted</p> Signup and view all the answers

    What happens when you run the swapon -a command?

    <p>All partitions in /etc/fstab marked as swap are connected and used as swap areas</p> Signup and view all the answers

    What happens to partitions in /etc/fstab marked as swap at boot time?

    <p>They are automatically connected and used as swap areas</p> Signup and view all the answers

    What is the purpose of the -a option with the swapoff command?

    <p>To disconnect all active swap areas</p> Signup and view all the answers

    What happens when you specify the device name or mount point to the mount command if the file system is listed in the fstab?

    <p>The mount command will read the other information for the mount from the /etc/fstab file.</p> Signup and view all the answers

    What is the purpose of the swap partition?

    <p>To implement Unix/Linux Virtual Memory</p> Signup and view all the answers

    What is the default option for mounting file systems specified in the fstab?

    <p>auto</p> Signup and view all the answers

    What option in the fstab file allows a non-root user to mount and unmount a file system?

    <p>user</p> Signup and view all the answers

    What is the purpose of setting the partition type ID to Linux Swap when creating a swap partition?

    <p>To document that the partition is a swap partition</p> Signup and view all the answers

    What is the default mount option for file systems specified in the fstab?

    <p>rw</p> Signup and view all the answers

    What command is used to create a swap partition?

    <p>fdisk</p> Signup and view all the answers

    What is the effect of the noauto option in the fstab file?

    <p>The file system will be ignored by the mount -a command</p> Signup and view all the answers

    What type of file system is suitable for USB keys, floppy disks, and Microsoft compatibility?

    <p>vfat</p> Signup and view all the answers

    What command is used to create a file system on a partition?

    <p>mkfs</p> Signup and view all the answers

    What type of file system is created by default if no type is specified?

    <p>ext2</p> Signup and view all the answers

    What must exist before creating a file system?

    <p>A partition</p> Signup and view all the answers

    What type of file system is recommended for modern Linux hard disk systems?

    <p>ext4</p> Signup and view all the answers

    What is the purpose of the /usr directory?

    <p>Operating system, application, and documentation files</p> Signup and view all the answers

    What type of file system is suitable for journaling?

    <p>ext4</p> Signup and view all the answers

    What is the minimum requirement for mounting a file system?

    <p>A file system</p> Signup and view all the answers

    Study Notes

    Partition Table and Partitioning

    • Partitioning is the process of dividing a storage device into multiple partitions.
    • The partition table contains information about the partitions, including the range of sectors used by each partition.

    Partition Table Types

    • MBR (Master Boot Record) partition table supports disks up to 2TB in size and allows for:
      • Up to 4 primary partitions (where an OS can be booted from)
      • One of the primary partitions can be an extended partition
      • Extended partition is a container for logical partitions (used for data storage)

    Devices and Partitions in Linux

    • Devices in Linux can be found under the /dev directory.
    • Disks and partitions follow specific naming conventions:
      • SATA/SCSI storage devices are named /dev/sdX where X is the device letter (e.g., /dev/sdd is the 4th storage device)
      • Partitions on a storage device are numbered /dev/sdXN where N is the partition number (e.g., /dev/sdb3 is the 3rd partition on the 2nd storage device)

    Partitioning in Linux

    • The fdisk program can create partition tables and partition disks.
    • A usage example is available on the Linux Documentation Project.

    File Systems

    • Creating a partition using fdisk only divides the space on a disk; it doesn't create a file system.
    • A file system is needed to store content inside the partition.
    • A file system is a way of storing content inside a disk partition, and there are many types of file systems, each with different characteristics.
    • Linux supports a huge number of file systems.

    Creating a File System

    • Use mkfs to create a file system on a partition.
    • Example: mkfs -t ext4 /dev/sda1 creates an ext4 file system on the 1st disk, 1st partition.

    Mounting a File System

    • Use mount to mount a file system.
    • The fstab file contains information about the file system, including the device name, mount point, and options.
    • Example: mount /dev/sda1 mounts the file system on the 1st disk, 1st partition.

    Swap Partitions

    • A swap partition is used to hold memory pages for Unix/Linux Virtual Memory.
    • The swap partition needs to be created and initialized using fdisk and mkswap.
    • Example: mkswap /dev/sdb9 initializes a swap partition on the 2nd disk, 9th partition.

    Virtual Memory

    • Virtual memory is implemented using swap partitions.
    • Swap partitions are usually only one per system, but systems with a lot of memory may have more.

    Creating and Using Swap Partitions

    • Step 1: Create the partition using fdisk.
    • Step 2: Initialize the swap area using mkswap.
    • Step 3: Connect the swap area to the system using swapon.
    • Use swapon -s to display currently active swap partitions.
    • Use swapon -a to connect all swap partitions listed in fstab.

    Choosing a File System Type

    • Journalling file systems (e.g., ext4) are more resistant to corruption due to sudden power loss.
    • Use mkfs with the -t option to specify the file system type (e.g., mkfs -t ext4 /dev/sda1).

    File System Organization

    • The file system organization is as follows:
      • /opt: Optional software, installed outside the package management system.
      • /proc: Virtual file system, can be used to read kernel and process information.
      • /root: The home directory for the root account.
      • /sys: Virtual file system, information on the system and its components.
      • /tmp: Temporary files, for short-term storage.
      • /usr: Operating system, application, and documentation files.
      • /usr/bin: User commands applications, can be executed by regular users.
      • /usr/sbin: Admin commands applications, need to be root to run.
      • /var: Files expected to be changing often (variable content).

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Week 5.docx

    More Like This

    Use Quizgecko on...
    Browser
    Browser