On Linux, explore the file system and measure storage behaviour. Record commands and outputs.
- Create a file, a hard link and a symbolic link. Use
ls -liandstatto show inode numbers and link counts. Delete the original and explain what happens to each link. df -handdf -i: explain the difference. Create 100,000 empty files in a directory (a small script) and observedf -i. Why can a disk be "full" with free space left?- Write 1 GB with
dd if=/dev/zero of=test bs=1M count=1024and then withoflag=directorconv=fsync. Compare the reported speeds and explain the difference using the page cache. - Write a small program that appends 1,000 small records to a file, (a) without fsync, (b) with fsync after each record, (c) with fsync every 100 records. Measure the time of each. Relate the result to database group commit.
lsblk -d -o NAME,ROTA,SIZEandcat /sys/block/<dev>/queue/scheduler: is your disk rotational? Which I/O scheduler is used, and is it appropriate?