cp between mounts using tar (does drive A have to have free space equal to filesize) to complete tar process?

Bms85smb asked:

Does the following command if issued between two drives require that the current drive have enough space to accommodate everything being moved to the second drive?

    tar cvf - .* --exclude=. --exclude=.. | (cd /dest/dir; tar xvf -)

My line of thinking is that the tar has to be created on drive A before being moved to drive B.

My answer:


No.

The tar “file” exists only in the pipeline; it’s not written to disk in the intermediate stage, but only at the destination when you extracted it.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.