LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-18-2006, 11:38 PM   #1
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Rep: Reputation: 30
Disk space usage increased after move to other drive.


I might be off the mark here but how can I determine the block size of my disk.

I moved a directory from a RH9 to a FC4 machine and on the FC4 machine the same dir and files are using 27 megs more then on the old one.

Both are using ext3 file systems, both give this resulting from an fdisk -l
Units = cylinders of 16065 * 512 = 8225280 bytes

If its not block size can it be anything else that could cause this difference in disk usage?

Thanks,
 
Old 06-19-2006, 03:53 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Maybe sparse files (not sure if ext3fs support them though).
 
Old 06-19-2006, 05:08 PM   #3
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
Did you "move" or "copy"? One way to compare would be to do a du -sk on all the files and then compare. i.e. find . -type f|while read f;do du -sk "$f";done >dusk.out

Blocksize can be found (as root) with tune2fs <device>.

Sparse files could lead to an increase in filesize (re jlliagre), as could symbolic links copying the referent files or hard links losing the links. rsync at least has flags for all these potentialities (-S;-l;-H).
 
Old 06-19-2006, 06:12 PM   #4
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
It's actually being copied through Plesk which is a hosting package, there is a migration tool in there that copies everything from one server to another.

The end result is simply the same dirs with the same file with the same permissions, but still there is an extra 27 megs there.

What are sparse files?
 
Old 06-20-2006, 12:59 AM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Sparse files are files containing "holes". The system returns nulls (zeroes) when data is read from these holes.

Here's an example of creating such a file (made on Solaris and UFS):
Code:
$ mkdir sparse
$ cd sparse
$ du -k .
1
$ df -k .
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0d0p4      14421267 11763104 2513951    83%    /mnt/p4
$ dd if=/dev/zero of=sparse bs=1024k seek=1024 count=1
1+0 records in
1+0 records out
ls -l
total 2112
-rw-r--r--   1 jlliagre jlliagre 1074790400 Jun 20 07:52 sparse
$ du -k .
1057    .
$ df -k .
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0d0p4      14421267 11764161 2512894    83%    /mnt/p4
The created file reports a size of 1 gigabyte, but use only a little more than 1 kilobyte.
If you copy or backup this file with tar, the result won't be sparse, so much bigger.

Last edited by jlliagre; 06-20-2006 at 01:03 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Disk Usage and freeing up some space MicahCarrick Linux - Software 3 01-26-2006 01:49 PM
Disk Space Usage Question kaplan71 Linux - General 6 04-11-2005 02:22 PM
Disk space usage 100% on / Daliz Linux - Software 6 10-24-2004 11:03 AM
usage of disk space in a folder... Claus Linux - Software 4 09-10-2003 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration