Podcast
Questions and Answers
Which command is used to create an ext4 file system on a specific partition?
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?
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?
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?
What is a proper way to create a mount point in the /mnt directory?
What type of file systems can be created using mkfs?
What type of file systems can be created using mkfs?
What happens if you format a partition improperly?
What happens if you format a partition improperly?
What should the directory be like before creating a mount point?
What should the directory be like before creating a mount point?
What is the function of the sudo command in the context of creating a mount point?
What is the function of the sudo command in the context of creating a mount point?
What is the first partition on the first drive named in a Linux system?
What is the first partition on the first drive named in a Linux system?
Which command can be used to verify if a new disk has been detected in Linux?
Which command can be used to verify if a new disk has been detected in Linux?
In Linux drive naming, what does 'sd' typically indicate?
In Linux drive naming, what does 'sd' typically indicate?
What should you always do before performing disk management tasks?
What should you always do before performing disk management tasks?
What file does /dev/sdb2 refer to in a Linux system?
What file does /dev/sdb2 refer to in a Linux system?
Which command is NOT typically used for adding storage in a Linux environment?
Which command is NOT typically used for adding storage in a Linux environment?
What does the 'Y' in the format sdXY or hdXY represent?
What does the 'Y' in the format sdXY or hdXY represent?
Which type of drive is indicated by 'hd' in Linux device files?
Which type of drive is indicated by 'hd' in Linux device files?
What does the 'RM' column indicate in the output of the lsblk command?
What does the 'RM' column indicate in the output of the lsblk command?
Which command can be used to create partitions on a newly attached disk?
Which command can be used to create partitions on a newly attached disk?
In the example output given, what is the mount point of sdb1?
In the example output given, what is the mount point of sdb1?
Which of the following is a recommended use for a swap partition?
Which of the following is a recommended use for a swap partition?
What command is used to display details of all mounted filesystems?
What command is used to display details of all mounted filesystems?
What does the 'SIZE' column represent in the lsblk command output?
What does the 'SIZE' column represent in the lsblk command output?
Which filesystem is the root filesystem mounted as?
Which filesystem is the root filesystem mounted as?
Which partition is essential for a Linux system to function in single-user mode?
Which partition is essential for a Linux system to function in single-user mode?
What is the purpose of the /etc/fstab file?
What is the purpose of the /etc/fstab file?
Which command should be used to check and repair filesystems?
Which command should be used to check and repair filesystems?
If a device shows 'RO' as 1 in the lsblk output, what does it imply?
If a device shows 'RO' as 1 in the lsblk output, what does it imply?
What type of entry is indicated by the 'TYPE' column in the lsblk output?
What type of entry is indicated by the 'TYPE' column in the lsblk output?
In Logical Volume Management (LVM), what does VG stand for?
In Logical Volume Management (LVM), what does VG stand for?
Which command is used to create a logical volume in LVM?
Which command is used to create a logical volume in LVM?
What type of filesystem is tmpfs?
What type of filesystem is tmpfs?
To ensure a filesystem is mounted automatically at boot, what should be added to the system?
To ensure a filesystem is mounted automatically at boot, what should be added to the system?
What command is used to create a filesystem on a logical volume?
What command is used to create a filesystem on a logical volume?
Which option modifies the output of the df command to show sizes in a human-readable format?
Which option modifies the output of the df command to show sizes in a human-readable format?
What does the 'du -sh' command display?
What does the 'du -sh' command display?
What is the purpose of the -T option with the df command?
What is the purpose of the -T option with the df command?
Which command would you use to check the percentage of disk space used?
Which command would you use to check the percentage of disk space used?
In the example output of 'df -h', what does 'Avail' represent?
In the example output of 'df -h', what does 'Avail' represent?
Which of the following statements about LVM is true?
Which of the following statements about LVM is true?
What command would you run to mount a logical volume to a specific directory?
What command would you run to mount a logical volume to a specific directory?
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.
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.