Re: Uh, 1COW?... what happens when someone does this...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 22, 2014 at 12:41:10PM -0700, Robert White wrote:
> So I've been considering some NOCOW files (for VM disk images), but
> some questions arose. IS there a "1COW" (copy on write only once)
> flag or are the following operations dangerous or undefined?
> 
> (1) The page https://btrfs.wiki.kernel.org/index.php/FAQ (section
> "Can copy-on-write be turned off for data blocks?") says "COW may
> still happen if a snapshot is taken." Is that a "may" or a "will",
> e.g. if I take a snapshot and then start the VM will the file in the
> snapshot still be frozen or will it update as I alter the VM? Does
> the read-only-or-not status of the snapshot matter in this outcome?
> 
> e.g. what does "may" mean in that section?

   If you take a snapshot of something, then any write to that (the
original or the copy) will cause it to be CoWed once. Subsequent
writes to the same area of the same file will go back to nodatacow.

> (2) If you copy a file using "cp --reflink" and the destination is
> in a directory marked NOCOW, what happens? How about when the
> resultant file is modified in place?

   Same thing as above.

> (3) when using a watever.qcow2 virtual machine image that does
> copy-on-write in the VM (such as QEMU) is it better, worse, or a
> no-op to have the NOCOW flag set on the file? All the advice on this
> matter I can find in Google seems to be "VM images bad, but will be
> addressed soon" and its old enough that I don't know if "soon" has
> come to pass.
> 
> It seems like there is a 1COW flag implicit somewhere.

   I wouldn't put it in those words, but yes, a single CoW operation
occurs on writes to data with nodatacow set.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- "There's a Martian war machine outside -- they want to talk ---   
                to you about a cure for the common cold."                

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux