Solved Problems after merging files during the update from FreeBSD 13 to 14

I encountered this issue again! The passwd file got corrupted during the update.
Now I have two problems:
1- I cannot set a password for the root user and I am facing the following error:

passwd: pam_chauthtok(): Error in service module

2- I cannot create a regular user.

adduser: Error: There was an error adding user (hbsd)

I have tried doing this even in single user mode, but it doesn't work.
 
That almost sounds like a library issue. How did you (OP) do the update? Did you reboot after the initial kernel upgrade install?
 
This doesn't provide me with enough information. What error do you receive?
"Sorry, because I didn't write the command correctly at first. Now I'm getting a ' real-only file system
' error, even though I'm running it as root. I also created a root user:
`pw useradd -n root -u 0 -g 0 -o`."
 
That almost sounds like a library issue. How did you (OP) do the update? Did you reboot after the initial kernel upgrade install?
freebsd-update fetch
# freebsd-update install

after this everything got ruined. this was my original passwd.master. I didn't change anything!

Code:
 Attempting to automatically merge changes in files... done.
The following file could not be merged automatically: /etc/master.passwd
Press Enter to edit this file in /usr/bin/vi and resolve the conflicts
manually...
<<<<<<< current version
# $FreeBSD$
#
root:$6$EyyKWIz9axa1uuXC$2lcKB/9on1Jx/hmsPLb1vQ.nDNsNpsKYCmHenSuRnOd1ksn5uAhzoyqSpHexDRxE8xK
VffWYbkbzM75PX/lpP0:0:0::0:0:Charlie &:/root:/bin/csh
=======
root::0:0::0:0:Charlie &:/root:/bin/sh
>>>>>>> 14.1-RELEASE
toor:*:0:0::0:0:Bourne-again Superuser:/root:
daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin
tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin
kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin
games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin
news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin
man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin
unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin
_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin
auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin
www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin
_ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin
/var/db/freebsd-update/merge/new//etc/master.passwd: unmodified: line 1
 
if you were running 13, shouldn't that have been "freebsd-update upgrade -r 14.2-RELEASE" or something? Then there should have been a freebsd-install that installs the kernel, then reboot, then freebsd-install to update userland?
It sounds to me like an incomplete update
 
ok boot into LiveCD and show me the output of
gpart show
IMG_20250131_225853_898.jpg
 
if you were running 13, shouldn't that have been "freebsd-update upgrade -r 14.2-RELEASE" or something? Then there should have been a freebsd-install that installs the kernel, then reboot, then freebsd-install to update userland?
It sounds to me like an incomplete update
Yes, that was next step but merge problem happend.
 
VladiBG
By the way, I should also mention that I have an external hard drive which is about 1 gigabyte. FreeBSD is installed on this SSD, which is around 500 gigabytes.
 
This is NOT the LiveCD. You are in Single user mode and your filesystem is already mounted in Read-only under /
You can mount it with Read/write permission from single user mode using:

mount -o rw /

Then edit /etc/master.passwd
remove the merge markers and the root user with the empty password hash. (the lines from my previous post)
save the file
and run

pwd_mkdb -p master.passwd

Then you can reboot into multiuser

Note:
By LiveCD i mean to boot using bootable USB flash memory like (FreeBSD-14.2-RELEASE-amd64-mini-memstick.img) and instead of install to open LiveCD (now it's called Live system). Anyway the single user mode will also do the work.
 
type
mount -o rw /
to mount it into read-write mode then follow the above post.

btw. why you are upgrading to 14.1 instead of 14.2?
after you fix the master.passwd file you can check the syntax using pwd_mkdb -C master.passwd and then you can change the root password using passwd without getting the error of pam_chauthtok()
 
So
This is NOT the LiveCD. You are in Single user mode and your filesystem is already mounted in Read-only under /
You can mount it with Read/write permission from single user mode using:

mount -o rw /

Then edit /etc/master.passwd
remove the merge markers and the empty root user (the lines from my previous post)
save the file
and run

pwd_mkdb -p master.passwd

Then you can reboot into multiuser

Note:
By LiveCD i mean to boot using bootable USB flash memory like (FreeBSD-14.2-RELEASE-amd64-mini-memstick.img) and instead of install to open LiveCD (now it's called Live system). Anyway the single user mode will also do the work.
IMG_20250131_233503_000.jpg


Sorry, I thought the LiveCD was the same as the single-user one.

Unfortunately, this file has changed... On the other hand, since I only have root user, I can't access my browser to copy and paste the codes.

I just ran this command:
mount -o rw /
But I can't copy and paste the file. Unless I upload the codes to a GitHub account or somewhere and access it by cloning it.
 
This is NOT the LiveCD. You are in Single user mode and your filesystem is already mounted in Read-only under /
You can mount it with Read/write permission from single user mode using:

mount -o rw /

Then edit /etc/master.passwd
remove the merge markers and the empty root user (the lines from my previous post)
save the file
and run

pwd_mkdb -p master.passwd

Then you can reboot into multiuser

Note:
By LiveCD i mean to boot using bootable USB flash memory like (FreeBSD-14.2-RELEASE-amd64-mini-memstick.img) and instead of install to open LiveCD (now it's called Live system). Anyway the single user mode will also do the work.
I thought that was what you meant, but I don't have a bootable flash drive.
 
Back
Top