5

On my Pi Zero, if I issue a sudo su I get the following:

$ sudo su
sudo: error in /etc/sudo.conf, line 0 while loading plugin `sudoers_policy'
sudo: /usr/lib/sudo/sudoers.so: Structure needs cleaning
sudo: fatal error, unable to load plugins

Any ideas how to resolve this?

1
  • 3
    This usually indicates file system corruption. Jun 26, 2017 at 2:04

2 Answers 2

5

"Structure needs cleaning" has happened on my pi's external drives, and I've fixed it with:

sudo umount /dev/sda1
sudo fsck -y /dev/sda1  

The "-y" flag instructs fsck to automatically fix any errors.

More info here: https://linux.die.net/man/8/fsck

3
  • 2
    You should do a block level backup and backup any important files first, as this is a potentially destructive action. Jun 26, 2017 at 12:27
  • 1
    Thanks, as this is happening on my Raspbian boot SD Card I'll put it in an adapter and back it up on another Linux system before then issuing the fsck against the SD Card. Jun 26, 2017 at 19:45
  • @SteveRobillard. DD if=/dev/sda1 of=/home/user/backup/defective.sdcard.image.sda1.iso bs=8M status=progress Is this what you had in mind?
    – Ron K.
    Oct 20, 2021 at 12:51
3

The fsck worked. I had to put the micrSD card into an adapter and load it into the SD Card socket of a Linux laptop.

There were two partitions on the card, /dev/sdb1 and /dev/sdb2, so I ran the umount and fsck listed above on each, and all was well again.

Thanks for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.