Questions tagged [copy-on-write]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers

Btrfs : compress and nodatacow priority + automation

I have a btrfs partition mounted on / with compression enabled: mount -o subvol=@,defaults,noatime,nodiratime,compress=zstd,space_cache=v2 /dev/mapper/archlinux /mnt I want to disable the CoW ...
ShellCode's user avatar
  • 225
2 votes
1 answer

Copy on write for directories?

Some file-systems notably XFS and btrfs support Copy on Write at block level for files. This is done by reflinking where the underlying blocks are shared between files until they are modified. Since a ...
Bruce Adams's user avatar
1 vote
0 answers

Is the stack of a forked process shared with its parent? [duplicate]

Is the stack of a forked process shared with its parent? If so, does this happen via shared copy-on-write pages?
HappyFace's user avatar
  • 1,613
4 votes
1 answer

In what ways is the COW filesystem an improvement over the Journaling Filesystem?

I don't think an informative answer exists on u&l or otherwise, which mentions why COW filesystems are a leg-up over any of the three modes of journaling. How does the former provide both superior ...
computronium's user avatar
4 votes
4 answers

How to check disk usage for folders containing reflinked files on XFS?

XFS supports copy on write (CoW), so it is not entirely clear what du will say if some of the bytes are shared across files. I'd like to find a way to check how much disk space a folder uses, not ...
lumbric's user avatar
  • 389
-2 votes
1 answer

snapshot management tool implementation

I want to implement a command-line tool that allows me to take snapshots of the filesystem for linux/unix systems. I know there are various ways to implement snapshot Copy-On-Write Redirect-On-Write ...
MVJ's user avatar
  • 1
1 vote
1 answer

How to disable BTRFS copy-on-write updates for a subvolume using btrfs-property instead of chattr

I want to disable BTRFS copy-on-write updates for a subvolume using the newer method btrfs property instead of the old method chattr. I found the man page here: Manpage/btrfs-property - btrfs Wiki ...
MountainX's user avatar
  • 17.9k
3 votes
1 answer

Does anyone know the way to undelete file on ZFS?

Is there any way to undelete file on ZFS. I overwrote JPG file with the scanned image. Unfortunately, I didn't take snapshot. But ZFS uses the CoW mechanism, overwritten data may still alive, I think. ...
kou's user avatar
  • 31
9 votes
2 answers

How does ZFS copy on write work for large files

Let's say I have a large file (8GB) called example.log on ZFS. I do cp example.log example.bak to make a copy. Then I add or modify a few bytes in original file. What will happen? Will ZFS copy the ...
HubertNNN's user avatar
  • 193
1 vote
1 answer

A good way how to backup user data in CentOS?

I need to back up my data and I have not found a good way so far. Just say I have 1 TB of a non-system disk with 50-100 GB of user data (binary files, source code, images, etc.). And another big disk,...
Radek Uhlíř's user avatar
0 votes
2 answers

Is copy-on-write not implemented based on page fault?

Operating System Concepts say fork() we can use a technique known as copy-on-write, which works by allowing the parent and child processes initially to share the same pages. ... When it is ...
Tim's user avatar
  • 101k
1 vote
1 answer

fork() and COW behavior after exec()

We understand the COW behavior after a fork (as for example described here) as follows: fork creates a copy of the parent's page table for the child and marks the physical pages read only, so if any ...
js84's user avatar
  • 113
0 votes
0 answers

can two running processes share the complete process image in physical memory, not just part of it?

can two running processes share the complete process image in physical memory, not just part of it? Here I am talking about the Linux operating systems(eg. Ubuntu). My thinking: I think it is ...
Deepesh Meena's user avatar
0 votes
1 answer

Report directories with contents that exist elsewhere even if scattered

I want to generate a report of directories that I know I can safely delete (even if requiring a quick manual verification), because I know that the full contents all the way down, exist elsewhere--...
Jim's user avatar
  • 339
0 votes
1 answer

Doesn't the existence of LVM snapshots slows down writing a file system wich doesn't support them natively?

As far as understand snapshots in LVM (please, do correct me if I'm wrong): since they are not persistent and work even with a file system which doesn't itself support snapshots => I suppose it must ...
Camion's user avatar
  • 274
4 votes
2 answers

Will writing identical data to blocks of a file under ZFS use space in snapshots?

I have a 16M file. I take a snapshot of the ZFS filesystem which contains it. If I overwrite the file with the same data, will ZFS need to store two copies of all of the blocks of the file?
fadedbee's user avatar
  • 847
13 votes
2 answers

btrfs — Is it dangerous to defragment subvolume which has readonly snapshots?

If you open the defragment section of btrfs-filesystem(8), you will see the following ominous inscription left by the developers: Warning: Defragmenting with Linux kernel versions < 3.9 or ≥ 3....
firegurafiku's user avatar
27 votes
4 answers

Does any file system implement Copy on Write mechanism for CP?

We have seen OS doing Copy on Write optimisation when forking a process. Reason being that most of the time fork is preceded by exec, so we don't want to incur the cost of page allocations and copying ...
Mridul Verma's user avatar
1 vote
1 answer

copy on write and read only files - linux

Suppose I have a single process which has some read-only pages, and it tries to write to one of those pages. This of course will raise a read-fault. My question is: does linux knows that the read-...
Ofer Magen's user avatar
4 votes
2 answers

BTRFS inside a KVM-VM on a qcow2 formatted image

I have a Ubuntu 14.04 application appliance that makes heavy use of BTRFS snapshots. The application is meant to be hypervisor agnostic and the snapshots need to be stored with the virtual machine ...
AlexV's user avatar
  • 41
-2 votes
1 answer

How is btrfs (copy-on-write) different than RAID?

Whenever I hear copy-on-write my brain immediately starts thinking RAID. How is COW any different from RAID-x version ? Both need more than 1 HDD to be useful, both make a copy of data when data is ...
shirish's user avatar
  • 12.3k
1 vote
1 answer

How can I tell which copies of a file are COW copies?

I have a ZFS system connected to a macintosh over NFS. The system is nearly full, but I have found a large number of duplicate files with jdupes. I don't know how these copies were made, it's ...
Dan's user avatar
  • 9,482
22 votes
1 answer

Why does "cp -R --reflink=always" perform a standard copy on a Btrfs filesystem?

Btrfs support Copy-On-Write. I tried to use that feature to clone a directory: cp -R --reflink=always foo_directory foo_directory.mirror I expected the command to finish almost instantly (like a ...
Philipp Claßen's user avatar