Why does a copied file have a different size?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
3
down vote

favorite












When I copy files between two hard drives on the same Ubuntu 14.04 system, using the du -s command, I get different values. For an 11.3 GB files the original is 11015704 and the new is 11015628. The original has ext4 and it was transfered to an NTFS file system.



Why are the file sizes different?







share|improve this question


















  • 1




    superuser.com/questions/300409/is-ext4-more-expensive-than-ntfs
    – Bruni
    Apr 25 at 15:11














up vote
3
down vote

favorite












When I copy files between two hard drives on the same Ubuntu 14.04 system, using the du -s command, I get different values. For an 11.3 GB files the original is 11015704 and the new is 11015628. The original has ext4 and it was transfered to an NTFS file system.



Why are the file sizes different?







share|improve this question


















  • 1




    superuser.com/questions/300409/is-ext4-more-expensive-than-ntfs
    – Bruni
    Apr 25 at 15:11












up vote
3
down vote

favorite









up vote
3
down vote

favorite











When I copy files between two hard drives on the same Ubuntu 14.04 system, using the du -s command, I get different values. For an 11.3 GB files the original is 11015704 and the new is 11015628. The original has ext4 and it was transfered to an NTFS file system.



Why are the file sizes different?







share|improve this question














When I copy files between two hard drives on the same Ubuntu 14.04 system, using the du -s command, I get different values. For an 11.3 GB files the original is 11015704 and the new is 11015628. The original has ext4 and it was transfered to an NTFS file system.



Why are the file sizes different?









share|improve this question













share|improve this question




share|improve this question








edited Apr 25 at 16:29









Eliah Kagan

79.4k20221359




79.4k20221359










asked Apr 25 at 14:46









rubytiger1

211




211







  • 1




    superuser.com/questions/300409/is-ext4-more-expensive-than-ntfs
    – Bruni
    Apr 25 at 15:11












  • 1




    superuser.com/questions/300409/is-ext4-more-expensive-than-ntfs
    – Bruni
    Apr 25 at 15:11







1




1




superuser.com/questions/300409/is-ext4-more-expensive-than-ntfs
– Bruni
Apr 25 at 15:11




superuser.com/questions/300409/is-ext4-more-expensive-than-ntfs
– Bruni
Apr 25 at 15:11










1 Answer
1






active

oldest

votes

















up vote
6
down vote













(Most useful) file systems store files in blocks of (more or less) fixed size. That means a typical file will occupy more space than its logical size because there are some unused bytes left over in one of its file system blocks. The blocks size can vary by file system type and/or can be configured during file system creation which means that the disk usage of the same file on one file system may differ on another.



By default du reports the actual space that files occupy on the drive (i. e. the number of occupied blocks multiplied by the block size).



If you want du to report the (collective) logical file sizes you need to use the --apparent-size option (or -b which implies --apparent-size).



From the du(1) manual:




--apparent-size – print apparent sizes, rather than disk usage; although the apparent size is usually smaller, it may be larger due to holes in ('sparse') files, internal fragmentation, indirect blocks, and the like







share|improve this answer






















  • As you’ve never accepted an answer before: if this answers your question, don’t forget to click the grey ☑ under the number at the left of this text to accept it, which means “yes, this answer is valid”!
    – David Foerster
    Apr 26 at 1:04










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028118%2fwhy-does-a-copied-file-have-a-different-size%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
6
down vote













(Most useful) file systems store files in blocks of (more or less) fixed size. That means a typical file will occupy more space than its logical size because there are some unused bytes left over in one of its file system blocks. The blocks size can vary by file system type and/or can be configured during file system creation which means that the disk usage of the same file on one file system may differ on another.



By default du reports the actual space that files occupy on the drive (i. e. the number of occupied blocks multiplied by the block size).



If you want du to report the (collective) logical file sizes you need to use the --apparent-size option (or -b which implies --apparent-size).



From the du(1) manual:




--apparent-size – print apparent sizes, rather than disk usage; although the apparent size is usually smaller, it may be larger due to holes in ('sparse') files, internal fragmentation, indirect blocks, and the like







share|improve this answer






















  • As you’ve never accepted an answer before: if this answers your question, don’t forget to click the grey ☑ under the number at the left of this text to accept it, which means “yes, this answer is valid”!
    – David Foerster
    Apr 26 at 1:04














up vote
6
down vote













(Most useful) file systems store files in blocks of (more or less) fixed size. That means a typical file will occupy more space than its logical size because there are some unused bytes left over in one of its file system blocks. The blocks size can vary by file system type and/or can be configured during file system creation which means that the disk usage of the same file on one file system may differ on another.



By default du reports the actual space that files occupy on the drive (i. e. the number of occupied blocks multiplied by the block size).



If you want du to report the (collective) logical file sizes you need to use the --apparent-size option (or -b which implies --apparent-size).



From the du(1) manual:




--apparent-size – print apparent sizes, rather than disk usage; although the apparent size is usually smaller, it may be larger due to holes in ('sparse') files, internal fragmentation, indirect blocks, and the like







share|improve this answer






















  • As you’ve never accepted an answer before: if this answers your question, don’t forget to click the grey ☑ under the number at the left of this text to accept it, which means “yes, this answer is valid”!
    – David Foerster
    Apr 26 at 1:04












up vote
6
down vote










up vote
6
down vote









(Most useful) file systems store files in blocks of (more or less) fixed size. That means a typical file will occupy more space than its logical size because there are some unused bytes left over in one of its file system blocks. The blocks size can vary by file system type and/or can be configured during file system creation which means that the disk usage of the same file on one file system may differ on another.



By default du reports the actual space that files occupy on the drive (i. e. the number of occupied blocks multiplied by the block size).



If you want du to report the (collective) logical file sizes you need to use the --apparent-size option (or -b which implies --apparent-size).



From the du(1) manual:




--apparent-size – print apparent sizes, rather than disk usage; although the apparent size is usually smaller, it may be larger due to holes in ('sparse') files, internal fragmentation, indirect blocks, and the like







share|improve this answer














(Most useful) file systems store files in blocks of (more or less) fixed size. That means a typical file will occupy more space than its logical size because there are some unused bytes left over in one of its file system blocks. The blocks size can vary by file system type and/or can be configured during file system creation which means that the disk usage of the same file on one file system may differ on another.



By default du reports the actual space that files occupy on the drive (i. e. the number of occupied blocks multiplied by the block size).



If you want du to report the (collective) logical file sizes you need to use the --apparent-size option (or -b which implies --apparent-size).



From the du(1) manual:




--apparent-size – print apparent sizes, rather than disk usage; although the apparent size is usually smaller, it may be larger due to holes in ('sparse') files, internal fragmentation, indirect blocks, and the like








share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 26 at 10:44

























answered Apr 25 at 15:25









David Foerster

26k1361106




26k1361106











  • As you’ve never accepted an answer before: if this answers your question, don’t forget to click the grey ☑ under the number at the left of this text to accept it, which means “yes, this answer is valid”!
    – David Foerster
    Apr 26 at 1:04
















  • As you’ve never accepted an answer before: if this answers your question, don’t forget to click the grey ☑ under the number at the left of this text to accept it, which means “yes, this answer is valid”!
    – David Foerster
    Apr 26 at 1:04















As you’ve never accepted an answer before: if this answers your question, don’t forget to click the grey ☑ under the number at the left of this text to accept it, which means “yes, this answer is valid”!
– David Foerster
Apr 26 at 1:04




As you’ve never accepted an answer before: if this answers your question, don’t forget to click the grey ☑ under the number at the left of this text to accept it, which means “yes, this answer is valid”!
– David Foerster
Apr 26 at 1:04

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028118%2fwhy-does-a-copied-file-have-a-different-size%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

GRUB: Fatal! inconsistent data read from (0x84) 0+xxxxxx

`kcmshell` modules relation with `/usr/share/applications`

How to enroll fingerprints to Ubuntu 17.10 with VFS491