2

Issue: After several hours investigating the reason that ate my disk space and brought it to zero, I figured that it was due to changing the permission in the root directory (I can't recall the exact name of the root directory). I remember renaming a file in a root directory by changing the permission recursively using chmod -R option (for /usr/bin/ directory). I found the file that ate my space using this answer, which showed following:

631G in /var/log/cups/error_log.1, and

110G in /var/log/cups/error_log

Because of zero disk space, I cannot reboot, so I cannot login into the system except for recovery. This problem is somewhat similar to this suggestion, except that I cannot implement that suggestion for lack of sudo privileges, which is probably related to permissions.

Question: I tried deleting the above error log files, but it won't allow because my sudo command has been screwed up. I believe this issue is related to the insecure permission issue that resulted in forming a log file discussed above. The error that stops me from using sudo says the following: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

I have tried some suggestions to restore sudo privileges (e.g. this, this, and this), but it didn't help...basically, it can't implement those suggesting that operation is not permitted. I am using the terminal through Alt+F2 mode when I try to reboot.

I would like to delete that error log and be able to use my system normally again without any issues.

I did some search over several hours and it shows two approaches

Approach 1: Although this question with similar problem provides some suggestions, for e.g. to stop the cups, delete the log file, etc., but those are not working for me as I explained earlier because my sudo is not working.

Approach 2: This problem occured after I changed the permission to /usr/bin/ directory, so it may need reverting back the permissions. This question is on a similar line, but I can't say whether the answer is useful.

EDIT

I have deleted the large file from root shell in recovery mode, and tried stopping the cups using the suggestion from approach 1 so the error log file does not increase in size again. I did that because none of the commands suggested by the answers could help revert the permissions, so when I logged into the OS, the error log file started to increase. Because of this I had to stop the cups from reocvery mode again. However, after doing these things I am still not able to access the sudo, and I get the same error as described above in the question. One issue is solved, which is deleting the file that ate up my space, but the other important problem of reverting back the permissions is not resolved. Also, once I restarted the cups, the file is increasing in size again (already 3.5 G in few min) with following commands:

W [05/Sep/2017:05:10:42 -0400] Notifier for subscription 2 (dbus://) went away, retrying!
E [05/Sep/2017:05:10:42 -0400] File \"/usr/lib/cups/notifier/dbus\" has insecure permissions (0100755/uid=1000/gid=1000).
W [05/Sep/2017:05:10:42 -0400] Notifier for subscription 2 (dbus://) went away, retrying!
E [05/Sep/2017:05:10:42 -0400] File \"/usr/lib/cups/notifier/dbus\" has insecure permissions (0100755/uid=1000/gid=1000).
W [05/Sep/2017:05:10:42 -0400] Notifier for subscription 2 (dbus://) went away, retrying!
E [05/Sep/2017:05:10:42 -0400] File \"/usr/lib/cups/notifier/dbus\" has insecure permissions (0100755/uid=1000/gid=1000).
W [05/Sep/2017:05:10:42 -0400] Notifier for subscription 2 (dbus://) went away, retrying!

EDIT 2

Following is my output of $ ls -al /usr/bin/su*

-rwxr-xr-x 1 root root 136808 Jul  4 03:37 /usr/bin/sudo
lrwxrwxrwx 1 root root      4 Jul  4 03:37 /usr/bin/sudoedit -> sudo
-rwxr-xr-x 1 root root  47680 Jul  4 03:37 /usr/bin/sudoreplay
-rwxr-xr-x 1 root root  39672 Mar  2  2017 /usr/bin/sum
user11
  • 123

4 Answers4

1

Well the "solution" should not be too bad.

  1. Boot a live Flash drive / CD or to recovery mode and delete the large log files.

    To delete files you need to remount the root file system rw

    mount -o remount,rw /
    

    For details see https://wiki.ubuntu.com/RecoveryMode

  2. If you used a live Flash / USB reboot to recovery mode now. If you are already in recovery mode continue with

    apt-get --reinstall install \`dpkg --get-selections | grep install | grep -v deinstall | cut -f1\`
    

    For details see

    http://hyperlogos.org/page/Restoring-Permissions-Debian-System

muru
  • 207,228
Panther
  • 104,528
1

I'm facing the same issue for ubuntu 16.04 after changing team permissions. A while ago I managed to have root privileges through terminal after launching recovery mode.

Try typing sudo su or su,and then nautilus. Having those permissions you could delete those files. But, same as you I haven't figured out the constant increasing of GB in the laptop. For me seems to increase 100GB after 1 hour of usage.

I know this isn't a proper answer, but I haven't enough points to reply to other answers.

By the way, if there is a solution to stop the increasing error_log files, let me know. The easiest way is reinstalling ubuntu, but that's not the idea.

Regards

0

First get access to a shell (tty, terminal).

If you can't log in, try booting into recovery mode, or log in to a tty session (Ctrl + Alt + F4)

While in the shell, run:

sudo rm /var/log/error_log*

This would free up space. And will allow the system to function normally.

As the problem is with cups, I'd recommend that you remove or upgrade it.

sudo systemctl stop cups.service
sudo apt purge cups-daemon
Gayan Weerakutti
  • 3,830
  • 1
  • 28
  • 39
0

To try and recover your system to a semi-workable state...

If this doesn't work, you may just have to reinstall Ubuntu...

  • boot to the GRUB menu
  • choose Advanced Options
  • choose Recovery mode
  • choose Root access
  • at the # prompt

type:

mount -o rw,remount / # to remount the disk as r/w

rm -i /var/log/cups/error_log # delete the large log file

rm -i /var/log/cups/error_log.1 # delete the large log file

chmod -R 755 /usr/bin # try to put /usr/bin back to something close to normal

chmod u+s /usr/bin/sudo # setuid on the sudo command

chown root:root /usr/bin/sudo # just in case this is messed up too

reboot # reboot the computer

Update #1:

Time to reinstall Ubuntu. You've made more changes to your system than we knew about, and fixing it piece-meal just won't work. Uncheck the format box and it'll keep your current /home directory.

heynnema
  • 73,649