1/56
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
/dev directory
Contains one file per device for almost all devices on a Linux machine
Character devices
Transfer data character-by-character to and from the device
Block devices
Transfer chunks or blocks of data using physical memory to buffer the transfer (faster than character devices)
What does `ls -l` do when looking at a device?
Shows b or c for block/character file.
Shows major and minor number (Ex: 8, 1) for the device
mknod command
Recreates a corrupt device file if major/minor numbers are known
/proc/devices file
Contains list of devices currently used on the system and their major/minor numbers
Common components of all filesystems
Superblock, Inode table, Data blocks
Linux filesystem types
Btrfs, exFAT, ext2, ext3, ext4, zfs
mount command
Used to mount devices to mount point directories (Makes the device's contents visible)
umount command
Used to unmount devices from mount point directories
lsusb command
Displays removable devices connected to your PC
lsblk command
Used to help verify the device file used to represent the partition on your USB drive
mkfs command
Used to make a filesystem on a USB flash drive
df -hT command
(Disk free space) Displays a list of currently mounted filesystems
fuser command (fuser -u
Displays the users using a particular directory
eject command
Unmounts the filesystem and force the CD or DVD to physically eject a disc
mkisofs
Create a new ISO image from a directory of files
SATA and SCSI drive letter format
First: /dev/sda
Second: /dev/sdb
...
How many partitions does Linux require at minimum?
Two
One mounted to the / directory (root partition)
One mounted to the /boot directory
Tracks
Concentric circles
Sectors
Divide each track into smaller units
Blocks of data
Combination of sectors
Cylinder
Series consisting of the same concentric track on all the metal platters inside a HDD (think vertical)
Partition definitions
Stored in the first readable sector of the hard disk known as the Master Boot Record (MBR) or GUID Partition Table (GPT)
Partition device files lettering format
First primary partition: /dev/sda1
Second primary partition: /dev/sda2
...
Logical drives are named starting with number...
5
How many partitions can be created?
Up to 128
fdisk /dev/sda command
Creates sda partition after installation (partitions a fixed disk)
mkswap /dev/sda4 command
Prepares the swap partition
swapon /dev/sda4 command
Activates the swap partition
cfdisk command
A GUI to create, manipulate, and delete partitions
Note: always reboot after using fdisk and cfdisk.
gdisk command
(GPT fdisk) Creates and works with partitions on a GPT hard disk
parted command
(GNU parted) Creates and modifies partitions on both MBR and GPT HDs
Logical Volume Manager (LVM)
Creates logical volumes that can be mounted to directories within the Linux filesystem hierarchy
Alternative to creating and mounting filesystems that reside on standard partitions
What does the LVM consist of?
Physical volumes, volume groups, and logical volumes
Physical Volumes (PVs)
Unused partitions on hard disk drives that the LVM can use to store information
Volume Groups (VGs)
Contains one or more PVs.
Represents the pools of storage space that are available to the LVm for creating logical volumes.
Logical Volumes (LVs)
Usable volumes that are created by the LVM from the available storage space within a LG
pvcreate /dev/sda4 command
Creates PVs of unused partition you want the LVM to use
pvdisplay command
Displays detailed info about each PV
vgcreate vg00 /dev/sda4 command
Creates a VG named vg00 that uses the dev/sda4 PV
Physical extent (PE)
Sets the block size of the VG
vgdisplay command
Displays detailed info about each VG
lvcreate command
Creates LVs from available space in a VG
lvdisplay command
Displays info about each LV
pvscan, vgscan, and lvscan commands
Display info about PVs, VGs, and LVs
vgextend command
Adds a new PV to an existing VG
lvextend command
Increases the size of an LV
df -h command
(Disk free) Monitors free space used by mounted filesystems (-h indicates human readable option)
du -h /usr | more command
View size of directory and its contents
-s to summarize output
-h for human readable
| more - use with large nums of files
-i to view the total num of inodes and free inodes
Bad Blocks
Unusable areas of a disk
fsck command
Checks the filesystem for errors
NOTE: THE FILESYSTEM MUST FIRST BE UNMOUNTED!
e2fsck command
Checks an ext2, ext3, and ext4 filesystem for errors
-c to check for bad blocks
tune2fs command
Used to adjust tunable filesystem parameters
Disk Quotas
Set user limits to prevent users from using unnecessary space
Soft limits
Disk quotas that the user may briefly exceed for a certain period of time
Hard limits