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?

czerasz
  • 321
  • 1
  • 3
  • 9
user3169632
  • 91
  • 1
  • 1
  • 5

2 Answers2

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

Ron K.
  • 320
  • 1
  • 8
  • 2
    You should do a block level backup and backup any important files first, as this is a potentially destructive action. – Steve Robillard Jun 26 '17 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. – user3169632 Jun 26 '17 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 '21 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.

czerasz
  • 321
  • 1
  • 3
  • 9
user3169632
  • 91
  • 1
  • 1
  • 5