16

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?

Oli
  • 293,335
oadams
  • 1,301

1 Answers1

27

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 /
arrange
  • 14,959
  • 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 01 '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 01 '11 at 22:20
  • 1
    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 01 '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 01 '11 at 23:02
  • I had the same problem and this solved it. Should I set the partition back to read-only or would that actually limit system changes on reboot? I'll try leaving it for now, just curious. – Rick Henderson Jan 06 '17 at 03:52