paulgorman.org

< ^ txt

Fri Jul 28 07:07:02 EDT 2017 Slept from ten-thirty to six-thirty. Woke briefly around three-thirty. High of seventy-eight. 30% chance of thunderstorms. Work: - "Find" notes for tutorial Done. https://paulgorman.org/technical/find.txthttps://paulgorman.org/technical/find.txt Twenty-five-minute walk at lunch. Cooler, mostly cloudy, and breezy. Saw a couple of blue jays, a gaggle of Canada geese, and a pair of acrobatic swallows. Why is the default unit for the `find` `-size` primary in blocks? Efficiency? Lowest common denominator? https://en.wikipedia.org/wiki/Disk_sector#Sectors_versus_blocks > While sector specifically means the physical disk area, the term block has been used loosely to refer to a small chunk of data. [...] A filesystem block is an abstraction over disk sectors possibly encompassing multiple sectors. https://unix.stackexchange.com/questions/120311/why-are-there-so-many-different-ways-to-measure-disk-usage Blocks are an abstraction that (among other things) keeps down the amount of storage necessary for metadata --- cataloging the number of (relatively large) blocks used by a file takes less storage than cataloging each physical sector. https://technet.microsoft.com/en-us/library/cc781134(v=ws.10).aspx > When you format a volume with NTFS, Windows Server 2003 creates an MFT and metadata files on the partition. The MFT is a relational database that consists of rows of file records and columns of file attributes. It contains at least one entry for every file on an NTFS volume, including the MFT itself. https://superuser.com/questions/1030800/how-can-a-files-size-on-disk-be-0-bytes-when-theres-data-in-it https://technet.microsoft.com/en-us/library/hh148159.aspx > If the file is neither compressed nor sparse, then the Size on disk is the file size reported by the FindFirstFile function rounded up to the nearest cluster. https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Table > In a regular UNIX filesystem, the inode stores all the metadata pertaining to the file (time stamps, block maps, extended attributes, etc). So, I haven't found a concrete answer yet as to why `find` defaults to blocks, but I suspect that's it's combination of efficiency and lowest-common-denominator (among different file systems). Probably, also, if it's going to default to anything, the lowest-level thing is a reasonable choice. I guess there's also the practical matter that block count is the only file size that really matters --- you can't (generally) squeeze more disk space out of the unused portion of blocks. https://en.wikipedia.org/wiki/Inode#POSIX_inode_description Apparent the byte size of the file is stored in the inode data too, so I guess there's no efficiency gain in reporting blocks instead. Also see STAT(2) INODE(7). Home: - Work on OpenBSD PF notes A bit. https://paulgorman.org/technical/openbsd-pf.txt - Order jeans Done. - Apple call at 3:30 Done. - Buy gas No. I'm enjoying this The Worst Witch show on Netflix. Solid young-adult television. Lunch: coffee, tomato, peanut butter and jelly, an apple Dinner: Steak sandwich

< ^ txt