LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Xorg not closing files?? System reporting full hard disk!! (http://www.linuxquestions.org/questions/linux-software-2/xorg-not-closing-files-system-reporting-full-hard-disk-861711/)

green_dood 02-09-2011 06:22 PM

Xorg not closing files?? System reporting full hard disk!!
 
Hi. I opened this thread in Ubuntu forums with no luck at all. Hope someone can give me a clue of what happens.

http://ubuntuforums.org/showthread.php?t=1683746

Recently, gnome has been warning me about low disk space, always less than 1.5GiGs.

The problem is, baobab (disk usage analyzer) tells me that there are something like 50GiG free. I am sure that I have the free space ( I can write big files ) but the system keeps reporting low disk space. Even
Code:

df -h
looks wrong:


Code:

Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1    ext4    221G  209G  638M 100% /
none      devtmpfs    2.0G  272K  2.0G  1% /dev
none        tmpfs    2.0G  1.9M  2.0G  1% /dev/shm
none        tmpfs    2.0G  328K  2.0G  1% /var/run
none        tmpfs    2.0G    0  2.0G  0% /var/lock
none      debugfs    221G  209G  638M 100% /var/lib/ureadahead/debugfs

Wandering in some other thread, someone pointed out that some program may be deleting files ... but not closing them, and the offending program can be fount with
Code:

sudo lsof -s | grep DEL | sort -rnk 7,7
,which gives a wall of results like these
Code:

Xorg      1334                root  DEL      REG                0,4                8573 /drm mm object
Xorg      1334                root  DEL      REG                0,4                8572 /drm mm object
Xorg      1334                root  DEL      REG              0,4                8560 /drm mm object
Xorg      1334                root  DEL      REG                0,4                8559 /drm mm object
Xorg      1334                root  DEL      REG                0,4                8558 /drm mm object
Xorg      1334                root  DEL      REG                0,4                8557 /drm mm object
Xorg      1334                root  DEL      REG                0,4                8556 /drm mm object

Perhaps Xorg is having a very bad behavior?? What can I do to force it close the files , or whatever else that can give me back the hard disk space ... working is unpractical since most applications (gnome apps) think that there is no space left on the device.


My sistem is Ubuntu 10.10 64bit, with all the upgrades until today (proposed updates enabled)
XORG INFO


X.Org X Server 1.9.0
Release Date: 2010-08-20
X Protocol Version 11, Revision 0


Thanks in advance.

frankbell 02-09-2011 09:16 PM

I ran into a problem where the amount of free space was a lot less than it should have been on my Debian box.

I installed kdirstat (it's in the Ubunutu repos) and used it to look at the drive usage; it displays nice pie graphs of usage of the selected directories.

In my case, /var/logs was out of hand, so I re-looked at how logrotate was being implemented and reconfigured it. It doesn't sound as if that is likely to be your situation, but kdirstats is a handy diagnostic tool.

Looking at it may help you figure out where in the problem is.

PTrenholme 02-09-2011 10:10 PM

According to man lsof, those are all regular files (REG) that have been deleted (DEL). That is, the space used by those files has been labeled as being available for other uses, but not yet used. Remember, most Linux file systems (such as the default ext4 file system used by Ubuntu) avoid the problem of file fragmentation by trying very hard to only write a file to a disk area where the whole file can fit. When a file is "deleted," its INODE list is added to the available pool, but not actually used 'till it's needed. When you see a DEL in the lsof listing for a REG file, it's just telling you that that file's space is available for use, and not counted in the used space in the file system.

In the list you posted, those files were used by the X-server for display windows that have been closed. The space will be reused when the server opens a new window.

Note that those files are all 8K bytes in size, so their total is not of any significance on your size of disk.

If you're concerned about what's eating your drive, look at the find command. For example:
Code:

$ sudo find / -size +50M
[sudo] password for Peter:
/proc/kcore
find: `/proc/21908': No such file or directory
find: `/proc/21912/task/21912/fd/6': No such file or directory
find: `/proc/21912/task/21912/fdinfo/6': No such file or directory
find: `/proc/21912/fd/6': No such file or directory
find: `/proc/21912/fdinfo/6': No such file or directory
/usr/share/icons/gnome/icon-theme.cache
/usr/share/icons/oxygen/icon-theme.cache
/usr/share/icons/hicolor/icon-theme.cache
/usr/share/ibus-pinyin/db/open-phrase.db
/usr/lib/debug/usr/libexec/gcc/x86_64-redhat-linux/4.5.1/cc1objplus.debug
/usr/lib/debug/usr/libexec/gcc/x86_64-redhat-linux/4.5.1/cc1plus.debug
/usr/lib/debug/usr/lib64/libQtScript.so.4.7.1.debug
[many more lines...]

finds all files in my file system that are no smaller than 50 megabytes. (As you can see at the start of the output, since "everything is a file" in UNIX-like system, system memory (/proc/kcore) is listed. If you don't want that, find has a -type option that would restrict it to regular files. See man find or info find) for more details.

cantab 02-10-2011 05:11 AM

If you want a graphical approach, try running baobab as root. Your normal user might not see all files. (Though I'm not sure what might be taking the space that your normal user can't see...)

PTrenholme 02-10-2011 12:11 PM

Thanks cantab!:hattip: I'd forgotten about baobab.


All times are GMT -5. The time now is 03:18 PM.