Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2009 11:25:52 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Jay Hall <jhall@socket.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Backup Size
Message-ID:  <20090810162552.GD54485@dan.emsphone.com>
In-Reply-To: <6206A242-7226-48E3-8D09-A1D3A651F2A8@socket.net>
References:  <6206A242-7226-48E3-8D09-A1D3A651F2A8@socket.net>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Aug 10), Jay Hall said:
> I am sure there is an easy explanation for this, but I cannot find it.
> 
> I am backing up my /etc directory using the following command.
> 
> tar -cvf - /etc | dd of=/dev/nsa1 obs=10240
> 
> When the command completes, I receive the following message.
> 
> 3080+0 records in
> 154+0 records out
> 1576960 bytes transferred in 0.179921 secs (8764740 bytes/sec)
> 
> What concerns me is when running du -h /etc, the size of the folder is
> reported as 1.7M.
> 
> Is the number of bytes written to the tape less than the reported size of
> the directory because of the way the files are written to the tape?  If
> so, how can the amount of space used be calculated?

du prints the number of disk blocks used by a directory tree.  Your
filesystem probably was formatted with 16k blocks and 2k fragment size; This
means that the minimum space du will report for each file is 2k.  Tar uses
512-byte blocks internally, so a directory with a lot of small files in it
(/etc for example) will take up less space as a tar file than on disk.
 
Try running "du -ha /etc", to see what du reports for each file under /etc.

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090810162552.GD54485>