Lost access to sudo in RP 4.1, help!
-
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.
-
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:
- Take out your SD card, open it on another computer and add
init=/bin/sh
to the /boot/config.txt file. - 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
- Remove the init command from config.txt.
- 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 :)
- Take out your SD card, open it on another computer and add
-
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. -
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.
-
@kormik home/pi is owned by pi not root
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.