Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

When I am using df it reports:

/dev/md1              1,9T  1,4T  423G  76% /

But du on root reports: 671G.

So where is mine disc space?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
Yes, it was masked dir. I get it earlier but as your answer is correct I will accept it :) –  Pax0r Jan 17 '13 at 19:22

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.

share|improve this answer
    
hm... I tried restarting the server and it still the same. Reboot should kill ale processes, right? ;) –  Pax0r Jan 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. –  John Jan 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? –  Pax0r Jan 15 '13 at 16:15
    
ah, and from windows client the samba share also looks like it has 1.4T occupied –  Pax0r Jan 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. –  Pax0r Jan 17 '13 at 19:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.