Podcast
Questions and Answers
What is the maximum size of a disk supported by the MBR partition table?
What is the maximum size of a disk supported by the MBR partition table?
What is the purpose of an extended partition?
What is the purpose of an extended partition?
What is the naming convention for SATA/SCSI storage devices in Linux?
What is the naming convention for SATA/SCSI storage devices in Linux?
What is the purpose of a file system?
What is the purpose of a file system?
Signup and view all the answers
What is the command-line tool used to create partition tables and partition disks in Linux?
What is the command-line tool used to create partition tables and partition disks in Linux?
Signup and view all the answers
What is the purpose of creating a file system inside a partition?
What is the purpose of creating a file system inside a partition?
Signup and view all the answers
What is the naming convention for partitions on a storage device in Linux?
What is the naming convention for partitions on a storage device in Linux?
Signup and view all the answers
What type of partition is used for data storage?
What type of partition is used for data storage?
Signup and view all the answers
What is the usual form of the device name used in file system creation?
What is the usual form of the device name used in file system creation?
Signup and view all the answers
What is not checked by the mkfs commands?
What is not checked by the mkfs commands?
Signup and view all the answers
What is the purpose of the mkswap command?
What is the purpose of the mkswap command?
Signup and view all the answers
What is the consequence of not specifying the correct device name when using mkfs?
What is the consequence of not specifying the correct device name when using mkfs?
Signup and view all the answers
What is the purpose of the fsck command?
What is the purpose of the fsck command?
Signup and view all the answers
What happens when you run the mkswap command on an existing partition?
What happens when you run the mkswap command on an existing partition?
Signup and view all the answers
What is the purpose of the swapon command?
What is the purpose of the swapon command?
Signup and view all the answers
What happens when you create a partition with fdisk?
What happens when you create a partition with fdisk?
Signup and view all the answers
How do you list all currently active swap areas?
How do you list all currently active swap areas?
Signup and view all the answers
What is the benefit of using journalling file systems?
What is the benefit of using journalling file systems?
Signup and view all the answers
What is the purpose of the file -s command?
What is the purpose of the file -s command?
Signup and view all the answers
What is the purpose of the swapoff command?
What is the purpose of the swapoff command?
Signup and view all the answers
What happens when you create a file system with mkfs?
What happens when you create a file system with mkfs?
Signup and view all the answers
What happens when you run the swapon -a command?
What happens when you run the swapon -a command?
Signup and view all the answers
What happens to partitions in /etc/fstab marked as swap at boot time?
What happens to partitions in /etc/fstab marked as swap at boot time?
Signup and view all the answers
What is the purpose of the -a option with the swapoff command?
What is the purpose of the -a option with the swapoff command?
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?
What happens when you specify the device name or mount point to the mount command if the file system is listed in the fstab?
Signup and view all the answers
What is the purpose of the swap partition?
What is the purpose of the swap partition?
Signup and view all the answers
What is the default option for mounting file systems specified in the fstab?
What is the default option for mounting file systems specified in the fstab?
Signup and view all the answers
What option in the fstab file allows a non-root user to mount and unmount a file system?
What option in the fstab file allows a non-root user to mount and unmount a file system?
Signup and view all the answers
What is the purpose of setting the partition type ID to Linux Swap when creating a swap partition?
What is the purpose of setting the partition type ID to Linux Swap when creating a swap partition?
Signup and view all the answers
What is the default mount option for file systems specified in the fstab?
What is the default mount option for file systems specified in the fstab?
Signup and view all the answers
What command is used to create a swap partition?
What command is used to create a swap partition?
Signup and view all the answers
What is the effect of the noauto option in the fstab file?
What is the effect of the noauto option in the fstab file?
Signup and view all the answers
What type of file system is suitable for USB keys, floppy disks, and Microsoft compatibility?
What type of file system is suitable for USB keys, floppy disks, and Microsoft compatibility?
Signup and view all the answers
What command is used to create a file system on a partition?
What command is used to create a file system on a partition?
Signup and view all the answers
What type of file system is created by default if no type is specified?
What type of file system is created by default if no type is specified?
Signup and view all the answers
What must exist before creating a file system?
What must exist before creating a file system?
Signup and view all the answers
What type of file system is recommended for modern Linux hard disk systems?
What type of file system is recommended for modern Linux hard disk systems?
Signup and view all the answers
What is the purpose of the /usr directory?
What is the purpose of the /usr directory?
Signup and view all the answers
What type of file system is suitable for journaling?
What type of file system is suitable for journaling?
Signup and view all the answers
What is the minimum requirement for mounting a file system?
What is the minimum requirement for mounting a file system?
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)
- SATA/SCSI storage devices are named
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
andmkswap
. - 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 infstab
.
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.