2

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?

2

You can use sshfs to mount / on your desktop to /mnt/server/ on your pc. Then you start Kdirstat on this directory.

  • Why downnvoted? – davidbaumann Jan 31 '14 at 15:17
  • 1
    Seriously, two downvotes without a mention as to why? – peterph Jan 31 '14 at 15:18
  • 1
    In fact it's exactly what he needs to do without x fordwarding? Lol. – davidbaumann Jan 31 '14 at 15:19
  • 1
    That's why it's rather sad... – peterph Jan 31 '14 at 15:20
  • 3
    I am Gilles and I approve of this answer. – Gilles 'SO- stop being evil' Jan 31 '14 at 23:05
4

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)

  • 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
2

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.

    babaob

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.

1

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.

0

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

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:

KDE Filelight

  • 2
    X isn't installed in any o the solutions you just downvoted!! – slm Jan 31 '14 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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