Storage Flashcards
Where are block device file stored?
/dev
What is the first detected the first detected SATA, SAS, SCSI, or USB hard drive?
/dev/sda
What is the second detected the first detected SATA, SAS, SCSI, or USB hard drive?
/dev/sdb
What name is given to virtio-blk paravirtualized storage (VMs) device storage?
/dev/vda, /dev/vdb, /dev/vdc, etc.
How do you recognize block devices on the file system?
ls -l /dev/sda1
Any entry with file type b is a block device.
brw-rw—-. 1 root disk 8, 1 Feb 22 08:00 /dev/sda1
display an overview of local and remote file-system devices
df
View the file systems on the host machine with all units converted to human-readable format
df -h
View the disk usage report for the /usr/share directory
du /usr/share
Which command provides an overview of the file-system mount points and the available free space in SI units?
df -H
What is the naming pattern for ssd storage devices?
/dev/nvme0, /dev/nvme1, …
What is the naming pattern for SD storage devices?
/dev/mmcblk0, /dev/mmcblk1, …
list the details of a specified block device or of all the available devices
lsblk
mount the /dev/vda4 partition on the /mnt/data mount point
mount /dev/vda4 /mnt/data
Mount the file system by the file-system UUID.
mount UUID=”efd314d0-b56e-45db-bbb3-3f32ae98f652” /mnt/data
Determine the UUID of a file system
lsblk -fp
lsblk -o NAME,UUID
unmount a file system
umount /mnt/data
identify which processes are preventing the file system from successfully unmounting
lsof /mnt/data
How often is the locate db updated?
everyday
force the locate database to update itself immediately?
updatedb
Difference between locate and find
locate searches a pre-generated index and returns the results instantly (fast, index update delay).
find searches for files in real time by parsing the file-system hierarchy (slow, accurate).
Example uses of locate
locate image
locate -i passwd
locate -n 5 file.txt