i@pi:~ $ sudo apt purge -y gparted ["my entry to the left & the response follows"]
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
I was using gparted to install a 500 GB SSD on the RPi 4. Following an excellent write up from PiHut to do the job did not increase my success at installation of the SSD. I made 2 24hr efforts at installation. The second and third line above is what I get as response when trying to execute any terminal command. Can I go to /usr/bin and /etc/sudo.conf and delete something or reinstall the software?
Re: Terminal insists I fix a problem before it will take a command
Have you at any point made any changes to those two files? If not the problem likely goes deeper and you may not find what else is broken until you stumble across it.
Is your root partition still on the SD card or have you moved it to the SSD?
If you have moved it to the SSD, how did you do that? What format is the root partition on the SSD?
The only fix may be as follows:
Is your root partition still on the SD card or have you moved it to the SSD?
If you have moved it to the SSD, how did you do that? What format is the root partition on the SSD?
The only fix may be as follows:
- Install a clean RPiOS on a different SD card
- Boot from it
- Connect the device containing the broken root partition via USB.
- Mount it e.g. on /mnt
- Execute the following commands:
Replace /mnt with wherever you mounted the partition.
Code: Select all
sudo chown root:root /mnt/etc/sudo.conf sudo chown root:root /mnt/usr/bin/sudo sudo chmod 4755 /mnt/usr/bin/sudo
- Shutdown
- Swap boot media
- Boot
- See if the problem persists and what else is broken.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
- DougieLawson
- Posts: 42635
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Terminal insists I fix a problem before it will take a command
What worries me is that why does that file in /etc have the wrong ownership/permissions, what other files are wrong?thagrol wrote: ↑Mon Jun 05, 2023 3:00 pm
- Execute the following commands:
Replace /mnt with wherever you mounted the partition.Code: Select all
sudo chown root:root /mnt/etc/sudo.conf sudo chown root:root /mnt/usr/bin/sudo sudo chmod 4755 /mnt/usr/bin/sudo
I would start with a fresh install on a new SDCard then add in the extra packages and copy over the files needed from the old SDCard.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Terminal insists I fix a problem before it will take a command
As a service to others, perhaps you could provide a reference to that 'excellent write up', because it seems it may contain a deadly flaw that should be flagged up to the authors?
Beware of the Leopard
Re: Terminal insists I fix a problem before it will take a command
Indeed.DougieLawson wrote: ↑Mon Jun 05, 2023 3:07 pmWhat worries me is that why does that file in /etc have the wrong ownership/permissions, what other files are wrong?
I would start with a fresh install on a new SDCard then add in the extra packages and copy over the files needed from the old SDCard.
I suspect ownership, groups and permissions are broken throughout that root partition. My thinking was let's fix this then find out what else went wrong.
Why it's broken depends very much on the answers from the OP to my questions though I can think of a few posssibilities:
- Owner, group and permissions have been changed on those files either manually or by some script OP has run.
- The new root partition is not a Linux native format though if that were the case I'd expect boot to fail completely. (cmdline.txt and fstab would be wrong)
- Whatever method was used to copy the contents of the root partition did not preserve owner, group, and permissions. Using cp would do that as would using rsync with incorrect options.
- Corrupted SD card.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
Re: Terminal insists I fix a problem before it will take a command
I'm guessing this one. Personally, I'd say it's far from execelent and nowhere does it say how to copy/move the OS to the new SSD.
Which is what I suspect the OP has tried to do.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
Re: Terminal insists I fix a problem before it will take a command
Further to that, perhaps the OP could explain what he/she is trying to achieve, and then folks to provide the simplest and correct way to achieve it.
The OP does not mention if they are trying to add 500 GB of SSD storage to the PI and are ok with it automounting (simplest), want it mounted for some specific reason at some specific place in the file system, or want to move the entire OS and any data from the microSD to the SSD and then boot from the SSD. The solution is significantly different for each.
As thagrol noted the OP likely used an incorrect method and trashed the ownership, and potentially permissions on all the files. Fastest solution would likely be to start over, if they still have the "source" microSD card.
The OP does not mention if they are trying to add 500 GB of SSD storage to the PI and are ok with it automounting (simplest), want it mounted for some specific reason at some specific place in the file system, or want to move the entire OS and any data from the microSD to the SSD and then boot from the SSD. The solution is significantly different for each.
As thagrol noted the OP likely used an incorrect method and trashed the ownership, and potentially permissions on all the files. Fastest solution would likely be to start over, if they still have the "source" microSD card.
Re: Terminal insists I fix a problem before it will take a command
https://thepihut.com/blogs/raspberry-pi ... spberry-pi
This is "excellent write up" I followed. It doesn't tell what size SSD the program can handle. I was using BX500 Crucial SSD which it can't handle in 24 hrs of "setting up". It also doesn't give progress reports.
As a result, I have gone all the way back to day one on RPi 4.
This is "excellent write up" I followed. It doesn't tell what size SSD the program can handle. I was using BX500 Crucial SSD which it can't handle in 24 hrs of "setting up". It also doesn't give progress reports.
As a result, I have gone all the way back to day one on RPi 4.
Re: Terminal insists I fix a problem before it will take a command
I don't see anything in the early sections of that 3rd-party document that could cause the symptoms in your initial post.biker67 wrote: ↑Tue Jun 06, 2023 1:28 pmhttps://thepihut.com/blogs/raspberry-pi ... spberry-pi
This is "excellent write up" I followed. It doesn't tell what size SSD the program can handle. I was using BX500 Crucial SSD which it can't handle in 24 hrs of "setting up". It also doesn't give progress reports.
As a result, I have gone all the way back to day one on RPi 4.
But looking at the section Create a Directory for Mounting the SSD I can see that a typing error in the first command could potentially break your system just as you describe.
Code: Select all
sudo chown pi:pi -R /home/pi/myssd/
Attempting to un-install the gparted package doesn't seem to be part of the tutorial, and will save very little space.
If your concern is with poor performance, this might be of interest: viewtopic.php?t=245931
Beware of the Leopard
Re: Terminal insists I fix a problem before it will take a command
That's the one I though it might be. I didn't see anything either but I did see some unnecessary and ill advised mount options in their suggested fstab entry (it doesn't need auto or rw, users is a bad idea unless you want every normal user to be able to mount/unmount it without sudo).B.Goode wrote: ↑Tue Jun 06, 2023 1:53 pmI don't see anything in the early sections of that 3rd-party document that could cause the symptoms in your initial post.biker67 wrote: ↑Tue Jun 06, 2023 1:28 pmhttps://thepihut.com/blogs/raspberry-pi ... spberry-pi
This is "excellent write up" I followed. It doesn't tell what size SSD the program can handle. I was using BX500 Crucial SSD which it can't handle in 24 hrs of "setting up". It also doesn't give progress reports.
As a result, I have gone all the way back to day one on RPi 4.
Yeah, that would do it. Breaking much of the OS while it does so.But looking at the section Create a Directory for Mounting the SSD I can see that a typing error in the first command could potentially break your system just as you describe.
Code: Select all
sudo chown pi:pi -R /home/pi/myssd/
TBH, I'd temporarily mount it on /mnt (sudo mount /dev/sda1 /mnt), use rsync to copy the entire /home directory tree to it (sudo rsync -axrvH /home/* /mnt) then use fstab to mount the drive's single partition on /home (edit fstab and reboot). The primary advantage being that when/if you break your OS you can reflash the SD card without losing your user data. And no need to run a chown command that has the potential to break your entire OS.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
Re: Terminal insists I fix a problem before it will take a command
https://peyanski.com/how-to-boot-raspbe ... from%20SSD.
This approach is very straight forward. Under Raspi-config , advanced options, setup boot software to latest and save. Then under advanced options, select boot from USB if available otherwise boot from SD card and save.
Before booting; Under Menu-accessories choose SD card copier. Copy SD card to SSD and the reboot..
done
EDIT:
Not quite. I have tried several combos of settings; such as do not check UUID partitions, disable screen blanking in raspi-config in order to prevent screen from blacking out. It is fortunate that I had touch screen because i lost mouse at the end of coping SD to SSD (1/2 TB) but with touch screen I was able to close down what appeared to be a sucessfull media transfer to the Crucial SSD. After pulling the SD card, A reboot to the Crucil SSD went a long way but has ultimately failed to boot.
I would not try this again without a better SSD card. I might have gotten my $ worth for $11.
This approach is very straight forward. Under Raspi-config , advanced options, setup boot software to latest and save. Then under advanced options, select boot from USB if available otherwise boot from SD card and save.
Before booting; Under Menu-accessories choose SD card copier. Copy SD card to SSD and the reboot..
done
EDIT:
Not quite. I have tried several combos of settings; such as do not check UUID partitions, disable screen blanking in raspi-config in order to prevent screen from blacking out. It is fortunate that I had touch screen because i lost mouse at the end of coping SD to SSD (1/2 TB) but with touch screen I was able to close down what appeared to be a sucessfull media transfer to the Crucial SSD. After pulling the SD card, A reboot to the Crucil SSD went a long way but has ultimately failed to boot.
I would not try this again without a better SSD card. I might have gotten my $ worth for $11.