mkfs.btrfs changes to defaults
mkfs.btrfs now displays the following message when it is run to create a new filesystem btrfs-progs v5.17 See http://btrfs.wiki.kernel.org for more information. NOTE: several default settings have changed in version 5.15, please make sure this does not affect your deployments: - DUP for metadata (-m dup) - enabled no-holes (-O no-holes) - enabled free-space-tree (-R free-space-tree) man mkfs.btrfs points you to the section DUP PROFILES ON A SINGLE DEVICE which says: The mkfs utility will let the user create a filesystem with profiles that write the logical blocks to 2 physical locations. Whether there are really 2 physical copies highly depends on the underlying device type. For example, a SSD drive can remap the blocks internally to a single copy--thus deduplicating them. This negates the purpose of increased redundancy and just wastes filesystem space without providing the expected level of redundancy. The duplicated data/metadata may still be useful to statistically improve the chances on a device that might perform some internal optimizations. The actual details are not usually disclosed by vendors. For example we could expect that not all blocks get deduplicated. This will provide a non-zero probability of recovery compared to a zero chance if the single profile‚ is used. The user should make the tradeoff‚ decision. The deduplication in SSDs is thought to be widely available so the reason behind the mkfs default is to not give a false‚ sense of redundancy. As another example, the widely used USB flash or SD cards use a translation layer between the logical and physical view of the device. The data lifetime may be affected by frequent plugging. The memory cells could get damaged, hopefully not destroying both copies of particular data in case of DUP. The wear levelling techniques can also lead to reduced redundancy even if the device does not do any deduplication. The controllers may put data written in a short timespan into the same physical storage unit (cell, block‚ etc). In case this unit dies, both copies are lost. BTRFS does not add any artificial delay between metadata writes. The traditional rotational hard drives usually fail at the sector level. In any case, a device that starts to misbehave and repairs from the DUP copy should be replaced! DUP is not backup. When I initially installed my TW system btrfs created the filesystem on a single SSD as follows: data single metadata single system single If I now use mkfs.btrfs on a new single SSD the btrfs filesystem is created as follows: data single metadata DUP system DUP In the man page the one statement that caught my attention was "The deduplication in SSDs is thought to be widely available so the reason behind the mkfs default is to not give a false‚ sense of redundancy." It seems like that man page information was written to explain why it originally created data/metadata/system all as single on a single SSD file system and was not updated to reflect that it is now using DUP for metadata and system. So what is the recommendation now, should we convert single SSD installs to use DUP for metadata and system and then do I assume run balance or should we leave them as single? Thanks!
This question is better asked on btrfs list. On 21.05.2022 22:35, Joe Salmeri wrote: ...
When I initially installed my TW system btrfs created the filesystem on a single SSD as follows:
data single metadata single system single
If I now use mkfs.btrfs on a new single SSD the btrfs filesystem is created as follows:
data single metadata DUP system DUP
In the man page the one statement that caught my attention was
"The deduplication in SSDs is thought to be widely available so the reason behind the mkfs default is to not give a false‚ sense of redundancy."
It seems like that man page information was written to explain why it originally created data/metadata/system all as single on a single SSD file system and was not updated to reflect that it is now using DUP for metadata and system.
So what is the recommendation now, should we convert single SSD installs to use DUP for metadata and system and then do I assume run balance or should we leave them as single?
It is up to you really. commit 65181c273e67bd48d01fc79f00826dce38b93c4c Author: David Sterba <dsterba@suse.com> Date: Tue Sep 28 00:29:53 2021 +0200 btrfs-progs: mkfs: don't autoselect DUP on SSD for metadata anymore The original idea of not doing DUP on SSD was that the duplicate blocks get deduplicated again by the driver firmware. This was in 2013, years ago. Then it was speculative and even nowadays we don't have much reliable information from vendors what optimizations are done on the drive level. After the year there's enough information gathered by user community and there's no simple answer. Expensive drives are more reliable but less common, for cheap consumer drive it's vice versa. The characteristics are described in more detail in manual page btrfs(5) in section "SOLID STATE DRIVES (SSD)". The reasoning is based on numerous reports on IRC and technical difficulty on mkfs side to do the right decision. The default is chosen to be the safe option and up to user to change that based on informed decision.
participants (2)
-
Andrei Borzenkov
-
Joe Salmeri