LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   LL and DU reporting different file sizes (https://www.linuxquestions.org/questions/linux-general-1/ll-and-du-reporting-different-file-sizes-465979/)

trewsfan 07-20-2006 02:22 PM

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

raskin 07-20-2006 02:39 PM

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.

jlliagre 07-20-2006 03:12 PM

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.

raskin 07-20-2006 03:28 PM

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..

jschiwal 07-20-2006 04:56 PM

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.

trewsfan 07-20-2006 05:56 PM

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.


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