You are not logged in.
I'm not sure if I didn't mess up my installation in terms of proper (safe for SDD and data) disk formatting.
I did:
`mkfs.btrfs -d single -m single /dev/sda1`
I did that because I thought that It'll be better for my SDD lifespan.
So now I have:
btrfs fi df /
Data, single: total=8.01GiB, used=6.18GiB
System, single: total=8.00MiB, used=16.00KiB
Metadata, single: total=3.01GiB, used=390.08MiB
GlobalReserve, single: total=21.31MiB, used=0.00BI checked manpage for btrfs -m option and there is:
A single device filesystem will default to *DUP* , unless an SSD is detected, in which case it will default to *single* .
So it this case it was luck because I repeated default settings.
But for option `-d` I'm not sure. Nothing about defaults in manual.
Usually I don't have problems with understanding English but in this case I'm not sure if I understand the manual correctly.
1. Are my parameters for this installation ok? (safe for disk and data)
2. Does DUP mean that if I have one file on the btrfs then It will be physically copied to another place on device?
3. There are Data, System, Metadata. During formatting I can change parameters for Data and Metadata but is there anything for System?
4. What is System?
Last edited by 860lacov (2020-07-16 13:13:42)
Offline
You understand DUP right. It will save a copy of each block somewhere else on the device. Things will use twice as much space.
"Data" is your actual files. If you would use DUP here, you will basically lose half the space on your device.
"System" and "Metadata" is not your files. It's organizational data structures. I don't know what exactly it is.
I went the exact opposite direction with regards to "-m": I explicitly changed System/Metadata to DUP to make things more robust for recovery from crashes etc. I mean, things look like this here for me:
$ sudo btrfs fi df /
Data, single: total=293.01GiB, used=281.71GiB
System, DUP: total=32.00MiB, used=64.00KiB
Metadata, DUP: total=5.00GiB, used=2.40GiB
GlobalReserve, single: total=512.00MiB, used=0.00BThere's this explanation here about SSDs in the man-page:
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.
My reasoning is that the story about SSDs doing their own deduplicating is surely fake. My guess what's happening is, when SSDs were really new, there was a controller named "Sandforce" that did compression on its own to try to get more life out of the flash chips. It supposedly might have also done hashing and deduplicating. Someone then got the idea that this is normal for SSDs, but that's definitely not happening with modern SSDs. The Sandforce controller was unique in its behavior.
EDIT:
I found this description here in the mkfs.btrfs man-page:
DATA
store data blocks and nothing elseMETADATA
store internal metadata in b-trees, can store file data if they fit into the inline
limitSYSTEM
store structures that describe the mapping between the physical devices and the linear
logical space representing the filesystem
Last edited by Ropid (2020-07-15 16:29:51)
Offline
In mkfs.btrfs(8) there is no info about System options
-m is one option for System AND Metadata?
-m dup would give
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=3.01GiB, used=390.08MiB?
To be honest I don't know what setting is better but is there a way to change system and metadata on running system?
EDIT.
Sorry for that question. First position on google
btrfs balance start -v -f -mconvert=dup /toplevel/But just to be sure.
I have 3 subvolumes located on 2 SSD drives
@, @cache on sda1
and
@home on sdb1
So do I have to do
btrfs balance start -v -mconvert=dup /
btrfs balance start -v -mconvert=dup /home
?
Last edited by 860lacov (2020-07-15 18:18:33)
Offline
I looked through my bash history, and I could find these old command line here from years ago:
[2018-11-07 21:31:56] sudo btrfs balance start -dconvert=single,soft -mconvert=dup -sconvert=dup -f /
[2018-11-07 21:32:00] sudo watch btrfs balance status -v /
[2018-11-07 21:38:55] sudo btrfs filesystem df /That's how I converted things in the past at some point.
The path is just there to target a filesystem. I think you can use any subvolume that's on that filesystem to address it. You don't need to repeat this balance stuff for multiple subvolumes, it's something that operates on the filesystem.
Last edited by Ropid (2020-07-15 18:19:08)
Offline
Thank you!!
But maybe you could answer my last question. Temporary blindness I hope.
On manpage for mkfs I can't find anything about System chunks but it exists on manpage for balance. Am i right? So during the creation it is not possible to choose mode for System?
-s in mkfs is for sector size
Offline
I can't remember what mkfs.btrfs command line I used to create my current filesystem.
EDIT:
I just did this experiment here with two test files:
$ truncate -s 1G testfile1
$ truncate -s 1G testfile2
$ mkfs.btrfs -m single testfile1
btrfs-progs v5.7
See http://btrfs.wiki.kernel.org for more information.
Label: (null)
UUID: 533fdb89-e8cf-47f4-9bcc-4ea0140c975e
Node size: 16384
Sector size: 4096
Filesystem size: 1.00GiB
Block group profiles:
Data: single 8.00MiB
Metadata: single 8.00MiB
System: single 4.00MiB
SSD detected: no
Incompat features: extref, skinny-metadata
Runtime features:
Checksum: crc32c
Number of devices: 1
Devices:
ID SIZE PATH
1 1.00GiB testfile1
$ mkfs.btrfs -m dup testfile2
btrfs-progs v5.7
See http://btrfs.wiki.kernel.org for more information.
Label: (null)
UUID: 8b8c5f95-74a6-4084-a5cd-411c12458ec4
Node size: 16384
Sector size: 4096
Filesystem size: 1.00GiB
Block group profiles:
Data: single 8.00MiB
Metadata: DUP 51.19MiB
System: DUP 8.00MiB
SSD detected: no
Incompat features: extref, skinny-metadata
Runtime features:
Checksum: crc32c
Number of devices: 1
Devices:
ID SIZE PATH
1 1.00GiB testfile2
$ I'm guessing the "-m" is for both System and Metadata.
Last edited by Ropid (2020-07-15 18:47:37)
Offline
I'm guessing the "-m" is for both System and Metadata.
No, the -m is only for the metadata. "single" is the default for data.
To answer the original question, the current recommendation (that I know of) is to use "single" for metadata on SSDs. "dup" can be used, but you can't depend on it actually being duplicated, so use "single" so that you don't have a false sense of security. "dup" works as advertised on rotating drives.
https://together.jolla.com/question/162 … vs-single/
Last edited by ratcheer (2020-07-16 12:08:15)
Offline