Why does a copied file have a different size?


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?
files transfer
add a comment |Â
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?
files transfer
1
superuser.com/questions/300409/is-ext4-more-expensive-than-ntfs
â Bruni
Apr 25 at 15:11
add a comment |Â
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?
files transfer
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?
files transfer
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
add a comment |Â
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
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
(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
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
superuser.com/questions/300409/is-ext4-more-expensive-than-ntfs
â Bruni
Apr 25 at 15:11