Tuesday, July 15, 2014

NX screen sizing issue

I recently got a MacBook Pro (yes yes, look at me!) - I've been going to and from the office with it whilst running NX. Turns out NX doesn't like this very much because I'm connecting and disconnecting monitors so the available real-estate keeps changing. The last time NX just stopped resizing correctly and I was left with a view of ~1/8th of my remote screen... Turns out you can access the NX display settings using "Alt-Ctrl-0" - make sure the "remote resize" option is enabled. This fixed the issue for me.

Thursday, April 10, 2014

Freeing space from deleted files

I just deleted a 33 GiB error log that had filled up my NFS shared disk. This didn't immediately free up any space on the device. This is because the file was being held open by another process and so the space can't be freed until those processes terminate and close their connections to the file.

To check for this condition you can use lsof and then grep for deleted files. I found what was keeping my file open and killed that process (it was a "grep -c" I'd forgotten I'd set off ages ago).

The process keeping the file open is listed in the first column.

For example, in the output below the grep process is holding my stackTraces.out file open:
"grep 1234 paul 3r REG 202,166 35110973440 3285868 /nfs_share/proj/stackTraces.out (deleted)"