You are not logged in.

#1 2014-04-29 16:35:19

Nolhian
Member
Registered: 2011-08-21
Posts: 25

BTRFS : Subvolumes, mount options

Hello,

I took a look at btrfs, read the wiki, some guides and I have a few questions :

1) In every guide I read, even on the official wiki, the root and home subvolumes are created separately. I don't understand why since the two are "linked" it would make more sense to create the home subvolume inside the root subvolume. From what I understand it wouldn't make the snapshots harder because the subvolume children are ignored when snapshotting. Moreover since subvolume children are automatically mounted we can mount the all system in one command only, so only one line in fstab to mount everything. So why not create the subvolumes directly in the root subvolume ? The only drawback I can see is that you can't set different mounting options for the children.

2) Same goes for autodefrag option, wherever I read about btrfs and SSDs the autodefrag option is always there. I understand defragmentation for a spinning device but fail to see the usefulness on SSDs. Moreover defragmentation is really bad for SSDs as it shortens their lifespan. So the way I see it defragmentation and autodefrag only has drawbacks for SSDs. What am I missing ?

3) For the same SSD lifespan concerns I plan to not use inode_cache and space_cache by using the nospace_cache option. So my options would be :

rw,noatime,compress=lzo,ssd,discard,nospace_cache

Does that seem optimal ?

Thanks in advance,
Nolhian

Last edited by Nolhian (2014-04-29 16:36:37)

Offline

#2 2014-04-30 05:23:36

benjamin
Member
Registered: 2013-10-15
Posts: 13

Re: BTRFS : Subvolumes, mount options

For #1, I personally find it easier to have all seperate, non nested subvolumes. There is the seperate mount options part, which you mentioned. But I find it just easier at a glance. I like being able to do a quick  "mount /dev/sdx /mnt", and then quickly work with all my subvolumes. I always mount subvolumes with the "subvol=X" fstab option, so it's easy to do a quick snapshot, move or rename this way.

Offline

#3 2014-04-30 07:54:32

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,582
Website

Re: BTRFS : Subvolumes, mount options

If /home is nested it may lead to confusion if you later want to mount home-snapshot-1 to /home. Keeping things separate, while not required, is still a good idea.

My mount options for my ssd-based root subvolume are: "defaults,noatime,discard,ssd,subvolid=0". I don't know where you've seen autodefrag as a standard ssd option, like you say, it doesn't make much sense for ssds.

Can't comment on the caches.  There's a few threads on the mailing list that may be of interest to you though (not read them myself).

http://www.mail-archive.com/linux-btrfs … 24827.html
http://www.mail-archive.com/linux-btrfs … 30739.html
http://www.mail-archive.com/linux-btrfs … 07498.html

There's a lot more.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB