Posted in Debian

Cleanup rootfs under Debian VirtualBox VM

This caused me some pain when I was happily working on some Angular.js and decided to install harp via npm.

sudo npm install -g harp

Since this was installed with the “-g” option and I had been using that option for a number of other modules, it placed all of these under /root.

Filesystem Size Used Avail Use% Mounted on
rootfs 323M 190M 117M 63% /
udev 10M 0 10M 0% /dev
tmpfs 1.1G 632K 1.1G 1% /run
/dev/disk/by-uuid/9fbc56af-98dc-468f-835c-202a10fab4c5 323M 190M 117M 63% /
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 340K 3.9G 1% /run/shm
/dev/sda9 59G 38G 19G 68% /home
/dev/sda8 368M 14M 336M 4% /tmp
/dev/sda5 8.3G 4.3G 3.6G 55% /usr
/dev/sda6 2.8G 864M 1.8G 33% /var
none 421G 114G 308G 27% /media/sf_Shared

“rootfs” quickly filled up to 100%. A quick fix to this was to just create a symlink to a new /home/rootdircaches directory and move the “/root/.npm” directory there.
Another option was to cleanup any debian packages via

apt-get clean

but moving cache directories from /root and directories from /opt seemed to quickly free up space.