1. NOTE On blocks and devices

/dev In Linux, everything is a file.

dev contains special device files - usually block or character device.

major, minor = category, device 0, 5

mknod - create special device files

redhat hints

dd if=/dev/zero of=myfile bs=1M count=32
losetup --show -f myfile
ls -al /dev/loop0
losetup -d /dev/loop0 #teardown
echo "sup dude" > /dev/loop0
dd if=/dev/loop0 -bs=1
dd if=/dev/nvme0 of=/dev/null progress=true
#pacman -S hdparm
hdparm -T /dev/nvme0
modprobe scsi_debug add_host=5 max_luns=10 num_tgts=2 dev_size_mb=16

sparsefiles: create with C, dd, or truncate

truncate --help

test mkfs.btrfs on 10T dummy block device

dd if=/dev/zero of=/tmp/bb1 bs=1 count=1 seek=10T
du -sh /tmp/bb1
losetup --show -f /tmp/bb1
mkfs.btrfs /dev/loop0

diagnostics

iostat # pacman -S sysstat
blktrace # paru -S blktrace
iotop # pacman -S iotop

bcc/ trace: Who/which process is executing specific functions against block devices?

bcc/biosnoop: Which process is accessing the block device, how many bytes are accessed, which latency for answering the requests?

at the kernel level besides BPF we got kmods and DKMS,

compression/de-duplication can be done via VDO kernel mod

https://en.wikipedia.org/wiki/Dynamic_Kernel_Module_Support

2. NOTE save-lisp-and-respawn

sb-ext:*save-hooks*

3. NOTE syslog for log

sb-posix:

  • openlog syslog closelog
  • levels: emerg alert crit err warning notice info debug
  • setlogmask