Determine File-Roller’s Open Files on Ubuntu

I am trying to zip up a large virtual machine to send out to a client, and my root drive ran out of space!  The virtual machine is on an external terabyte drive, so I should have plenty of space.  Here’s my notes on my research and what I learned about the process…

First, I can see the disk usage by using the df command.  The -h switch tells it to give the sizes in human readable form, in other words in gigabytes instead of bytes.

df -h / "/media/skp/Seagate Backup Plus Drive"

When I first started file-roller compressing the machine, I had almost 10G free on my root drive.  About 25% of the way through, it was down to 2.5G of free space.

So, I wanted to see what files were being opened by the file-roller process.  First, I had to find my process instance number for file roller.  I could use the ps command for that and pipe it through grep to limit the output:

skp@pistachio:~$ ps -ef | grep -i file-roller
skp 21676 2370 99 08:26 ? 00:35:38 file-roller --notify --default-dir=file:///media/skp/Seagate%20Backup%20Plus%20Drive/VMs --add file:///media/skp/Seagate%20Backup%20Plus%20Drive/VMs/HCM91-2015
skp 21995 21327 0 08:44 pts/2 00:00:00 grep --color=auto -i file-roller

So, that first number is the process instance: 21676.  Next, I can look in the /proc directory for that PID to find the open files:

ls -l /proc/21676/fd

I noticed that it did have several files in the /tmp directory:

skp@pistachio:~$ ls -lh /proc/21676/fd | grep -i /tmp/
lrwx------ 1 skp skp 64 Feb 28 08:26 17 -> /tmp/libarchive_132YJc (deleted)
lrwx------ 1 skp skp 64 Feb 28 08:26 19 -> /tmp/libarchive_JTFotg (deleted)

I hit cancel on the file-roller dialog, but that didn’t seem to fix the problem.  I had to kill the process:

kill 21676

I had to manually delete the output file: mGV0G2dQ0Uy1gO5B.HCM91-2015.7z.  When the process died, it finally gave me back my 10G on my root drive.

I decided that file-roller wasn’t going to do the trick.  I can’t keep it from creating that temporary file.  Using the 7zip directly was the best bet.  I had to install the full version first:

sudo apt-get install p7zip-full

Then, I used the actual 7z command line program to compress the directory.

cd /media/skp/Seagate Backup Plus Drive/VMs
7z a -t7z HCM91-2015.7z HCM91-2015/*

This solved my issue, and I was able to get my compressed file.


Leave a Comment

Your email address will not be published. Required fields are marked *