8 ms·
You have to read this so that when inodes come up at your sysadmin/devops social gathering's scintillating conversation you don't have to run to the bathroom an
by theonemind 4y ago
You have to read this so that when inodes come up at your sysadmin/devops social gathering's scintillating conversation you don't have to run to the bathroom and google it on your phone and try muddle your way through without your face turning red.
(inodes just strike me as one of those weird little things like SQL, except for much smaller/easier to learn--just something critical, always there, and for some reason, not understood by a lot of sysad/devops types. I forgot the detail until rereading this book recently. I imagine you can expect the details to vary widely on modern filesystems, but ext4 (descending from and backwards compatible with ole ext2) probably has the concept, and BSD's ffs/ufs, and the idea probably gives you some hazy idea of this general area of the world for a lot of filesystems
I also find the treatment of some old topics kind of illuminating, like the stty command when I do obscure stuff like use serial terminals or try to use a text buffer as a tty--interesting that you can still tell the kernel "hey, do this dirty hack for my terminal when handling characters and things. Thanks.")
- buildbot 4y agoNobody thinks about inodes until suddenly your disk is full, but df tell you it is not ;)
- zvr 4y agoOf course, the same df can show you what's happening with inodes, if used with the -i flag.
- buildbot 4y agoThis is true! Once I figured out what to search for, df was able to confirm what the problem was for me.
- jaxrtech 4y agoYou should be able to see inode usage with `df -i`, no? I usually use `df -Tih` (print the file system type, list inode usage, in human-readable format). I've had the other case where `df` says the disk is full with plenty of inodes left, but then `ncdu` says there is plenty of space (supposedly). Lo' and behold, you have some borked process still holding GBs of log files open that you thought you "deleted" -- really unlinked from a directory. tl;dr: Don't forget `lsof +L1` to find pesky processes that are holding files open that you unlinked from a directory but have yet to be actually marked as deleted on the filesystem [1]. The space on disk won't be freed until the process closes the files or is terminated. (Technically, the open files are associated with a mount point, not the file system itself, which makes dealing with symbolic links across file systems somewhat confusing.) [1]: For example, see https://unix.stackexchange.com/a/141639/332116 https://unix.stackexchange.com/a/141639/332116)
- macintux 4y agoYou have to know to ask, though.
- buildbot 4y agoExactly that took a bit of random walking to find!
- jrumbut 4y agoDid you have to learn about lsof +L1 the painful way like I had to learn about df -i (every office phone ringing at once, emails filling up with alerts, etc) or were you wise from the beginning?
- panzagl 4y agoI learned about the inotify limit last week in a similar way...
- mgaunard 4y agoAny software engineer should have written a filesystem during their bachelor's degree, and should be well familiar with the concept of inodes.
- lamp987 4y agowell maybe not that, but it is very surprising that there are software engineers out there who dont know what inodes are. on my uni this was explained in an OS class in year 2 of bachelors programme. its basic knowledge.
- Tijdreiziger 4y agoOperating Systems was an elective in my bachelor's program. It's certainly not basic knowledge.
- pjmlp 4y agoSo there are engineering degrees without OS knowledge?!?
- Tijdreiziger 4y agoYes, and on the other hand, there are surely also degrees with OS knowledge, but without AI knowledge. And degrees with AI knowledge, but without 3D graphics knowledge. And... well, you get the point.