[Bug 278440] [UFS] unxz makes a file which reports wrong usage block size by /usr/bin/du

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 19 Apr 2024 18:26:26 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278440

--- Comment #2 from uratan <uratan@miomio.jp> ---
(In reply to Marek Zarychta from comment #1)

I've confirmed that rsync with '--sparse ' option
makes 'the strange' file.
  +-------------------------------------------------------------------
  |% du test1
>>|909     test1   <--- has sparse file
  |
  |% mkdir c0
  |% rsync --sparse test1/FreeBSD-14.0-RELEASE-i386-memstick.img c0/
  |
  |% du c0
>>|909     c0      <--- sparse condition is kept(?) with 'rsync --sparse'
  +-------------------------------------------------------------------

I did not think sparse-file to be used so aggressively.

My problem is not a BUG and answered.

Thank you.


 - * - * -

  (Here from just a complaining, please ignore.)

There are still so many things I don't understand...
I am not going to like sparse-files...

  +-------------------------------------------------------------------
  |% du test2
>>|1041    test2   <--- has normal file
  |
  |% mkdir c1
  |% rsync --sparse test2/FreeBSD-14.0-RELEASE-i386-memstick.img c1/
  |
  |% du c1
>>|909     c1      <--- sparse file re-generated !
  +-------------------------------------------------------------------
... In other words, it simply treats the output as a new
    independent sparse-file and does not inherit / keep /
    preserve the condition of the original sparse-file ??

  +-------------------------------------------------------------------
  |% du test1
>>|909     test1   <--- has sparse file
  |
  |% mkdir c2 c3 c4
  |% cat test1/FreeBSD-14.0-RELEASE-i386-memstick.img       > c2/F.img
  |% cat test1/FreeBSD-14.0-RELEASE-i386-memstick.img | cat > c3/F.img
  |% dd if=test1/FreeBSD-14.0-RELEASE-i386-memstick.img    of=c4/F.img  bs=1m
  |1040+1 records in
  |1040+1 records out
  |1090527744 bytes transferred in 23.289522 secs (46824824 bytes/sec)
  |
  |% du c2 c3 c4
>>|909     c2      <--- cat            ... I was surprised by this.
  |1041    c3      <--- cat | cat
  |1041    c4      <--- dd if= of=
  +-------------------------------------------------------------------
... /bin/cat detect sparse-file and handle as it if output is not pipe ???
      (I used to think cat was more simple and dumb)
    Or tcsh does something ????  How know it is sparse ?????

-- 
You are receiving this mail because:
You are the assignee for the bug.