Podcast
Questions and Answers
What is the primary function of a file system?
What is the primary function of a file system?
Which file system is known for its security features?
Which file system is known for its security features?
What does the acronym NFS stand for in the context of file systems?
What does the acronym NFS stand for in the context of file systems?
Which of the following file systems is standard on GNU/Linux?
Which of the following file systems is standard on GNU/Linux?
Signup and view all the answers
What does a RAW file system indicate about a storage drive?
What does a RAW file system indicate about a storage drive?
Signup and view all the answers
Which variant of the FAT file system is specifically used by early Windows operating systems?
Which variant of the FAT file system is specifically used by early Windows operating systems?
Signup and view all the answers
Which file system is more effective against small- and medium-sized files?
Which file system is more effective against small- and medium-sized files?
Signup and view all the answers
What role does drive management software serve in a computer system?
What role does drive management software serve in a computer system?
Signup and view all the answers
What is the purpose of the -l option in the fdisk command?
What is the purpose of the -l option in the fdisk command?
Signup and view all the answers
What command is used to create a partition in fdisk interactive mode?
What command is used to create a partition in fdisk interactive mode?
Signup and view all the answers
What does the -s option do in fdisk?
What does the -s option do in fdisk?
Signup and view all the answers
Which command would you use to delete a partition in fdisk interactive mode?
Which command would you use to delete a partition in fdisk interactive mode?
Signup and view all the answers
How can you save changes and exit in fdisk?
How can you save changes and exit in fdisk?
Signup and view all the answers
What does the command 't' accomplish in fdisk?
What does the command 't' accomplish in fdisk?
Signup and view all the answers
In fdisk interactive mode, what would pressing 'm' provide?
In fdisk interactive mode, what would pressing 'm' provide?
Signup and view all the answers
What command would you use in fdisk to list existing partitions?
What command would you use in fdisk to list existing partitions?
Signup and view all the answers
What does the IDE interface refer to in terms of drive technology?
What does the IDE interface refer to in terms of drive technology?
Signup and view all the answers
Which drive interface is specifically designed for high-performance use in servers?
Which drive interface is specifically designed for high-performance use in servers?
Signup and view all the answers
What is a disadvantage of using SCSI drives compared to SATA drives?
What is a disadvantage of using SCSI drives compared to SATA drives?
Signup and view all the answers
What command is used in Linux to view all drives in the system, including mounted and unmounted ones?
What command is used in Linux to view all drives in the system, including mounted and unmounted ones?
Signup and view all the answers
Which statement accurately describes Fibre Channel (FC) interfaces?
Which statement accurately describes Fibre Channel (FC) interfaces?
Signup and view all the answers
What distinguishes Serial Attached SCSI (SAS) from traditional SCSI?
What distinguishes Serial Attached SCSI (SAS) from traditional SCSI?
Signup and view all the answers
Which of the following is NOT a characteristic of SCSI drives?
Which of the following is NOT a characteristic of SCSI drives?
Signup and view all the answers
In terms of storage media, what is the main distinction between HDD and SSD?
In terms of storage media, what is the main distinction between HDD and SSD?
Signup and view all the answers
What is the primary purpose of swap space in a system?
What is the primary purpose of swap space in a system?
Signup and view all the answers
How does increasing swap space size compare to adding physical memory in terms of cost-effectiveness?
How does increasing swap space size compare to adding physical memory in terms of cost-effectiveness?
Signup and view all the answers
What system feature commonly utilizes swap space when the system hibernates?
What system feature commonly utilizes swap space when the system hibernates?
Signup and view all the answers
Which command is NOT used in creating a swap partition?
Which command is NOT used in creating a swap partition?
Signup and view all the answers
What is the recommended swap size for a system with 6 GB of RAM?
What is the recommended swap size for a system with 6 GB of RAM?
Signup and view all the answers
What is the main difference between a swap file and a swap partition?
What is the main difference between a swap file and a swap partition?
Signup and view all the answers
What must be done after creating a swap file for it to be functional?
What must be done after creating a swap file for it to be functional?
Signup and view all the answers
What is the recommended swap size for a system with more than 8 GB of RAM?
What is the recommended swap size for a system with more than 8 GB of RAM?
Signup and view all the answers
What must be created after an extended partition in order to utilize the allocated space?
What must be created after an extended partition in order to utilize the allocated space?
Signup and view all the answers
What does entering the letter 'e' during the fdisk process accomplish?
What does entering the letter 'e' during the fdisk process accomplish?
Signup and view all the answers
What is a significant limitation of the old MBR partitioning scheme?
What is a significant limitation of the old MBR partitioning scheme?
Signup and view all the answers
What is the function of the 'w' command in the fdisk process?
What is the function of the 'w' command in the fdisk process?
Signup and view all the answers
During partition creation, what happens when you enter 'p' in fdisk?
During partition creation, what happens when you enter 'p' in fdisk?
Signup and view all the answers
What should be entered to create a logical partition after an extended partition has been made?
What should be entered to create a logical partition after an extended partition has been made?
Signup and view all the answers
What is a major advantage of using the GUID Partition Table (GPT) over MBR?
What is a major advantage of using the GUID Partition Table (GPT) over MBR?
Signup and view all the answers
What does entering a default value during partition creation typically mean?
What does entering a default value during partition creation typically mean?
Signup and view all the answers
What does the command 'mkfs' primarily do?
What does the command 'mkfs' primarily do?
Signup and view all the answers
Which command option allows for verbose output when using mkfs?
Which command option allows for verbose output when using mkfs?
Signup and view all the answers
Why must a formatted drive be mounted in Linux?
Why must a formatted drive be mounted in Linux?
Signup and view all the answers
What is the default file system type specified by the mkfs command in Linux?
What is the default file system type specified by the mkfs command in Linux?
Signup and view all the answers
What command is used to format a partition named sdb2 in ext4 format?
What command is used to format a partition named sdb2 in ext4 format?
Signup and view all the answers
What happens to a drive when it's mounted?
What happens to a drive when it's mounted?
Signup and view all the answers
What command can you run after formatting to view information about the drive?
What command can you run after formatting to view information about the drive?
Signup and view all the answers
Which would you use to check a partition for bad blocks before formatting?
Which would you use to check a partition for bad blocks before formatting?
Signup and view all the answers
Study Notes
File System and Storage Management
- This course covers basic file systems, drive storage, and logical volume storage.
- It details how to manage and use the file system and storage, along with common commands.
- The course aims to provide understanding of basic file system and storage concepts, mounting and using storage drives, and managing logical volumes.
Objectives
- Students will gain knowledge of fundamental file systems and storage concepts.
- Students will learn how to mount and use drive storage.
- Students will understand methods for managing logical volumes.
Contents
-
Basic Concepts of File Systems:
- File Systems on openEuler
- Swap Space
-
Mounting and Using Drive Storage:
- Drive Basics
- Drive Partitioning
- Formatting and Mounting
-
Logical Volume Management:
- Logical Volume Basics
- Managing Logical Volumes
- Dynamically Resizing Logical Volumes
File System Overview
- A file system is a method and data structure used by an operating system to identify files on a storage device.
- It's a way to organize files on a storage device.
- A file management system (or file system) manages and stores file data within an OS.
- Has user-friendly interfaces and drive management software akin to middleware.
- Manages underlying storage hardware, like drives and partitions.
- Includes APIs for software stack object control and management.
File System Types and Application Scenarios
-
Common File Systems and their Application Scenarios:
- FAT (FAT16, FAT32): Used by Windows 9X OSs.
- NTFS: A security-based file system used by Windows NT (updated NTFS 5.0 in Windows 2000).
- NFS: Network File System used for file sharing between Unix systems.
- RAW: Represents a drive that's not processed or formatted.
- ext (ext2, ext3, ext4): A standard file system for GNU/Linux, excellent for small and medium-sized files.
- XFS: High-performance log file system developed for IRIX OS and ported to Linux kernel, good for large files.
File Systems on openEuler
- openEuler kernel is derived from Linux, supporting many file systems (Btrfs, JFS, ReiserFS, ext, ext2, ext3, ext4, ISO 9660, XFS, Minix, MSDOS, UMSDOS, VFAT, NTFS, HPFS, NFS, SMB, SysV, PROC)
- The default file system on openEuler is ext4.
Swap Space
- Swap space is a partition or file on the disk.
- When RAM is insufficient, less frequently used data is moved to swap space, freeing up RAM for other processes.
- Data in swap space is loaded back into RAM when needed.
- Total virtual memory is the sum of physical memory and swap space.
- Increasing swap space is often more cost-effective than adding RAM for more memory when necessary.
- Improves overall system performance.
- Used for Linux hibernation (saving memory data during hibernation).
Swap Space Configuration
- Swap space comes in two forms: partition and file.
- Partition is an independent drive.
- File is a special file within the file system and is separate from the system and data files.
- Creating swap partition involves using tools like fdisk, mkswap, and swapon.
- Creating swap file involves creating a file, using mkswap to format it, and then using swapon.
- Recommended swap sizes vary according to RAM size (2x RAM for low RAM, same as RAM for medium RAM, 8 GB for high RAM).
Drive Types
- Storage media: Hard disk drives (HDDs), Solid-state drives (SSDs)
- Interface types: IDE, SCSI, SATA, SAS, FC
Drive Interface Description
- Integrated Drive Electronics (IDE): Early general standard used in HDDs.
- Serial ATA (SATA): Distinctive from IDE and is a serial port.
- Small Computer System Interface (SCSI): Used in servers; has characteristics of high performance and stability, but also high cost and loud noise.
- Fibre Channel (FC): Enables drives to connect directly via optical fibers, improving high-throughput performance for intensive systems.
Viewing Drive Information on Linux
- fdisk -l: Lists information about all drives in the system (mounted and unmounted).
- df -h: Displays mounted file systems, showing size, usage, and availability.
Drive Partitioning
- Dividing a drive into logical storage units (partitions).
- Allows system administrators to use different partitions for different functions.
- Allows restrictions on available space for users or applications.
- Enables booting into multiple operating systems from a single drive.
- Separates operating system files from program and user files.
- Creates a dedicated area for virtual memory swapping.
- Restricts drive space usage, enhancing diagnosis tool and image backup performance.
Drive Partition Types
- Primary partition: Basic, non-partitioned drive; can't be made into other partitions.
- Extended partition: Holds logical partitions.
- Logical partition: Multiple logical partitions can be created within an extended partition.
Drive Partition Naming
- Linux uses device names (e.g., /dev/hda, /dev/sda) instead of drive letters.
-
/dev/
directory: where device names are stored. -
xxyN: Common naming format:
-
xx
represents the device type (hd
for IDE,sd
for SCSI,fd
for floppy,vd
for virtio). -
y
represents the device number. -
N
represents the partition number.
-
Drive Partitioning Scheme - MBR
- MBR: Master Boot Record partitioning scheme, used in BIOS-based systems.
- MBR is a boot sector at beginning of the drive.
- SCSI drives can have a maximum of 15 partitions (4 primary, 12 logical).
- IDE drives have a max of 63 partitions (4 primary, 60 logical).
- Maximum drive/partition size is 2TB when using MBR scheme due to 32-bit size representation.
fdisk Drive Partitioning Utility
- Traditional Linux drive partitioning utility; does not support partitions larger than 2TB.
- Uses command syntax
fdisk [options] parameter
.
fdisk Interactive Mode
- Select drive, then use interactive commands to manage partitions (using commands a, b, c, d, m, n, 0, p, q, s, t, u, v, w).
Drive Partitioning Scheme - GPT
- GUID Partition Table (GPT): Increasing drive sizes, allowing larger partitions, replacing the traditional MBR.
- Each partition has a Globally Unique Identifier (GUID).
- Used for UEFI systems. As GPT uses 64 bits for logical block addresses, larger partition sizes are possible (up to 18 EB).
- No primary or logical partitions; supports a maximum of 128 partitions..
parted Drive Partitioning Utility
-
parted
: More user-friendly partitioning utility, supports partitions beyond 2TB. -
parted [options] [device [command [options...]...]]
: Basic command syntax
Format the Drive
-
mkfs
: Used to format partitions into different file systems. - Formatting partitions usually deletes existing files from the volume (ensure you've backed up any necessary data before formatting).
Drive Mounting
- Drives must be mounted before use.
- Mounting links drives to a directory, providing access.
- Temporary mounting: Temporary connections. Becomes invalid after reboot
-
Permanent mounting: Automatically mount devices on boot; edits
/etc/fstab
file to configure.
Introduction to fstab
-
fstab
(/etc/fstab) file stores static information for automatic file system mounting during startup in the OS. - Format: [file system] [directory] [type] [options] [dump] [pass]
Key Parameters in fstab
- Explains parameters used in the
/etc/fstab
file. (e.g.,auto
,ro
,rw
,user
,nouser
,dev/nodev
,noatime/nodiratime
,defaults
,sync/async
,suid/nosuid
,dump
,pass
).
Logical Volume Management
- Logical Volume Management (LVM) adds layers above drives and partitions and below file systems, enhancing manageability.
- Uses physical extents (PEs) and logical extents (LEs). A physical volume (PV) is an entire drive or a partition. A logical volume (LV) is a logical device to users. PVs can be combined in a volume group (VG) and converted to LVs.
Logical Volume Basics
- Uses logical extents (LEs), where each LE is the same size as the PE.
- Logical Volume (LV): A logical unit that interacts with users for storage.
- Physical Volumes (PVs): The actual drive/partition on physical hardware.
- Volume Group (VG): A collective unit containing physical volumes for managing logical volumes (LVs)
- PVs are combined to provide capacity allocation; each LVM system can have multiple VGs. LVs are built on the VG, which manages the PVs.
Advantages of Logical Volumes
- Flexible capacity: Modifying capacity of an LV without changes to the underlying hardware.
- Scalable storage pools: Combining multiple PVs into VGs to create scalable storage pools.
- Easy device naming: Easier for users to manage and access storage.
- Disk striping: Improves performance by spreading data across multiple disks.
- Volume mirroring and snapshotting: Facilitates data redundancy and backup operations.
- Online data reallocation: Shifting data to maximize storage efficiency while the system is running.
Dynamically Resizing Logical Volumes
- Expanding/shrinking capacity of an LV (logical volume) without unmounting it.
-
Expanding: Checks volume group space, then extends capacity using
lvextend
command. -
Shrinking: Determines target size, unmounts, performs check, using
resize2fs
command, and thelvreduce
command to reduce the LV size.
Changing Logical Volume Capacity
-
lvresize
: Command used to adjust LV size (increasing/decreasing). -
lvextend
andlvreduce
: Functions withinlvresize
used for expanding and shrinking capacity.
Quiz
-
Question 1: Correct command for formatting /dev/hdb6 is
mkfs -t ext4 /dev/hdb6
. - Question 2: True. Reducing LV capacity is risky due to the need to unmount and check the file system forcibly.
Summary
- This course covers file system concepts, drive mounting, and logical volume management.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.