RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Lost access to sudo in RP 4.1, help!

    Scheduled Pinned Locked Moved Help and Support
    errorsudoretropie
    5 Posts 4 Posters 2.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      misterbung
      last edited by

      Hi all, desperate for help here.

      I was trying to get PS3 controls to auto-enable by editing local.rc, however I followed some dud advice and have lost access to sudo. Specifically I did this: http://blog.petrockblock.com/forums/topic/no-writing-permission-for-retroarch-cfg/#post-12219

      $ sudo chown -R pi:pi /opt/retropie/

      This means it can no longer run local.rc on boot and now everything in the RetroPie panel in Emustation gives me an error saying etc/sudoers is owned by uid 1000 should be uid 0. Nothing I do seems to help in regaining permissions.

      I don't seem to be able to get into Recovery mode either, no matter how long I hold down shift or tap shift or stare longingly at the shift key.

      Can anyone help before I flatten and start again with my 32gb Retropie setup (including transferring all the roms over...)

      Running RetroPie 4.1 on Raspberry Pi 3B.

      Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • kormikK
        kormik
        last edited by kormik

        I don't think the command caused this - you must have put a space between '/' and 'opt/retropie' or something like that. It looks like you changed ownership for whole the filesystem to the pi user.

        To fix this, you can boot to the single user mode (root console). Follow these steps:

        1. Take out your SD card, open it on another computer and add init=/bin/sh to the /boot/config.txt file.
        2. Insert the card back into your RPi and launch it. You should be booted straight into root console. Now execute:
          chown -R root.root /
          chown -R pi.pi /opt/retropie
          chown -R pi.pi /home/pi
        3. Remove the init command from config.txt.
        4. Reboot.

        Please note that I am unsure whether there are any other files that should be owner by pi user. I don't have any RetroPie nearby to check it :)

        edmaul69E 1 Reply Last reply Reply Quote 0
        • BuZzB
          BuZz administrators
          last edited by BuZz

          If the entire system has been changed to be owned by pi, you will need to start again as it will have messed up lots of system file ownership. (It's possible to do, but it's not worth the effort to try and change everything back - unless you are very familiar with Linux)

          There should be no need to chown pi:pi /opt/retropie btw.

          To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

          1 Reply Last reply Reply Quote 0
          • M
            misterbung
            last edited by

            Ah, damn. I thought that might be the case. Thanks for the advice!

            I'm transferring off all my roms now and I'll flatten and start again.

            On the plus side I now know what sudo is and never, ever to mess with it unless I know what I'm doing. A learning experience if you will.

            1 Reply Last reply Reply Quote 0
            • edmaul69E
              edmaul69 @kormik
              last edited by

              @kormik home/pi is owned by pi not root

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

              Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.