size discrepancy after tarring a dir

Phil Meyer pmeyer at themeyerfarm.com
Mon Sep 6 15:26:02 UTC 2010


  On 09/03/2010 03:21 PM, JD wrote:
>    I have two mounted disks,  both ext3 mounted
> as
> /sdb1
> /sdc1
>
> On /sdb1 I have a directory, let's call it dirx.
>
> 1. rm -rf /sdc1/dirx
>
> 2. cd /sdb1
> 3. tar cf - dirx | tar -C /sdc1 -xpf -
>
> Neither dir (/sdb1 and /sdc1) are not accessed by any programs other
> than the tar program (and of course /sdb1 is the shell's CWD).
> The shell's history file is in my home dir.
>
> After tar:
>
> 4. du -sk dirx  /sdc1/dirx
> 2904536    /sdc1/dirx
> 2802124    dirx
>
> So, why this size inflation by 104MiB ?
>
> I repeated the process twice. Same difference.
>
> Other dirs tarred in this way from sdb1 to sdc1 do not show this
> discrepancy.
>
> Dirx contains mp3's.
>
>
>


You may have some sparse files.  Add --sparse to your tar command and 
see what happens.

If the destination was smaller in size, that would account for 
fragmentation.  But since its bigger than the original, it is most 
likely caused by sparse file(s).

Good Luck!


More information about the users mailing list