I am using Ubuntu Server as Domain Controller (for roaming profiles) with Samba.

I am using RAID 1+0 and the final partition has 1.9TB.

I have strange issue with the disc space. I have no idea where I lost half of it.
du command on root folder reports that all files are using about 700GB (most of it in homes) and it is about how much mine users used.
But for some reason the left space on the drive is just 500GB!

2 Answers
2

Are you running du as root? If not then there are likely to be chunks that are not seen because the current user doesn't have the right to open the directories to read the file sizes.

Also the issue may be filesystem corruption - try the relevant fsck invocations.

John may also be right about masked directories due to mount points sat over them. That is easy to rule out: boot into single user mode, make sure all other filesystems possible that are unmounted, and run du then.

If there is a process that has a file open that you've deleted, the space taken by that file isn't actually freed up until that process releases (closes) the file. This scenario is most often seen (in my experience, anyway) when you remove an excessively large log file, but the program writing to it still has it open. The file is gone, so 'du' doesn't see it, but the space isn't freed, so 'df' doesn't see the additional free space.

hm... I tried restarting the server and it still the same. Reboot should kill ale processes, right? ;)
–
Pax0rJan 14 '13 at 14:51

Yes it does. The other possibility I can think of is that you're masking files by mounting over them - if the local disk has (for example) a /usr/local filesystem that has 400G of files, but you NFS mount /usr/local from machine 2 (or even mount another local filesystem over /usr/local) that has 1G of files, du won't see the 400G. Try using the '-x' option to du to restrict it to one filesystem.
–
JohnJan 14 '13 at 15:00

Wouldnt then df should less than du in that case? Still with -x flag the outputs are the same. I have only one samba (cifs) mount. Server is used as domain controller with roaming profiles for Windows 7 and XP clients (there are about 5 clients pcs and about 10 profiles). Could some problem in samba cause that?
–
Pax0rJan 15 '13 at 16:15

ah, and from windows client the samba share also looks like it has 1.4T occupied
–
Pax0rJan 15 '13 at 16:27

Yes, after all there were one directory with lot of content from backup masked by mount point. But still du with -x flag hasn't count data in this dir.
–
Pax0rJan 17 '13 at 19:23