I recently upgraded my PostgreSQL installation and intended to run the command:
sudo chown -R postgres:postgres /var/lib/postgres
Unfortunately, I accidentally forgot the “postgres” part at the end because of a miscalculated tab completion... I ended up running:
sudo chown -R postgres:postgres /var/lib
Needless to say, this has caused a slew of issues. For example, I’m not able to boot into my operating system.
Update:
I applied chown -R gdm:gdm /var/lib/gdm and am now able to log in successfully!
However, I don't know the extent to which this will cause problems.
Starting User Manager for UID 120...
[ OK ] Started Session c1 of user gdm.
[ OK ] Started User Manager for UID 120.
I am using LUKS and the filesystem is encrypted.
However, I am able to spawn a shell via grub by adding init=/bin/bash to the kernel line, of course, so this should be fairly easy to fix once I know the proper ownership requirements.
Currently in /var/lib:
colordis owned by colord,gdmis owned by gdm,locateandmlocateare owned by root,redisis owned by redis,systemdis owned by root, and- everything else is owned by postgres.
See photograph of ls -ho output
for permissions and modification times.
One issue is that the /var/lib/gdm directory, which is owned by gdm, contains typical home-directory sub-directories (Desktop, Documents, Downloads, Music, Pictures, Public, Templates and Videos),
all of which are owned by postgres.
See photograph of ls -ho output
for permissions and modification times.
How can I fix the file ownership in /var/lib back to how it was
before I ran
chown -R postgres:postgres /var/lib
? Any aid would be greatly appreciated.
