Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've currently booted into recovery mode, because I removed my sole user from admin :/

When I run adduser oadams admin, I get gpasswd: cannot lock /etc/group; try again later.

For what it's worth, ls /etc/ | grep "lock", returns only mtab.fuselock, so there's nothing to delete.

How can I get my user back in the admin group?

share|improve this question

1 Answer 1

up vote 16 down vote accepted

Check that you are root

whoami

Check that the root partition is mounted read-write

cat /proc/mounts

If you see that your partition is mounted as ro (read-only), try remounting it as rw

mount -o remount,rw /
share|improve this answer
    
I'm root. As for the output of cat /proc/mounts, I get rootfs / rootfs rw 0 0 so I take that that is read-write. There are a bunch of other lines, all with rw in them, except /dev/disk/by-uuid/<some long uuid> / ext4 ro,relatime,user_xattr,acl,barrier=1,data=ordered 0 0, which I take is read-only. –  oadams Dec 1 '11 at 22:10
    
@oadams: see my edit. Please also post /etc/fstab, your drive designation (the uuid one) is atypical. The rootfs system is not important here. –  arrange Dec 1 '11 at 22:20
    
The remount worked, thanks! There isn't enough room here to post the fstab file, but here is (I think) the relevant line: UUID=0c5c5838-0cba-405e-a3ba-ca2555b90469 / ext4 errors=remount-ro,user_xattr 0 1 –  oadams Dec 1 '11 at 22:58
    
Then it's OK. Also check the partition for errors or look at logs/SMART data if your HDD is not failing. –  arrange Dec 1 '11 at 23:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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