1 |
On Fri, Sep 8, 2017 at 3:16 PM, Kai Krakow <hurikhan77@×××××.com> wrote: |
2 |
> |
3 |
> At least in btrfs there's also a caveat that the original extents may |
4 |
> not actually be split and the split extents share parts of the |
5 |
> original extent. That means, if you delete the original later, the copy |
6 |
> will occupy more space than expected until you defragment the file: |
7 |
> |
8 |
|
9 |
True, but keep in mind that this applies in general in btrfs to any |
10 |
kind of modification to a file. If you modify 1MB in the middle of a |
11 |
10GB file on ext4 you end up it taking up 10GB of space. If you do |
12 |
the same thing in btrfs you'll probably end up with the file taking up |
13 |
10.001GB. Since btrfs doesn't overwrite files in-place it will |
14 |
typically allocate a new extent for the additional 1MB, and the |
15 |
original content at that position within the file is still on disk in |
16 |
the original extent. It works a bit like a log-based filesystem in |
17 |
this regard (which is also effectively copy on write). |
18 |
|
19 |
|
20 |
-- |
21 |
Rich |