2

I am not being to access any functions in my desktop and I don't have an OS besides Ubuntu and I am new to Ubuntu. I think I rebooted my computer thinking that Google Chrome crashed. I opened Google Chrome but it showed opening message but never opened so I restarted my computer. and when my system was loading (I was playing with keyboard dont know what I typed) and when by Ubuntu loaded, I was unable to access anything some of characteristics are listed below:

  • I cannot hear any sound

  • I cannot access wired ethernet connection on the right corner where I usually enable to access internet and I have no internet.

  • There is no local apache server either. when ever I try to start apacer I get setuid must be root or something.

  • When I type sudo then I get message setuid must be root.

  • I cannot access orther external storage devices like pendrive and portable hard drive and cannot mount my other drives with FAT32 filesystem.

  • When I try to start my apache webserver with out typing sudo then I get message cannnot open socket or something like it.

  • I remember also doing command

    chown -R www-data / 
    

    earlier and got error message

  • I cannot shutdown my computer, it only logs off

5
  • Do you have a spare live CD/USB handy? I recommend booting using one of these then backing up your important files and reinstalling.
    – dv3500ea
    Jan 2, 2011 at 13:21
  • no i don't have cd player in my desktop. i have USB but usb is not detected
    – S L
    Jan 2, 2011 at 13:23
  • chown -R www-data / clearly caused the problem. It tries to own all of the files in /, and any subdirectory - recursively. The errors were probably caused by inaccessible files, like /dev/sda. Jan 2, 2011 at 16:13
  • 1
    That's a face-palm worthy moment Jan 2, 2011 at 17:03
  • superuser privileges are not to be taken lightly. Sudo gives you ultimate control, which means NO restraints, this is done intentionally, the chown command you ran broke the system. Good news is, all the data is still there, backup (from a live cd) and reinstall.
    – crasic
    Jan 3, 2011 at 7:44

2 Answers 2

3

The apache command you tried is clearly the problem, it's caused all sorts of files to now be owned by www-data instead of root, your user and a bunch of other system users that operate the machine.

It would be very hard to try and recover the machine in it's current state and instead the best action to take is to reinstall. Make sure you back up all your files first by booting a liveCD or liveUSB. You may need another machine in order to make the equipment you need to do the recovery.

If you are having a really hard time, then seek out a local Ubuntu service person who can help. There are businesses that offer servicing now as well as individuals from LoCo teams around the world.

3

The most complete way to try and recover your system is with a reinstall. However you can try something to this affect which should produce some viable results.

sudo chown -R root /
for u in $(ls /home/); do sudo chown -R $u /home/$u; done

This brings everything else on the system back into ownership of root, and home folders into ownership of themselves.

Several system directories will need to be updated to different ownerships. On a close-to-stock version of Ubuntu they are as follows:

sudo chown -R couchdb /etc/couchdb
sudo chown -R mysql /var/run/mysqld
sudo chown -R avahi /var/run/avahi-daemon
sudo chown -R messagebus /var/run/dbus
sudo chown -R www-data /var/www

You'll need to realize that there are other software and software configurations that may break because they are still not owned by the right user. Typically if you run

sudo dpkg-reconfigure packagename

on that package it'll revert things properly.

5
  • If he can run sudo at all, he'll still need a live cd in order to run those commands. Jan 2, 2011 at 17:17
  • @Martin While I've never done this myself - if the system can boot he should be able to run sudo. Services started after GDM will fail because they require suid to be setup properly (IE: Apache) though chown should be acceptable. I'll try this in a VM later tonight to verify. Jan 2, 2011 at 18:22
  • No, you are not expected to be able to used sudo if the sudo binary owner is no root, the suid it will just cause the binary to run with www-data, . Trying a manual recovery in this circumstance is not a good idea anyway. Jan 2, 2011 at 22:39
  • sudo command in is running, i can boot from pendrive and run this command?
    – S L
    Jan 3, 2011 at 5:51
  • and i am getting message no folder exists for second line command in first code
    – S L
    Jan 3, 2011 at 5:52

You must log in to answer this question.

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