Assume several 1000's of files are copied in the same directory on an SSD. In such cases, the concerned part of the filesystem area must be updated after each newly created file, and it is highly probable this modifications will affect the same physical block (up to a limit). Now, the SSD itself has no idea whether a block holds filesystem information or something else, so it does not make sure on the firmware level that filesystem blocks are held in the SSD's cache. So my question is: is there an OS level caching mechanism on the blocks holding the filesystem itself? I'm specifically curious about how Linux/ext4 handles this (there is many information available about how caching of files written to block devices is done, but it is unclear how the blocks of the filesystem area itself are cached, if they are at all). I guess, they must be committed after each filesystem change, but in this case it would impose a huge extra wear on the blocks of the filesystem area in the above use case.
Asked
Active
Viewed 58 times
1
-
3SSDs will do automatic wear levelling which spreads out the disk usage. – DavidPostill Feb 15 '23 at 16:58
-
1A lot depends on the quality of the SSD. A good quality SSD can withstand many writes, and built in TRIM helps keep usage spread out. – John Feb 15 '23 at 16:58
-
3SSDs have absolutely no concept of a directory. That's an OS construct. – Tetsujin Feb 15 '23 at 17:21
-
1It should be possible to write to a single SSD sector billions of times. It shouldn't matter if the wearout level was done right. – zomega Feb 15 '23 at 17:40
-
I think a lot of this depends on your ssd controller and write caching. https://linuxconfig.org/improve-hard-drive-write-speed-with-write-back-caching has a tutorial on tuning this with hdparm. – davidgo Feb 15 '23 at 19:30
-
"*it is highly probable this modifications will affect the same physical block*" -- Incorrect assumption on your part. The filesystem and/or host computer can only access logical blocks using LBA. That's the ATA interface: logical block addressing, and no access to the underlying physical blocks (which will be managed by the Flash Translation Layer). – sawdust Feb 16 '23 at 01:45