Disk Management Basics
40 Questions
0 Views

Disk Management Basics

Created by
@NeatestZither

Podcast Beta

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which command is used to create an ext4 file system on a specific partition?

  • sudo mount
  • mkdir
  • mkfs.ext4 (correct)
  • mkfs.xfs
  • What is the main purpose of the mount command?

  • To format a partition
  • To create a new directory
  • To attach a filesystem to a mount point (correct)
  • To delete a file system
  • What must you do before unmounting a filesystem?

  • Delete all files in the filesystem
  • Ensure all files in the filesystem are closed (correct)
  • Reboot the system
  • Use the mkfs command on the filesystem
  • What is a proper way to create a mount point in the /mnt directory?

    <p>sudo mkdir /mnt/mydata</p> Signup and view all the answers

    What type of file systems can be created using mkfs?

    <p>ext4, xfs, and vfat</p> Signup and view all the answers

    What happens if you format a partition improperly?

    <p>All data on the partition will be erased</p> Signup and view all the answers

    What should the directory be like before creating a mount point?

    <p>It should be empty or contain non-important data</p> Signup and view all the answers

    What is the function of the sudo command in the context of creating a mount point?

    <p>To run the command as a superuser for permission</p> Signup and view all the answers

    What is the first partition on the first drive named in a Linux system?

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

    Which command can be used to verify if a new disk has been detected in Linux?

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

    In Linux drive naming, what does 'sd' typically indicate?

    <p>SCSI or SATA Drive</p> Signup and view all the answers

    What should you always do before performing disk management tasks?

    <p>Back up important information</p> Signup and view all the answers

    What file does /dev/sdb2 refer to in a Linux system?

    <p>Second partition on the second drive</p> Signup and view all the answers

    Which command is NOT typically used for adding storage in a Linux environment?

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

    What does the 'Y' in the format sdXY or hdXY represent?

    <p>Partition number</p> Signup and view all the answers

    Which type of drive is indicated by 'hd' in Linux device files?

    <p>IDE or ATA Drives</p> Signup and view all the answers

    What does the 'RM' column indicate in the output of the lsblk command?

    <p>Whether the device is removable</p> Signup and view all the answers

    Which command can be used to create partitions on a newly attached disk?

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

    In the example output given, what is the mount point of sdb1?

    <p>/mnt/data</p> Signup and view all the answers

    Which of the following is a recommended use for a swap partition?

    <p>To store virtual memory when physical memory is insufficient</p> Signup and view all the answers

    What command is used to display details of all mounted filesystems?

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

    What does the 'SIZE' column represent in the lsblk command output?

    <p>The size of the device or partition</p> Signup and view all the answers

    Which filesystem is the root filesystem mounted as?

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

    Which partition is essential for a Linux system to function in single-user mode?

    <p>/ (root) partition</p> Signup and view all the answers

    What is the purpose of the /etc/fstab file?

    <p>To configure automatic mounting of filesystems</p> Signup and view all the answers

    Which command should be used to check and repair filesystems?

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

    If a device shows 'RO' as 1 in the lsblk output, what does it imply?

    <p>The device is read-only</p> Signup and view all the answers

    What type of entry is indicated by the 'TYPE' column in the lsblk output?

    <p>Disk and partition types</p> Signup and view all the answers

    In Logical Volume Management (LVM), what does VG stand for?

    <p>Volume Group</p> Signup and view all the answers

    Which command is used to create a logical volume in LVM?

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

    What type of filesystem is tmpfs?

    <p>Memory-based</p> Signup and view all the answers

    To ensure a filesystem is mounted automatically at boot, what should be added to the system?

    <p>A configuration file in /etc/</p> Signup and view all the answers

    What command is used to create a filesystem on a logical volume?

    <p>mkfs.ext4 /dev/my_vg/my_lv</p> Signup and view all the answers

    Which option modifies the output of the df command to show sizes in a human-readable format?

    <p>-h</p> Signup and view all the answers

    What does the 'du -sh' command display?

    <p>Disk usage of files and directories</p> Signup and view all the answers

    What is the purpose of the -T option with the df command?

    <p>To display the filesystem type</p> Signup and view all the answers

    Which command would you use to check the percentage of disk space used?

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

    In the example output of 'df -h', what does 'Avail' represent?

    <p>Space available for use</p> Signup and view all the answers

    Which of the following statements about LVM is true?

    <p>LVM allows for easy management of disk space.</p> Signup and view all the answers

    What command would you run to mount a logical volume to a specific directory?

    <p>mount /dev/my_vg/my_lv /mnt/mydisk</p> Signup and view all the answers

    Study Notes

    Disk Management

    • Disk Management is an essential aspect of systems administration, involving tasks such as adding storage, partitioning disks, formatting and managing file systems.

    • Caution: Handle disk management tasks with care, as modifications can impact your data. Always back up important information before making changes.

    Adding Storage

    • Physical Disks: Connect a new disk to your server. Verify that the disk is recognized in the BIOS/UEFI and ensure device files are created in the /dev directory.
    • Virtual Disks: In virtual environments (VMs or cloud), add a disk using the management tools or dashboards.

    Linux Drive Naming

    • Linux utilizes a different approach to drive naming compared to Windows.
    • Drives and partitions are represented as files located in the /dev directory.
    • The naming pattern is typically in the format of sdXY or hdXY, where:
      • X is a letter representing the physical drive (a for the first, b for the second, etc.).
      • Y is a number representing the partition on the drive (1 for the first, 2 for the second, etc.).
      • sd stands for SCSI drives, and it's also used for SATA drives and SAS drives found in modern systems.
      • hd stands for IDE or ATA drives, older drive types rarely used in modern systems.

    Verifying Detection

    • Use commands like lsblk to check if the system recognizes the newly added disk.

    lsblk Command

    • Lists all available block devices (disks and partitions).

    Creating Partitions

    • Partitions divide a disk into separate sections, each with its own file system.
    • This helps in organizing data and enhancing security.
    • Common examples include:
      • / (root) partition: for essential system startup files
      • swap partition: stores virtual memory
      • /home partition: stores user files
      • /boot partition: contains the boot loader and kernel.

    fdisk Command

    • A command-line tool for managing disk partitions.
    • You can use it to display information about disks and their partitions.

    Formatting Partitions

    • Use the mkfs command with the desired file system type (-t option) and device or partition name (e.g., /dev/sdX1).
    • Example: Creating an ext4 file system:
      • sudo mkfs.ext4 /dev/sdX1

    Mounting and Unmounting File Systems

    • Mounting makes a file system accessible, while unmounting detaches it.
    • Steps for mounting:
      • Create an empty directory as the mount point using mkdir.
      • Mount the partition to the mount point using the mount command.

    Automounting

    • By default, file systems mounted using the mount command are not automatically mounted at system boot.
    • To enable automatic mounting at boot, add an entry to the ** /etc/fstab** (file system table) file.

    Checking the File System

    • Use fsck to check and repair file systems.
    • Run it on unmounted file systems to avoid data corruption.

    Logical Volume Management (LVM)

    • LVM provides flexible disk management by abstracting physical storage into logical volumes.
    • This allows for easier disk space management, volume resizing, and snapshot creation.
    • Components:
      • Physical Volume (PV): The actual disk or partition.
      • Volume Group (VG): A collection of PVs.
      • Logical Volume (LV): A virtual partition within a VG.

    Checking Disk Usage

    • df command reports file system disk space usage.

    du Command

    • Shows disk usage of files and directories.

    Studying That Suits You

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

    Quiz Team

    Related Documents

    6336427.pdf

    Description

    This quiz covers the essential aspects of Disk Management, focusing on tasks such as adding storage, partitioning disks, and managing file systems. Learn about physical and virtual disks, and understand the naming conventions used in Linux. Ensure you grasp the importance of managing disk changes carefully.

    More Like This

    Mastering Disk Management
    7 questions
    CSA-CSS-MDL: Disk Management Tool Quiz
    18 questions
    Implementing Disk Quotas in Linux
    12 questions
    Use Quizgecko on...
    Browser
    Browser