# Boot Issues
- select a kernel version to run in recovery mode from GRUB bootloader menu ![[images/recovery.png]]
- fs is typically in read-only while in recovery mode
- `mount -o remount,rw / && mount --all` to remount root fs in rw mode and others
- `fsck` to run fs check utility
- typically run fsck on unmounted disks; to unmount a fs `sudo umount /`
- `sudo fdisk -l` to list disk partitions
- `sudo grub-install --boot-directory=/dev/sda` to reinstall grub
- review `/var/boot.log` and `dmesg`
- important to have a live boot USB handy to boot from to diagnosis issues with disk
# Storage Issues
- common storage commands
- `mount` to list mounted partitions and mount partitions ![[images/Pasted image 20250801194036.png]]
- `umount` to unmount partitions
- `lsblk` shows block devices ![[images/Pasted image 20250717201930.png]]
- `fdisk` to view and manage partitions
- `sudo fdisk -l /dev/sda` shows details for sda disk
- `sudo fsck -vy` to find and automatically repair disk errors
- `sudo fstrim` to remove unused blocks
- `partprobe` informs kernel of partition changes w/o rebooting
- `df -h` shows disk free in human readable format ![[images/Pasted image 20250731094336.png]]
- `du -d 1 /target_dir` shows space used by sub-directories that are one level below the target directory ![[images/Pasted image 20250731094750.png]]
- `iostat [options] [interval] [count]` to troubleshoot disk I/O issues
- also try `iotop`,`ioping`, and `fio`
- `sudo fsck /dev/sda1` runs fs check on sda1 partition
- `cat /etc/fstab` shows entries for persistent mount points
- change fs size
- `sudo fdisk -l` to show disks and associated partitions
- `sudo umount /dev/sdb1` to unmount sdb1 partition
- `sudo e2fsck -f /dev/sdb1` to run fs check on sdb1 partition
- `resize2fs /dev/sdb1 1200M` to resize sdb1 partition to 1.2G
- manage swap space
- swap is used when physical RAM is exhausted
- least used blocks are moved to swap (memory to disk)
- swap can be a file or a partition
- `free -m` shows memory and swap space ![[images/Pasted image 20250731095829.png]]
- `sudo fdisk -l` shows disks and associated partitions
- `sudo fdisk /dev/sdd` to create a fresh partition on sdd
- `sudo mkswap /dev/sdd1` to create swapspace on fresh sdd1 partition
- `sudo swapon -v /dev/sdd1` to enable swapspace
- `free -m` shows newly created and enabled swapspace