20

Now my installation of Ubuntu costs me more than 100 GB of the hard drive space. And whenever I try fslint and fdupes, they say Permission denied to delete the duplicates. Please help me guys.

Additional Info

Output of df:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             296G  191G   90G  68% /
udev                  993M  4.0K  993M   1% /dev
tmpfs                 401M  824K  401M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                 1003M  552K 1002M   1% /run/shm
/home/zipro/.Private  296G  191G   90G  68% /home/zipro

The faulty file is a 174GB /var/log/uvcydnctrl-udev.log

2
  • 4
    This is still a problem in Ubuntu 14.04 LTS Nov 8, 2014 at 20:39
  • 4
    This is still a problem in Ubuntu 21.04
    – John Mee
    Sep 9, 2021 at 23:22

6 Answers 6

18

1. Step: Find out what problem you actually have

When your filesystem is unexpectedly full, there are a lot of possible causes. See Eliah Kagan's answer for some more about this. In the vast majority of cases it should be easy to identify (and eventually repair) the real cause, so reformatting/reinstalling would not be necessary.

So the first step is to find out, what exactly is the problem, i.e., where has the missing space gone. So first execute

df -hl -x tmpfs -x devtmpfs

This shows a list of all the used partitions of the disks in your machine, their size, how full they are and their mount point. From this list, take the one which you think is too full and note its mount point. In your case, it is the root file system which is mounted at /.

Now we analyze where inside this file system the space is used. Execute

 sudo du -xhsc /* 2> /dev/null

(Replace / with the mount point identified above.) It needs sudo because not all directories might be readable for your user. It may take some time (especially on large file systems) because it needs to visit every single directory on them.

What this command does is to show you each file and directory inside the given directory together with its size (including subdirectories). So from this list take the one(s) which you think is larger than it should be, and call the command again on this directory. (That is, run the command again, but with the name of a big directory from a previous listing replacing /.)

For example, in your case it was clear /var was the only big directory, so you would need to execute

 sudo du -xhsc /var/* 2> /dev/null

Continue with these steps until you have either found a single file which is so big, or you have found a directory with lots of files that together take up all that space.

In your case the next step was to execute

 sudo du -xhsc /var/log/* 2> /dev/null

because /var/log was so big, and this showed you that there was a single log file named uvcdynctrl-udev.log with 174GB (which is obviously bad).

2. Step: Identify why the files are there and why they are so big

Now we need to find out why the identified are there, or why they are so big, if they are expected to be there.

In your case, a log file in /var/log is nothing suspicious, but its size surely is. Fortunately, a Google search simply with the file name brings up the following bug report as the first hit, which is clearly the same problem as we have: http://bugs.launchpad.net/ubuntu/+source/libwebcam/+bug/811604

3. Step: Solve the problem

In this case, a log file of some webcam-related stuff seems not to be interesting, so we can easily delete it with the command sudo rm /var/log/uvcdynctrl-udev.log and free all the space.

Unfortunately, the bug report is still open, and there are no solutions or workarounds in the comments, so you probably have to live with this bug for now. You can delete the log file from time to time to free some space.

1
  • Before running sudo rm /var/log/uvcdynctrl-udev.log You can also analyze directories manually with sudo baobab with GUI. It is the program that's been shown as "Disk Usage Analyzer" in the application menu. Mar 8, 2022 at 8:08
11

The problem IS this package: uvcdynctrl-udev.

It's a useles and buggie program. It should be simply removed from debian and ubuntu repos. It shoudn't be installed. This package not only creates this HUGE log files, but it also causes Cheese and other web-cam apps to crash or work very badly (Can't capture video at full resolution with Cheese or Guvcview? REMOVE THIS PACKAGE AND IT WORKS AS IT SHOULD!

This bug has been around for years and the manteiner of uvcdyn.... doesn't seem to care about it.

The solution is simple: sudo apt-get remove uvcdynctrl-udev.

If you wanna be sure about what you are doing, use Synaptic instead. Serch for the buggie package uvcdynctrl-udev and uvcdynctrl-udev-data. Mark'em for complete removal. You'll notice it wont affect other programs, they're not dependencies, so you can safely remove it. Do it.

Then check /var/log, search this huge uvcdynctrl-udev.log, as root, delete it. (open a terminal **

cd /var/log
sudo rm uvcdynctrl-udev.log

** ) Believe me, you wont miss this package.

2
  • tuprofe demusica is right! I almost threw away a microscope because I thought it was broken. I gave it one more try after deleting this package. Mar 26, 2019 at 2:17
  • Have just performed removing the package, which in my case was done without the -udev suffix, so: sudo apt-get remove uvcdynctrl. Removed the log file after and haven't had any issues in other applications whatsoever. May 25, 2023 at 10:36
6

If you copied and pasted the system files, manually reproducing them, then you should provide more information about what you did to copy and paste them, where you pasted them, anything you can remember. Even making an extra copy of all the system files on your machine is unlikely to cause anywhere near 100 GB of disk usage. Ubuntu requires less than 5 GB of available space to be installed, and even an Ubuntu system with many packages installed is unlikely for its system files to take up more than several times that size. You would probably have to make many copies to take up that much space. Or perhaps you copied files other than system files?

If your Ubuntu system has expanded by itself (from log files and updates‽) to take up 100 GB of space (or 50 GB of space), just in system files (as opposed to your documents, pictures, videos, virtual machines, and so forth), something is very wrong. The three most likely general causes of this are probably:

  • This is not really happening, and you have misinterpreted information that your system has provided you. (Please note that I am not telling you that you are mistaken; if you know how you came to have 100 GB of system files, then neither this nor the other two suggested causes below is correct.)
  • There is a bug, which affects your system, and which causes used and free space to be reported incorrectly.
  • There is a pretty serious bug, which affects your system, and which causes files (perhaps log files in /var/log) to grow at an extremely high rate and without bound.

As Sergey has said, indiscriminately deleting all files that have the same contents will quite likely cause damage to your system. For example, there are a number of blank files that might exist in your system and are used as locks or to signify some condition. You may also have programs that contain separate copies of identical files (when the files provide the same functionality for both programs, which has not been removed to a separate library or package).

You can probably get it to delete the "duplicate" files by running it as root. But you should really not do that--it will likely wreak grave harm on your Ubuntu system.

You asked in a comment:

IS there anyway to command fdupes to delete all the duplicates without asking or notifying me?

fdupes -f might do what you want. See the fdupes manpage. But you should really not do this.

Instead, you should figure out what is going on. If you want us to help you with that, we certainly will. If you expand your question to explain that you want help figuring out what's taking up space, then you'll either get answers providing that information, or this may be closed as a duplicate of another question that provides information about how to find that out. (Either situation would be likely to benefit you.) Of course, this is assuming you want us to help you find the cause of your system taking up so much space (or seeming to).

The first step to investigate this is to examine (and post, by editing your question) the output of these commands, which provide detailed information about what disks you have and how much space is free on them:

mount
df -h
sudo du -sh /*

You can run those commands in a Terminal window (Ctrl+Alt+T). The last command will take a while. You may also get some Permission denied errors (even though you're running it as root), mostly regarding .gvfs folders in users' home directories. That's nothing to worry about.

0
5

I have a quick and dirty solution(definitely prevent log file writing, but doesn't solve the root problem):

this log file is written by /lib/udev/uvcdynctrl

  1. Backup original sudo cp /lib/udev/uvcdynctrl /lib/udev/uvcdynctrl_backup
  2. Edit original gksu gedit /lib/udev/uvcdynctrl
  3. Look up all elements that are in such form "debug=1"
  4. Change to "debug=0"
  5. Delete the log file once and for all sudo rm /var/log/uvcdynctrl-udev.log
2

Go into the Terminal(short cut is Ctrl+Alt+t) and type:

gksudo nautilus

This will open Nautilus with root permissions. Now delete your files.

Hope this helps you!

6
  • it doesn’t help,there are 10000s of files
    – user84055
    Aug 18, 2012 at 7:22
  • How did you make 10000s of copies. Do the duplicates look like this. If so, can't you just select one file, press shift, and then select all of them, and then delete them.
    – Max Tither
    Aug 18, 2012 at 7:27
  • the problem is i cant find the specific files which have been duplicated because i dont know which files haven copied and the locations of them.
    – user84055
    Aug 18, 2012 at 7:37
  • I found a bash script to find duplicate files. It will find them and move them to a folder. Then you can just delete the duplicate folder.
    – Max Tither
    Aug 18, 2012 at 7:42
  • no luck with it.It quits after running for 2minutes.
    – user84055
    Aug 18, 2012 at 8:43
-1

I think the best thing here is to just reinstall, considering the apparent amount of damage, the fact it's fairly unclear what's actually happened, and your low comfort level in manually repairing it.

Preserve your home directory (do not reformat or repartition) and reinstall and that should clear out the system directories.

4
  • 1
    While reinstallation is certainly an option, it's usually pretty easy to figure out where large files have been copied, or if there are system files increasing uncontrollably in size, which files they are. Aug 18, 2012 at 10:45
  • @Eliah, I'm sure you and I would find it easy, but I'm not sure the OP will. And, if not a lot of time has been invested in the machine (I'm not going to even mention config backups) blowing it away may be the most efficient choice.
    – poolie
    Aug 18, 2012 at 10:47
  • 1
    Note that this wouldn't help here. His /home is on the same partition as /, so he cant clear that partition. And I dont think the installer deletes any superfluous files on the partition it is going to use for installation (either all or none). Aug 18, 2012 at 10:59
  • 2
    The installer will remove everything in /var except /var/local so this answer is a viable option. Aug 18, 2012 at 15:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .