Skip to contentSkip to conversation

chattr +C vs. btrfs subvolume snapshot

DISCUSSION Jun Lion 2 participants 3 messages Jan 8, 2013 – Jan 9, 2013 Btrfs file system

lore
Share & tools
lore

Jun Lion

author
#0 lore raw

What happens if you set an individual file inside a subvolume as nocow (chattr +C) and then take a snapshot of that subvolume and modify the file in both?

Will btrfs now ignore the nocow attribute completely or will it do "as few copies as possible"? (I'd love to know if it's possible to visualize the fragmentation of a single file.)

#1 lore raw
Quoted 7 lines · Jun Lion

What happens if you set an individual file inside a subvolume as nocow (chattr +C) and then take a snapshot of that subvolume and modify the file in both?

Will btrfs now ignore the nocow attribute completely or will it do "as few copies as possible"? (I'd love to know if it's possible to visualize the fragmentation of a single file.)

Well, btrfs nearly puts everything with a kind of "timestamp", generation, which stands for transaction id.

For your case, the NOCOW file is created just before taking the snapshot, so btrfs thinks of it being shared, and for shared parts, we must COW it to keep everything right when trying to modify them.

And for the fragmentation, do you mean 'filefrag'?

thanks,
liubo

#2 lore raw
Quoted 1 line · Liu Bo

And for the fragmentation, do you mean 'filefrag'?

I was for something that would show how the data branches off across different snapshots, --reflink copies etc.

filefrag looks interesting, thanks.