Hi All,
Du sparse file question:
$ du KVM-W10.raw KVM-W11.raw SparceFile 47_745_732 KVM-W10.raw 50_635_356 KVM-W11.raw 0 SparceFile
is that KB or just B? (Man page is no help.)
Many thanks, -T
Once upon a time, ToddAndMargo ToddAndMargo@zoho.com said:
Hi All,
Du sparse file question:
$ du KVM-W10.raw KVM-W11.raw SparceFile 47_745_732 KVM-W10.raw 50_635_356 KVM-W11.raw 0 SparceFile
is that KB or just B? (Man page is no help.)
$ man du [...] Display values are in units of the first available SIZE from --block-size, and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environ‐ ment variables. Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).
On 5/7/25 7:35 PM, Chris Adams wrote:
Once upon a time, ToddAndMargo ToddAndMargo@zoho.com said:
Hi All,
Du sparse file question:
$ du KVM-W10.raw KVM-W11.raw SparceFile 47_745_732 KVM-W10.raw 50_635_356 KVM-W11.raw 0 SparceFile
is that KB or just B? (Man page is no help.)
$ man du [...] Display values are in units of the first available SIZE from --block-size, and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environ‐ ment variables. Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).
So bytes or KB? If I specify --bytes on the line, I get the apparent file size. I am after the sparse size. Apparent size defaults to KB.
On 5/7/25 8:55 PM, ToddAndMargo via users wrote:
So bytes or KB? If I specify --bytes on the line, I get the apparent file size. I am after the sparse size. Apparent size defaults to KB.
If you don't specify the units, there are various possibilities that it could be, so you should specify something. If you want KiB, then use "-k". I just use "-h". Unless you do something to give apparent size, you will get the sparse size.
On 5/7/25 9:43 PM, Samuel Sieb wrote:
On 5/7/25 8:55 PM, ToddAndMargo via users wrote:
So bytes or KB? If I specify --bytes on the line, I get the apparent file size. I am after the sparse size. Apparent size defaults to KB.
If you don't specify the units, there are various possibilities that it could be, so you should specify something. If you want KiB, then use "- k". I just use "-h". Unless you do something to give apparent size, you will get the sparse size.
$ du --byte SparceFile 104857600 SparceFile
$ du --apparent-size SparceFile 102400 SparceFile (1024 KB I presume)
$ du SparceFile 0 SparceFile (This is correct. I created it this way.)
See what I mean? If I specify units, I get --apparent-size.
On 5/7/25 11:37 PM, ToddAndMargo via users wrote:
On 5/7/25 9:43 PM, Samuel Sieb wrote:
On 5/7/25 8:55 PM, ToddAndMargo via users wrote:
So bytes or KB? If I specify --bytes on the line, I get the apparent file size. I am after the sparse size. Apparent size defaults to KB.
If you don't specify the units, there are various possibilities that it could be, so you should specify something. If you want KiB, then use "- k". I just use "-h". Unless you do something to give apparent size, you will get the sparse size.
$ du --byte SparceFile 104857600 SparceFile
$ du --apparent-size SparceFile 102400 SparceFile (1024 KB I presume)
$ du SparceFile 0 SparceFile (This is correct. I created it this way.)
See what I mean? If I specify units, I get --apparent-size.
No, you're specifically using bytes which is defined to also enable apparent size as the man page says.
-b, --bytes equivalent to '--apparent-size --block-size=1'
If you just want a size in bytes, then use "--block-size=1".
On 5/8/25 12:08 AM, Samuel Sieb wrote:
On 5/7/25 11:37 PM, ToddAndMargo via users wrote:
On 5/7/25 9:43 PM, Samuel Sieb wrote:
On 5/7/25 8:55 PM, ToddAndMargo via users wrote:
So bytes or KB? If I specify --bytes on the line, I get the apparent file size. I am after the sparse size. Apparent size defaults to KB.
If you don't specify the units, there are various possibilities that it could be, so you should specify something. If you want KiB, then use "- k". I just use "-h". Unless you do something to give apparent size, you will get the sparse size.
$ du --byte SparceFile 104857600 SparceFile
$ du --apparent-size SparceFile 102400 SparceFile (1024 KB I presume)
$ du SparceFile 0 SparceFile (This is correct. I created it this way.)
See what I mean? If I specify units, I get --apparent-size.
No, you're specifically using bytes which is defined to also enable apparent size as the man page says.
-b, --bytes equivalent to '--apparent-size --block-size=1'
If you just want a size in bytes, then use "--block-size=1".
$ du --block-size=1 KVM-W10.raw KVM-W11.raw SparceFile 48891629568 KVM-W10.raw 51850604544 KVM-W11.raw 0 SparceFile
Thank you!