0

I've recently installed Ubuntu 12.04 it was working fine unless I messed up with a command. I change all user permissions(as they call ago permission in Ubuntu) by running command sudo chmod -R 777 /. Now system won't detect any external devices like USB or any internal hard disk,but strangely it detect my mouse and keyboard. And system is also not able to recognize any wired connection. By using chmod I think I messed up with admin privileges and sudo command won't work.Is there Any other solution other than re-installing the whole OS? Can I restore my system in previous mode by any command?

4
  • it's bad, but not fatal you just better reinstall the system now :)
    – JoKeR
    Mar 1, 2015 at 18:15
  • again, UNTICK the format box before proceeding with the rest of the installation and you will keep your home folder.
    – mchid
    Mar 1, 2015 at 18:16
  • The only way to restore is if you have set up backups. Or, you can install using btrfs instead of ext4 (this will reformat and you will lose all current data!!!) and after installation install, apt-btrfs-snapshot. btrfs is new and not fully stable and does require routine maintenance to prevent data from filling up your drive.
    – mchid
    Mar 1, 2015 at 18:19
  • sudo chmod -R 777 / ... oh the humanity! Next to sudo rm -Rf / the easiest way to trash a system in a way that can't be recovered except by reinstall. Mar 2, 2015 at 0:27

1 Answer 1

2

No. You need to reninstall. Your permissions are all screwed up now and the only way to fix them all is to reinstall ubuntu.

You can however, keep all the data in your home folder (always make a backup first!). During installation, select something else when you get to the part that asks if you want to install ubuntu along side.

Then, right click on the ubuntu partition, set the format to ext4 and the mountpoint to /.

Click ok and UNTICK the box that says "format" before proceeding with the rest of the installation.

This will install ubuntu without formatting the drive and will only write over system files leaving your home folder untouched.

As neon_overloard pointed out, you will still have to manually fix a few permissions in your home folder.

4
  • unlike apple, there is no fix-permissions app that i know of for regular linux
    – mchid
    Mar 1, 2015 at 21:31
  • 2
    The messed up file permissions in the home folders may still be a problem for some things like .ssh, maildirs, etc. Mar 2, 2015 at 0:29
  • @neon_overload good point, although seems reasonable that these could be manually fixed.
    – mchid
    Mar 2, 2015 at 2:53
  • Remember that data should be backed up before reinstall. Related: askubuntu.com/q/142925/40581
    – LiveWireBT
    Mar 2, 2015 at 12:31

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