LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-20-2006, 02:22 PM   #1
trewsfan
LQ Newbie
 
Registered: Jul 2005
Posts: 13

Rep: Reputation: 0
LL and DU reporting different file sizes


The total storage on the system in question is 687GB. It's an ext3 filesystem. When I do an "ll", it shows many files as having a size around 481 GB, which is impossible. But when I do a "du", it shows that those files really only use 4K of disk space.

Can anyone tell me what's going on? The console output is below...

root@fuji Derek]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
687G 418G 235G 65% /
/dev/sda1 99M 25M 69M 27% /boot
none 251M 0 251M 0% /dev/shm
/dev/sdb1 459G 267G 169G 62% /media/nexstar

[root@fuji User Interface]# ll
total 1296
-rwxrwxrwx 1 usersdata users 2964 Jun 23 12:51 Bungalow.~cp
-rwxrwxrwx 1 usersdata users 3122 Jun 23 12:51 Bungalow.cpp
-rwxrwxrwx 1 usersdata users 3127 Jun 23 12:51 Bungalow.~cpp
-rwxrwxrwx 1 usersdata users 1443 Jun 23 12:51 Bungalow.~df
-rwxrwxrwx 1 usersdata users 1505 Jun 23 12:51 Bungalow.dfm
-rwxrwxrwx 1 usersdata users 1505 Jun 23 12:51 Bungalow.~dfm
-rwxrwxrwx 1 usersdata users 109 Jun 23 12:51 Bungalow.h
-rwxrwxrwx 1 usersdata users 1643 Jun 23 12:51 Bungalow.~h
-rwxrwxrwx 1 usersdata users 86086 Jun 23 12:51 Bungalow.obj
-rwxrwxrwx 1 usersdata users 481042825342 Jun 23 12:51 Card.~cp
-rwxrwxrwx 1 usersdata users 481043677283 Jun 23 12:51 Card.cpp
-rwxrwxrwx 1 usersdata users 1971 Jun 23 12:51 Card.~df
-rwxrwxrwx 1 usersdata users 438093217918 Jun 23 12:51 Card.dfm
-rwxrwxrwx 1 usersdata users 102 Jun 23 12:51 Card.h
-rwxrwxrwx 1 usersdata users 7340144 Jun 23 12:51 Card.~h
-rwxrwxrwx 1 usersdata users 6815870 Jun 23 12:51 Card.obj
-rwxrwxrwx 1 usersdata users 4081 Jun 23 12:51 Chassis.~cp
-rwxrwxrwx 1 usersdata users 112 Jun 23 12:51 Chassis.cpp
-rwxrwxrwx 1 usersdata users 3974 Jun 23 12:51 Chassis.~cpp
-rwxrwxrwx 1 usersdata users 1426 Jun 23 12:51 Chassis.~df
-rwxrwxrwx 1 usersdata users 1455 Jun 23 12:51 Chassis.dfm
-rwxrwxrwx 1 usersdata users 1455 Jun 23 12:51 Chassis.~dfm
-rwxrwxrwx 1 usersdata users 106 Jun 23 12:51 Chassis.h
-rwxrwxrwx 1 usersdata users 1453 Jun 23 12:51 Chassis.~h
-rwxrwxrwx 1 usersdata users 86193 Jun 23 12:51 Chassis.obj
-rwxrwxrwx 1 usersdata users 543 Jun 23 12:51 EventLog.~cp
-rwxrwxrwx 1 usersdata users 1858 Jun 23 12:51 EventLog.cpp
-rwxrwxrwx 1 usersdata users 244 Jun 23 12:51 EventLog.~df
-rwxrwxrwx 1 usersdata users 515 Jun 23 12:51 EventLog.dfm
-rwxrwxrwx 1 usersdata users 1066 Jun 23 12:51 EventLog.h
-rwxrwxrwx 1 usersdata users 773 Jun 23 12:51 EventLog.~h
-rwxrwxrwx 1 usersdata users 77981 Jun 23 12:51 EventLog.obj
-rwxrwxrwx 1 usersdata users 3320 Jun 23 12:51 Global.~cp
-rwxrwxrwx 1 usersdata users 3320 Jun 23 12:51 Global.cpp
-rwxrwxrwx 1 usersdata users 3326 Jun 23 12:51 Global.~cpp
-rwxrwxrwx 1 usersdata users 468158120036 Jun 23 12:51 Global.h
-rwxrwxrwx 1 usersdata users 436 Jun 23 12:51 Global.~h
-rwxrwxrwx 1 usersdata users 63593 Jun 23 12:51 Global.obj
-rwxrwxrwx 1 usersdata users 4492 Jun 23 12:51 HigherLev.~cp
-rwxrwxrwx 1 usersdata users 4494 Jun 23 12:51 HigherLev.cpp
-rwxrwxrwx 1 usersdata users 1378 Jun 23 12:51 HigherLev.~df
-rwxrwxrwx 1 usersdata users 1378 Jun 23 12:51 HigherLev.dfm
-rwxrwxrwx 1 usersdata users 1112 Jun 23 12:51 HigherLev.h
-rwxrwxrwx 1 usersdata users 1112 Jun 23 12:51 HigherLev.~h
-rwxrwxrwx 1 usersdata users 80044 Jun 23 12:51 HigherLev.obj
-rwxrwxrwx 1 usersdata users 2775 Jun 23 12:51 Search.~cp
-rwxrwxrwx 1 usersdata users 2775 Jun 23 12:51 Search.cpp
-rwxrwxrwx 1 usersdata users 102 Jun 23 12:51 Search.~df
-rwxrwxrwx 1 usersdata users 811 Jun 23 12:51 Search.dfm
-rwxrwxrwx 1 usersdata users 481042825342 Jun 23 12:51 Search.h
-rwxrwxrwx 1 usersdata users 112 Jun 23 12:51 Search.~h
-rwxrwxrwx 1 usersdata users 79471 Jun 23 12:51 Search.obj
-rwxrwxrwx 1 usersdata users 3456 Jun 23 12:51 Yard.~cp
-rwxrwxrwx 1 usersdata users 3368 Jun 23 12:51 Yard.cpp
-rwxrwxrwx 1 usersdata users 102 Jun 23 12:51 Yard.~cpp
-rwxrwxrwx 1 usersdata users 455272956015 Jun 23 12:51 Yard.~df
-rwxrwxrwx 1 usersdata users 112 Jun 23 12:51 Yard.dfm
-rwxrwxrwx 1 usersdata users 974 Jun 23 12:51 Yard.~dfm
-rwxrwxrwx 1 usersdata users 1418 Jun 23 12:51 Yard.h
-rwxrwxrwx 1 usersdata users 1418 Jun 23 12:51 Yard.~h
-rwxrwxrwx 1 usersdata users 112 Jun 23 12:51 Yard.obj
[root@fuji User Interface]# du -h ./*
4.0K ./Bungalow.~cp
4.0K ./Bungalow.cpp
4.0K ./Bungalow.~cpp
4.0K ./Bungalow.~df
4.0K ./Bungalow.dfm
4.0K ./Bungalow.~dfm
4.0K ./Bungalow.h
4.0K ./Bungalow.~h
92K ./Bungalow.obj
4.0K ./Card.~cp
4.0K ./Card.cpp
4.0K ./Card.~df
4.0K ./Card.dfm
4.0K ./Card.h
4.0K ./Card.~h
40K ./Card.obj
4.0K ./Chassis.~cp
4.0K ./Chassis.cpp
4.0K ./Chassis.~cpp
4.0K ./Chassis.~df
4.0K ./Chassis.dfm
4.0K ./Chassis.~dfm
4.0K ./Chassis.h
4.0K ./Chassis.~h
92K ./Chassis.obj
4.0K ./EventLog.~cp
4.0K ./EventLog.cpp
4.0K ./EventLog.~df
4.0K ./EventLog.dfm
4.0K ./EventLog.h
4.0K ./EventLog.~h
84K ./EventLog.obj
4.0K ./Global.~cp
4.0K ./Global.cpp
4.0K ./Global.~cpp
4.0K ./Global.h
4.0K ./Global.~h
68K ./Global.obj
8.0K ./HigherLev.~cp
8.0K ./HigherLev.cpp
4.0K ./HigherLev.~df
4.0K ./HigherLev.dfm
4.0K ./HigherLev.h
4.0K ./HigherLev.~h
84K ./HigherLev.obj
4.0K ./Search.~cp
4.0K ./Search.cpp
4.0K ./Search.~df
4.0K ./Search.dfm
4.0K ./Search.h
4.0K ./Search.~h
84K ./Search.obj
4.0K ./Yard.~cp
4.0K ./Yard.cpp
4.0K ./Yard.~cpp
4.0K ./Yard.~df
4.0K ./Yard.dfm
4.0K ./Yard.~dfm
4.0K ./Yard.h
4.0K ./Yard.~h
4.0K ./Yard.obj
 
Old 07-20-2006, 02:39 PM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Try running fsck.. Maybe some files are corrupted - and lost, but I'm not sure.

EDIT:forgot to say that to run fsck you have to boot from something bootable and check that partition is not mounted.
 
Old 07-20-2006, 03:12 PM   #3
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
Quote:
Originally Posted by trewsfan
The total storage on the system in question is 687GB. It's an ext3 filesystem. When I do an "ll", it shows many files as having a size around 481 GB, which is impossible.
It is actually perfectly possible to create such files on filesystems supporting "sparse files", for which only blocks containing actual data are allocated.
 
Old 07-20-2006, 03:28 PM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Yes, but knowing it is a Borland C++Builder project copied from Windows or on Windows partition (did I guess?) or something similar, I suppose it's not good that there are sparse files..
 
Old 07-20-2006, 04:56 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
-rwxrwxrwx 1 usersdata users 2964 Jun 23 12:51 Bungalow.~cp
-rwxrwxrwx 1 usersdata users 481042825342 Jun 23 12:51 Card.~cp
-rwxrwxrwx 1 usersdata users 481043677283 Jun 23 12:51 Card.cpp
-rwxrwxrwx 1 usersdata users 438093217918 Jun 23 12:51 Card.dfm
-rwxrwxrwx 1 usersdata users 468158120036 Jun 23 12:51 Global.h
-rwxrwxrwx 1 usersdata users 481042825342 Jun 23 12:51 Search.h
-rwxrwxrwx 1 usersdata users 455272956015 Jun 23 12:51 Yard.~df
You could delete the files with extensions starting with the tilde character. For "Card.cpp", "Global.h" and "Search.h", see if you can load them in an editor and resave them, since they are text files. I don't know if Card.dfm is a normal text file or a binary file. Maybe you could use cat to copy them to a backup before deleting the original. Of course run fsck to check the partition as well. I noticed that the timestamps are identical, so it looks like they were copied from another location, rather than produced during a build process.
 
Old 07-20-2006, 05:56 PM   #6
trewsfan
LQ Newbie
 
Registered: Jul 2005
Posts: 13

Original Poster
Rep: Reputation: 0
You guys were right... they were copied from a Windows machine that allowed sparse files. I deleted the ~ files and used vi to open then save the others, which fixed this issue. Thanks.

PS: I'm still going to run fsck once I make a Live CD.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
sum total of file sizes allelopath Linux - General 3 01-07-2006 08:30 AM
File Server Reporting Software tbeehler Linux - Software 5 09-01-2005 12:43 PM
Linux file sizes (shell) Zeno McDohl Linux - General 8 06-03-2005 07:18 AM
reiserfs file sizes doralsoral Linux - Software 1 01-19-2005 03:52 PM
DVD File Sizes Maestro485 Linux - Software 1 12-21-2004 07:41 PM

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

All times are GMT -5. The time now is 07:47 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