lsblk # list block devices and partitionsfdisk -l # list partition table detailsmount /dev/sda1 /mnt # mount partition to a directorypartedsfdisk????
logical formatting (creation of filesystem)
fragmentation
efibootmgr
bcdedit
bcfg
vmlinuz
enable boot logs
changing kernel parameter during booting
init=/bin/bash (Reset Password): Bypasses the entire boot process and drops you directly into a root shell. This allows you to reset your password if you ever forget it.
text or 3 (Boot to TTY/Console): Bypasses your graphical desktop login screen completely and boots directly into a raw text terminal (tty1). This would have saved you from the chvt 8 lockup earlier!
nomodeset (Fix Black Screen): Disables video driver loading until the GUI starts. This is a lifesaver if your display server is glitching or throwing black screen errors.
systemd.unit=multi-user.target: Another clean way to boot strictly into text mode without loading the GUI.
Mounting and Unmounting
Mounting allows device to interact with the OS
Attach device to the filesystem tree
Always use an empty folder for mounting
Unmounting allows device to be safely detached from the filesystem tree
Flushes remaining data cached in RAM down to the storage media before removal
If a folder or any file inside Mount folder is being used by a process, the system will block the unmount and throw a target is busy error
mount -t vfat /dev/sdc /mnt/flashumount /dev/sdc
Find process using the mounted folder
# find all open instances of directory and# all the files and directories it contains to its complete depthsudo lsof +D /mnt/flash# using fuser utilitysudo fuser -v /mnt/flash
/dev vs /mnt vs /media
/dev (Devices)
Houses device nodes or special file descriptors generated dynamically by the Linux kernel layer
These are not the mount points
They act as interface endpoints pointing directly to raw hardware components
/mnt (Mount Points)
Manually or temporarily mounted filesystems
/media (Removable Media)
Managed automatically by desktop environment background daemons
These daemons are completely absent in Linux server
Examples:
udisksd (System daemon)
gvfs (User session daemon)
Mounted dynamically when external plug-and-play devices are inserted
Mounted directories are automatically visible in your GUI file manager
The OS automatically deletes the subfolder when you safely click “Eject” on your desktop environment
Internal Process of mounting
[ Physical USB Drive ]
↓ (Hardware connection)
[ Linux Kernel ] ----- Creates device node at /dev/sdb1
↓ (Signals the event)
[ udisksd (Daemon) ] ----- Automated mount to /media/user/MyUSB
↓ (Signals the desktop environment)
[ gvfs (Virtual FS) ] ----- Translates the mount into a GUI object
↓ (Pops up on screen)
[ File Explorer Sidebar ] ----- "MyUSB Drive" appears with an Eject button
View list of mounted filesystems
# modern wayfindmnt# only show block deviceslsblk -f# legacy waymount
Filesystem table
Stored at /etc/fstab
Lists the devices that are to be mounted at boot time
Format
Filesystem
Block special device, Remote Filesystem, Filesystem Image for loop device
Always prefer LABEL= or UUID= or similar instead of /dev/sdb since the devices can be dynamically reassigned upon reboot
Virtual FS
tmpfs, sysfs etc.
MBR
UUID=...
LABEL=... (stored in Filesystem)
GPT (GUID Partition Table)
PARTUUID=...
PARTLABEL=... (stored in partition entry)
NFS
<host>:<dir>
Filesystem Image
/path/to/img
Mount point
Filesystem type
Options: For example, Read only
Dump: Sets binary flags (0 or 1) for the legacy dump backup tool
Should always be set to 0 in modern Linux
Pass: Sets the integrity test boot sequence
Order in which filesystems should be checked with the fsck command.