Hi. Thanks for the very clear explanation, and the various solutions provided. My SSD is a 250GB Samsung, I'll do some checking and testing, but I think I'll leave a 10% free. Happy holidays. gdb Il giorno dom 4 apr 2021 alle ore 21:42 Kai Krakow <kai@xxxxxxxxxxx> ha scritto: > > Hi! > > Am So., 4. Apr. 2021 um 18:23 Uhr schrieb Giuseppe Della Bianca > <giusdbg@xxxxxxxxx>: > > In SSDs, full use of available space causes speed and durability problems. > > > > bcahe uses all the available space in the cache device? > > > > I could not find information on the maximum space used or how to set it. > > There's no option for that in bcache. Instead, create a smaller > partition for bcache, then create a second partition filling the rest > of the device. You may want to use a size ratio of 80:20 for these > partitions tho modern drives usually already have an internal reserve > area, so 90:10 may be fine, too. > > Now, use the blkdiscard command to trim the second partition. That way > the SSD knows that this is unused space it can use for wear leveling. > You may remove this second partition if you want to. In either case, > don't write anything to this space in the future. > > Now continue to install bcache to the first partition created. > > I've never seen any performance or endurance gains here using modern > Samsung drives so I've gone with using 100% for bcache. But my older > smaller drives had seen a benefit (usually better performance than > better lifetime) from using 80:20 or 90:10. So I'd say the bigger the > drive, the less likely you need to reserve any trimmed space. > > So currently I'm using a hybrid approach and made the second partition > into a big swap partition: Most of it will stay trimmed but if the > system has to swap, it will at least find fast swap space here, and it > can be used for cold hibernation. You should not do that, tho, if your > system is low on memory: Swap isn't meant as emergency memory, and it > isn't meant as an extension to installed RAM. It's a space where the > system can put anonymous memory that's never used to make space for > disk caching. Only in that case, it's hardly ever written to or read > from. > > Regards, > Kai