Matthew Ahrens wrote:
Erik Trimble wrote:
Under ZFS, any equivalent to 'cp A B' takes up no extra space. The metadata is updated so that B points to the blocks in A. Should anyone begin writing to B, only the updated blocks are added on disk, with the metadata for B now containing the proper block list to be used (some from A, and the new blocks in B). So, in your case, you get maximum space efficiency, where only the new blocks are stored, and the old blocks simply are referenced.

That is not correct; what lead you to believe that? With ZFS (and UFS, EXT2, WAFL, VxFS, etc), "cp a b" will copy the contents of the file, resulting in two copies stored on disk.

--matt
Basically, the descriptions of Copy on Write. Or does this apply only to Snapshots? My original understanding was that CoW applied whenever you were making a duplicate of an existing file. I can understand that 'cp' might not do that (given that there must be some (system-call) mechanism for ZFS to distinguish that we are replicating an existing file, not just creating a whole new one). Now that I think about it, I'm not sure that I can see any way to change the behavior of POSIX calls to allow for this type of mechanism. You'd effectively have to create a whole new system call with multiple file arguments. <sigh>

Wishfull thinking, I guess.


Now, wouldn't it be nice to have syscalls which would implement "cp" and "mv", thus abstracting it away from the userland app?

--
Erik Trimble
Java System Support
Mailstop:  usca22-123
Phone:  x17195
Santa Clara, CA
Timezone: US/Pacific (GMT-0800)

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to