I have a headless server running Centos 5.9. I can only SSH into it, is it possible to use KdirStat or a similar tool to get a graphical view of disk usage?
6 Answers
Use the qdirstat-cache-writer
or kdirstat-cache-writer
Perl script on your server, copy the file to your desktop machine and view it there with QDirStat / KDirStat.
See also:
https://github.com/shundhammer/qdirstat
https://github.com/shundhammer/qdirstat/tree/master/scripts
Update 2017-02-23: Detailed instructions available at
https://github.com/shundhammer/qdirstat/blob/master/doc/QDirStat-for-Servers.md
-- HuHa (QDirStat / KDirStat author)

- 151
-
This! :) Please also note that for cache import of "/"-directory to work properly you need to use the latest dev version (build yourself) - currently available ppa of last release for ubuntu contains a bug. Building works like a charm though. Perfect solution though! – icyerasor Aug 24 '16 at 12:16
You can use sshfs to mount /
on your desktop to /mnt/server/
on your pc. Then you start Kdirstat on this directory.

- 356
-
-
1
-
1In fact it's exactly what he needs to do without x fordwarding? Lol. – davidbaumann Jan 31 '14 at 15:19
-
1
-
3
-
Yeah Elias came in here earlier today and DV'ed all of our A's and then posted his, assuming that they were all incorrect. All of the A's are appropriate, try not to let 1 bad seed bother you 8-) – slm Jan 31 '14 at 23:08
-
If you're running an X server on the system you're running ssh
on you should need to do nothing more than this:
$ ssh -X remoteserver KdirStat
Here for example I'm ssh
'ing into a CentOS 5.9 system running Babaob, another disk utilization app that comes with GNOME.
Incidentally there are a lot of applications for analyzing disk usage. I wrote them up here on my blog in a post titled: Command Line Tools for Analyzing Disk Usage on Fedora/CentOS/RHEL.

- 369,824
You can log into the server and use du
, redirecting that output to a file (-a
= include files, not just directories; -x
= one filesystem only):
$ du -ax / > ~/root-du
then you can scp that file back, and browse it graphically with xdiskusage
$ scp server:root-du ~/root-du
$ xdiskusage ~/root-du
Of course, you can run du
remotely over ssh, and pipe it to xdiskusage
as well:
$ ssh server 'du -ax /' | xdiskusage
but I prefer to use files, so I can re-open it, compare before & after, etc.

- 109,670
You probably don't have all the X environment (libraries, programs etc), but ssh can do X forwarding Trusted with -Y
untrusted -X
options.
try
xhost +
ssh -X user@remote_server
xclock
exit
xhost -

- 10,463
Having X installed/running on a server is considered to be a really bad practice, mostly because of security and stability issues.
Simply use KDE's KIOs which make it really easy to use a lot of different protocols in KDE applications.
Use a URL like sftp://user@host/some/directory
to access the remote filesystem via SSH/SFTP:

- 1,053