を呼び出すたびにuseを使用しない理由はありますか?--sparse=alwayscp
info cp 言う:
‘--sparse=WHEN’ A “sparse file” contains “holes”—a sequence of zero bytes that does not occupy any physical disk blocks; the ‘read’ system call reads these as zeros. This can both save considerable disk space and increase speed, since many binary files contain lots of consecutive zero bytes. By default, ‘cp’ detects holes in input source files via a crude heuristic and makes the corresponding output file sparse as well. Only regular files may be sparse. The WHEN value can be one of the following:
...
‘always’ For each sufficiently long sequence of zero bytes in the input file, attempt to create a corresponding hole in the output file, even if the input file does not appear to be sparse. This is useful when the input file resides on a file system that does not support sparse files (for example, ‘efs’ file systems in SGI IRIX 5.3 and earlier), but the output file is on a type of file system that does support them. Holes may be created only in regular files, so if the destination file is of some other type, ‘cp’ does not even try to make it sparse.
それはまた言います:
[...]次のエイリアスを使用すると、「cp」はファイルシステムでサポートされている最小容量のスペースを使用します。
alias cp='cp --reflink=auto --sparse=always'
なぜ--sparse=alwaysデフォルトではないのですか?
                  おそらく、開発者が最小の驚きの原則を利用したかったのか、それともPOSIXが別に指定したのか?(posixでもcpですが、忘れます)
                
                
                  
                    —
                    猫
                    
                  
                
              
                  スパース性のチェックはパフォーマンスにとって不利である可能性があり、スパースファイルは深刻なファイルシステムの断片化を引き起こす可能性があり、によるデータ破損のインスタンスが少なくとも1つありました
                
                  
                    —
                    frostschutz 2017 
                    
                  
                
              cp --sparse。
                
                  読み取り/書き込みループを介して(主に非スパース)ファイルのデータをコピーすることにより、暗示ゼロの実行を探しているのに対し、中およびメモリからのデータのDMAを必要とする常に(または自動ブロックの数は、ファイルと一致していませんサイズ)は、データをCPUキャッシュにドラッグし、CPU帯域幅とサイクルを大幅に増やします。
                
                
                  
                    —
                    meuh 
                    
                  
                
              
                  @StephenKittそれはある --reflinkとの互換性:
                
                  
                    —
                    トム・ヘイル
                    
                  
                
              info cp含まれています:with the following alias, ‘cp’ will use the minimum amount of space      supported by the file system.  alias cp='cp --reflink=auto --sparse=always'
                
--reflink知らないことを除けば、とは互換性がありません...