Disk Management Basics
40 Questions
0 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

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 (D)</p> Signup and view all the answers

What type of file systems can be created using mkfs?

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

What happens if you format a partition improperly?

<p>All data on the partition will be erased (D)</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 (A)</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 (C)</p> Signup and view all the answers

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

<p>/dev/sda1 (D)</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 (C)</p> Signup and view all the answers

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

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

What should you always do before performing disk management tasks?

<p>Back up important information (C)</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 (A)</p> Signup and view all the answers

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

<p>echo (C)</p> Signup and view all the answers

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

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

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

<p>IDE or ATA Drives (B)</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 (B)</p> Signup and view all the answers

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

<p>fdisk (D)</p> Signup and view all the answers

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

<p>/mnt/data (C)</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 (B)</p> Signup and view all the answers

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

<p>mount (C)</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 (B)</p> Signup and view all the answers

Which filesystem is the root filesystem mounted as?

<p>ext4 (A)</p> Signup and view all the answers

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

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

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

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

Which command should be used to check and repair filesystems?

<p>fsck (D)</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 (D)</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 (C)</p> Signup and view all the answers

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

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

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

<p>lvcreate (C)</p> Signup and view all the answers

What type of filesystem is tmpfs?

<p>Memory-based (A)</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/ (C)</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 (B)</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 (C)</p> Signup and view all the answers

What does the 'du -sh' command display?

<p>Disk usage of files and directories (C)</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 (B)</p> Signup and view all the answers

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

<p>df (B)</p> Signup and view all the answers

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

<p>Space available for use (B)</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. (C)</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 (C)</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

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

Windows and Linux Installation Guide
40 questions

Windows and Linux Installation Guide

BrotherlyPedalSteelGuitar avatar
BrotherlyPedalSteelGuitar
Gestion des Disques sous Linux
48 questions
Systèmes d'exploitation Linux
7 questions
Système d'exploitation Linux
7 questions
Use Quizgecko on...
Browser
Browser