You are not logged in.

#1 2013-09-07 16:23:36

geo909
Member
Registered: 2008-09-07
Posts: 309

Serious problems after overwriting configuration files with pacnew

Hi all,

I think I'm in serious trouble here. After having some problems with texlive I used the pacdiff as below. You may notice (sigh) that I chose to overwrite *everything* with the pacnew files. It was lack of knowledge and understanding of what pacdiff does and what the pacnew files are. Now the system seems to be broken in many different levels. For instance:

I have no name!@flamingo:/etc$ whoami
whoami: cannot find name for user ID 1000
I have no name!@flamingo:/etc$ su
Password: 
su: Authentication failure

So, not sure where to start fixing. I have backups of my data and configuration files, and I wonder if I should try to fix everything or if it's easier to do a format. Any feedback on that?

Btw my hunch is that I shouldn't reboot, so I'll keep my laptop on.

Thank you in advance.


The guilty code:

jorge@flamingo:/etc/texmf$ sudo pacdiff && fmutil -sys -all
==> pacnew file found for /etc/shadow
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/shadow.pacnew’ -> ‘/etc/shadow’
==> pacnew file found for /etc/ntp.conf
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/ntp.conf.pacnew’ -> ‘/etc/ntp.conf’
==> pacnew file found for /etc/fstab
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/fstab.pacnew’ -> ‘/etc/fstab’
==> pacnew file found for /etc/gshadow
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o 
‘/etc/gshadow.pacnew’ -> ‘/etc/gshadow’
==> pacnew file found for /etc/group
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/group.pacnew’ -> ‘/etc/group’
==> pacnew file found for /etc/rc_maps.cfg
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/rc_maps.cfg.pacnew’ -> ‘/etc/rc_maps.cfg’
==> pacnew file found for /etc/ppp/ip-down.d/00-dns.sh
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/ppp/ip-down.d/00-dns.sh.pacnew’ -> ‘/etc/ppp/ip-down.d/00-dns.sh’
==> pacnew file found for /etc/ppp/ip-up.d/00-dns.sh
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/ppp/ip-up.d/00-dns.sh.pacnew’ -> ‘/etc/ppp/ip-up.d/00-dns.sh’
==> pacnew file found for /etc/passwd
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/passwd.pacnew’ -> ‘/etc/passwd’
==> pacnew file found for /etc/colord.conf
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/colord.conf.pacnew’ -> ‘/etc/colord.conf’
==> pacnew file found for /etc/locale.gen
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/locale.gen.pacnew’ -> ‘/etc/locale.gen’
==> pacnew file found for /etc/texmf/chktex/chktexrc
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/texmf/chktex/chktexrc.pacnew’ -> ‘/etc/texmf/chktex/chktexrc’
==> pacnew file found for /etc/texmf/tex/generic/config/language.def
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/texmf/tex/generic/config/language.def.pacnew’ -> ‘/etc/texmf/tex/generic/config/language.def’
==> pacnew file found for /etc/texmf/tex/generic/config/language.dat
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/texmf/tex/generic/config/language.dat.pacnew’ -> ‘/etc/texmf/tex/generic/config/language.dat’
==> pacnew file found for /etc/texmf/dvipdfmx/dvipdfmx.cfg
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/texmf/dvipdfmx/dvipdfmx.cfg.pacnew’ -> ‘/etc/texmf/dvipdfmx/dvipdfmx.cfg’
==> pacnew file found for /etc/texmf/web2c/fmtutil.cnf
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/texmf/web2c/fmtutil.cnf.pacnew’ -> ‘/etc/texmf/web2c/fmtutil.cnf’
==> pacnew file found for /etc/texmf/web2c/texmf.cnf
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/texmf/web2c/texmf.cnf.pacnew’ -> ‘/etc/texmf/web2c/texmf.cnf’
==> pacnew file found for /etc/systemd/logind.conf
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/systemd/logind.conf.pacnew’ -> ‘/etc/systemd/logind.conf’
==> pacnew file found for /etc/pacman.d/mirrorlist
:: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew: [v/s/r/o] o
‘/etc/pacman.d/mirrorlist.pacnew’ -> ‘/etc/pacman.d/mirrorlist’
bash: fmutil: command not found

Last edited by geo909 (2013-09-07 16:24:44)

Offline

#2 2013-09-07 17:06:32

msthev
Member
Registered: 2012-04-05
Posts: 177

Re: Serious problems after overwriting configuration files with pacnew

Need to be fixed (from backup):

/etc/fstab
/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow

Should be fixed:

/etc/locale.gen
/etc/pacman.d/mirrorlist

It should be safe to leave the rest as it is, unless you had some intentional modifications there.

Offline

#3 2013-09-07 17:12:19

Rolinh
Member
From: Switzerland
Registered: 2011-05-07
Posts: 144
Website

Re: Serious problems after overwriting configuration files with pacnew

Hi,

You overwrote your fstab, shadow, passwd, etc files ? No wonder your system is damaged! There are some files that can be simply overwritten, like the texlive related one if you did not modify them but you should always proceed carefully when overwriting files. There would be so much stuff to do to repair this system that I am not sure about where you should start.
I would say that you should first check your fstab to make sure it is OK with your actual configuration. I would then create a new user (easier way to fix the user/group problem). However, I am not sure about how to repair damages you did to /etc/group.
If your installation is pretty basic, I think I would just re-install if I were you because it may be the quickest solution especially if you have your /home on a separate partition.

Offline

#4 2013-09-07 17:26:56

geo909
Member
Registered: 2008-09-07
Posts: 309

Re: Serious problems after overwriting configuration files with pacnew

Hi and thanks for your quick responses.

msthev wrote:

Need to be fixed (from backup):

/etc/fstab
/etc/passwd
...

It should be safe to leave the rest as it is, unless you had some intentional modifications there.

Ah, sorry I was not very clear. I have backups for my personal data and configuration files of the
various programs I'm using. But I don't have backups for these ones. Any chance one can find
the previous ones somewhere? I guess not, since there is an "overwrite"..

You overwrote your fstab, shadow, passwd, etc files ? No wonder your system is damaged! There are some files that can be simply overwritten, like the texlive related one if you did not modify them but you should always proceed carefully when overwriting files. There would be so much stuff to do to repair this system that I am not sure about where you should start.
I would say that you should first check your fstab to make sure it is OK with your actual configuration. I would then create a new user (easier way to fix the user/group problem). However, I am not sure about how to repair damages you did to /etc/group.
If your installation is pretty basic, I think I would just re-install if I were you because it may be the quickest solution especially if you have your /home on a separate partition.

Yes, my installation is pretty clean, it seems to be easier to take an afternoon off and do a format.
Ah well, lesson learned, the hard way again...

Just a last question. Is my hunch about rebooting correct? Do you think it should be safe to power
off the machine? Obviously I won't be mad at you if I can't log in, I just ask in case you have an idea!
I may take a few days until I format, and I need internet..

Last edited by geo909 (2013-09-07 17:28:02)

Offline

#5 2013-09-07 17:42:46

msthev
Member
Registered: 2012-04-05
Posts: 177

Re: Serious problems after overwriting configuration files with pacnew

For, passwd, shadow, group and gshadow, you should have corresponding files with a dash at the end (e.g. /etc/passwd-). These are backups created every time you modify the main files with proper tools (e.g. usermod). These backups will be missing the result of one last operation that was done on them, but it's better than nothing.
As for fstab, you should know how to do this with your setup. If you don't know, look at the output of `lsblk` and `mount` and read fstab(5). You can also boot from a live CD, mount your partitions, and then use genfstab (as described in the Wiki).

Last edited by msthev (2013-09-07 17:44:03)

Offline

#6 2013-09-07 18:34:16

geo909
Member
Registered: 2008-09-07
Posts: 309

Re: Serious problems after overwriting configuration files with pacnew

msthev wrote:

For, passwd, shadow, group and gshadow, you should have corresponding files with a dash at the end (e.g. /etc/passwd-). These are backups created every time you modify the main files with proper tools (e.g. usermod). These backups will be missing the result of one last operation that was done on them, but it's better than nothing.
As for fstab, you should know how to do this with your setup. If you don't know, look at the output of `lsblk` and `mount` and read fstab(5). You can also boot from a live CD, mount your partitions, and then use genfstab (as described in the Wiki).

Thanks! Will give that a try, and if it gets too complicated I'll go with the format..

Offline

#7 2013-09-07 19:47:16

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,168

Re: Serious problems after overwriting configuration files with pacnew

If you have arch-install-scripts installed, you can use genfstab without rebooting to the live media. However, you may not be able to put the file in the right place due to other breakage so the live media and a chroot may be easiest.

It is true that you will probably be unable to login if you reboot. However, using the internet before fixing this stuff is not the best idea since I think you are operating with an unsecured root account. I'm not sure about this because su failed for you but the default shadow etc. will have reset the root account to its original state i.e. with no password set. Also, I'm not sure what other problems you may create due to the messed up ownership and permissions.

Last edited by cfr (2013-09-07 19:47:51)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2013-09-08 13:15:43

geo909
Member
Registered: 2008-09-07
Posts: 309

Re: Serious problems after overwriting configuration files with pacnew

cfr wrote:

If you have arch-install-scripts installed, you can use genfstab without rebooting to the live media. However, you may not be able to put the file in the right place due to other breakage so the live media and a chroot may be easiest.

It is true that you will probably be unable to login if you reboot. However, using the internet before fixing this stuff is not the best idea since I think you are operating with an unsecured root account. I'm not sure about this because su failed for you but the default shadow etc. will have reset the root account to its original state i.e. with no password set. Also, I'm not sure what other problems you may create due to the messed up ownership and permissions.

Thanks a lot, will keep those in mind when I try the fix. Though I see myself formatting, I think..

Offline

Board footer

Powered by FluxBB