1

I by mistake ran the command

sudo chown -R myname:my name /usr

I am continuously getting pop ups on the screen, cursor is not appearing, hard-disks are not accessible, internet is not working. The whole system has crashed.

Now I am trying to change it back to root but it is showing that 'directory must be owned by us 0 and have setuid bit set'. What should i do?

Maythux
  • 84,289

1 Answers1

1

Simply boot in recovery mode, drop to root shell then change ownership again.

In details:

  • Switch on your computer.

  • Wait until the BIOS has finished loading, or has almost finished.

  • Quickly press and hold the Shift key, which will bring up the GNU GRUB menu.

  • Select the line which starts with "Advanced options".

  • Select the line ending with "(recovery mode)", probably the second line, something like:

     Ubuntu GNU/Linux, with Linux 3.8.0-26-generic (recovery mode)
    
  • Press Return and your machine will begin the boot process.

  • After a few moments, your workstation should display a menu with a number of options. One of the options (you may need to scroll down to the bottom of the list) will be "Drop to root shell prompt". Press Return with this option highlighted.

  • The root partition is mounted read-only. To mount it read/write, enter the command

     mount -o remount,rw /
    
  • Now change ownership again to root

     chown -R root:root /usr
    
Maythux
  • 84,289