Broken sudo: can't open /etc/sudoers: No such file or directory

I have a live USB persistent version of Ubuntu 11.04 installed with Unetbootin.

After some time I experienced some bugs while upgrading the kernel and trying to use my second screen on my laptop. Later then I noticed a strange, apparently unrelated problem: each time i tried to sudosomething i got the same response :

sudo: can't open /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting

Unable to do anything requiring root privileges, I rebooted using the single boot option and was able to access the root console.

I noticed the following behavior :

# ll /etc/sudoers
-r--r----- 0 root root 1014 2011-05-31 16:23 /etc/sudoers
# cat /etc/sudoers
cat: /etc/sudoers: No such file or directory

Is there something wrong with the hard link count being zero ? How can i change it ? The hard link count is 1 on my other computer which work correctly.

The live session user still belongs to the admin group if it matters.


A hard link count of zero means that the directory entry doesn't belong to any file. That sounds like a damaged file system.


As @Florian Diesch said, I also suggest to perform a fsck on that partition.

Moreover, while in single user mode, and if you can access the network, reinstall sudo package:

apt-get --reinstall install sudo

There are other forums/errors about the LiveCD/LiveUSB's persistent file system getting corrupted over time, it's an old error going back 3 or 4 years in ubuntu?

A Live USB / Live CD version only uses the casper-rw file to save all the persistent data, if you wanted to "re-install" or "clean install" then erasing the old casper-rw file and making a new empty file will do that (though it would probably eventually get corrupted again)?

Should be able to boot to the "regular" Live CD without persistence from the boot menu, in mine I press Tab on the boot menu to edit and erase the word "persistence" (or maybe persistent, don't remember) and it boots plain old LiveCD, even when my persistent file system has errors (like sudo doesn't work, other misc problems crop up until I erase casper-rw, make a new empty one and start over for the next month)

PS. the file system errors are all inside the casper-rw file, the usb stick (or memory card, etc) file system & "disk" remains in good condition, just inside the casper-rw goes bad. Mine has a FAT or FAT32 file system on the memory card, but the casper-rw uses ext2 fyi