[2] Linux Flashcards
What is the boot process?
[1] The BIOS checks the device hardware
[2] The bootloader finds the boot sector on the hard drive which contains the Linux kernel
[3] The Linux kernel is loaded
[4] The Linux kernel starts a RAM disk and loads basic drivers onto it
[5] The drivers on the RAM disk are used to mount the file system
[6] The kernel triggers the initialisation system, which mounts the file system and starts key daemons
How do boot logs work?
They are stored in the kernel ring buffer which is in RAM
Therefore, they are volatile i.e. do not persist on reboot
What command is used to read the boot log?
dmesg
What is it called when the kernel has an error?
Kernel panic
What are kernel modules?
Extensions to the Linux kernel e.g. third-party device drivers
What configuration files are used in Linux to manage DNS resolution?
/etc/hosts maps hostnames to IP addresses e.g. localhost -> 127.0.0.1
/etc/resolve.conf contains the IP address of DNS name servers to use
What are pseudo file systems?
A virtual file system that only exists in RAM. It is created by the kernel and is volatile system is running
What are the main pseudo file systems?
/proc - contains information about processes running on a system
/sys - contains information about the system hardware and kernel modules
What information is included about processes listed in /proc?
Their PID (process id), process data and the hardware they are running on
What are some key filesystems?
/var - the variable location. Stores dynamic content such as websites and logs
/home - the users’ home directories
/boot - Linux kernel and supporting files
/opt - optional software e.g. libraries
/dev - all hardware attached to the computer
- swap space e.g. if RAM over fills
How can swap space be setup?
Either as a swap partition (faster) or a swap file
How big should the swap space be?
At least 50% of the RAM size
How are hard drives represented in the file system?
/dev/sda for the first, /dev/sdb for the second.
If the first is partitioned then it’s /dev/sda1, /dev/sda2 etc.
What are mountpoints?
A mapping from an entire hard disk or partition that maps to a particular directory
Which Linux command is used for mounting?
The mount command shows existing mounts and can be used to create new mounts
Which Linux command shows block devices?
lsblk shows all block devices on a system and their names
Which Linux command shows swap partitions?
swapon –summary
What are the primary file systems?
Non-journaling: ext2
Journaling: ext3, ext4, xfs
Btrfs
What is the difference between Non-Journaling and Journaling filesystems?
They keep track in RAM of changes that have not yet been written to the disk
How does Btrfs work?
It is CoW (copy on write)
When editing a file, it only stores the changes so old versions can be accessed
What filesystem do Linux boot partitions use?
They must be FAT partitions, although VFAT can be used to allow longer file names
What command would mount a second hardrive to /opt?
mount /dev/sdb1 /opt
Where are mount configurations saved?
/etc/fstab