On 01/14/2015 at 09:16 AM, Rodolfo Medina wrote: > Hi all. > > I realized that the same directory, once copied onto vfat pendrive > with `cp' or also `rsync', have a size (detected with `du') that > doesn't match with the source. > > Please help.
This is probably because du reports "size on disk" - that is, the amount by which the available space on the disk would be increased if the file weren't present - rather than the actual number of bytes in the file, and the difference between those two numbers will vary depending on what filesystem the file is sitting on. Specifically, FAT-based filesystems have different overhead from EXT* filesystems, which are probably what a modern Debian system is using by default. Thus, since du reports "total size including filesystem overhead", the space consumed by a file on a FAT FS will likely be different from the space consumed by that file on an EXT FS. The principle underlying this has been reported by Windows at least as far back as Windows 95. If you right-click on a file in the Windows file-manager program (Windows Explorer) and choose Properties, the resulting dialog will give you two different file-size values; I believe they're labeled "size in bytes" and "size on disk". The latter is what du reports, and is what differs depending on what filesystem the file is sitting on. -- The Wanderer hopes that this is less confusing to read than it felt like when he was writing it The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw
signature.asc
Description: OpenPGP digital signature