I get this output after running sudo <xyz> on my RPI2:

sudo internal ErreP: insufficAEnt▒Qpace for lGm l▒le▒sudo: unable to initialize policy plugin

I'm thinking this may be a corrupted SD card, but before I go through that whole process (ugh) I want to get a second opinion. From everything else I've researched, I gather that policy plugin errors arise from a bad sudoers file, but I've checked that and it's clean.

Note that I'm a Linux tinkerer rather than power user, so I know little of how the filesystem/binaries/etc. work, but I can find my way around the command line. Any advice is appreciated.

  • 2
    looks like you don't have much space on your SD card - it almost says insufficient space for ... ... check the output of df command – Jaromanda X Sep 21 '15 at 5:17

As with any suspected filesystem corruption, the first thing you have to do is check the filesystem. For ext2/3/4 filesystems, the normal tool for doing this is e2fsck, a particular form of fsck.

This utility should be installed by default on any GNU/Linux system. The catch is that you need to unmount the filesystem in order to check it.1 With regard to the Raspberry Pi, this probably means you will have to take the SD card out and put it in another computer and do the check from there.

If you do not have another linux box to use, create a live CD -- most distro install disks currently function as such, I think -- or use a virtual machine implementation such as VMware or VirtualBox, with which you can run a linux system within OSX or Windows.

There are many explanations of e2fsck online as well as a man page. You may want to try and back stuff up off the partition first, if possible, if you haven't kept it so already, as the repair may result in lost files. By "stuff" I do not mean the entire partition, just your own data.

If you want to skip all the "Should I fix this?" questions from fsck (which may be copious), use -y, e.g.

sudo e2fsck -y /dev/sdb2

Remeber, it's the second partition on most pi cards, such as Raspbian, that is the root filesystem. You should probably check the first one as well, with fsck.vfat.

If the repair succeeds but there were a lot of questions, there may have been data loss meaning stuff may still not work. Also look in the lost+found directory on the partition, which will contain unidentified file fragments from lost data.

1. This is not quite true -- you can force it to work on an fs remounted read-only. The problem with that is if the filesystem is sufficiently corrupted (such that sudo doesn't work), it could effect the functionality of fsck, and it also can create problems if the filesystem needs repair.

|improve this answer|||||
  • Thanks for your awesome answer! Turns out it fixed itself after a few reboots. Might have been a weird mounting error. I'll definitely refer to this if the issue comes up again. – cyberbit Sep 25 '15 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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