Newbie Fouled Up System with 10.4 Upgrade

Questions and support problems dealing directly with the FreeBSD Operating System.
frogprince
Posts: 74
Joined: Mon Jul 10, 2017 9:50 pm
Location: Cincinnati, OH

Newbie Fouled Up System with 10.4 Upgrade

Post by frogprince »

This is not a panic, since I have a very nice 11.1 system running on another disk, which is what I'm sending this from. But reading about 10.4 made me curious, so I looked up upgrading Ghost 10.3 to 10.4 in "the usual way". After some investigation, I ran:

Code: Select all

freebsd-update -r 10.4-RELEASE upgrade
and the system rattled around for a while. I had some forced interaction with it, including an error message about the boot script. I looked at boot.conf, but didn't see anything out of order, so I continued and rebooted. Bad idea. The system now boots into SLIM, but won't load MATE.

So I rebooted into single-user mode, and ran:

Code: Select all

freebsd-update rollback
to get myself out of this dark place. But I got an error message telling me that an update file either wasn't there or was unwriteable. I thought ok, I need root, so I tried:

Code: Select all

login: root
password:************
and got an error message stating that I had the wrong password. Nor would it recognize my normal username password.

So my question is, how do I either fix the desktop boot issue, or alternatively, roll back the upgrade? Just trying to learn something here, and thanks in advance.
Vas you efer in Zinzinnati? GhostBSD running on a Lenovo 500X Ideapad procured from local resale shop because I'm cheap.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: Newbie Fouled Up System with 10.4 Upgrade

Post by ASX »

No sure what happened, but seems you have not run "freebsd-update install".

~~~

You can boot to single user mode (at loader prompt hit '2'), then it will ask to hit "enter" to start a shell.
once you have a shell prompt, you need to fsck the filesystem and then remount the root filesystem as read-write:

Code: Select all

fsck -fy /dev/.....  # use "gpart show -p" if you can't remeber which device is your root fs

Code: Select all

mount -u -rw /
now you can change the root password.

Code: Select all

passwd
once you have a working password in place, exit and try to log in again,
either verify you have completed the 10.4 install:

Code: Select all

freebsd-update install
or try to rollback the previous update.
frogprince
Posts: 74
Joined: Mon Jul 10, 2017 9:50 pm
Location: Cincinnati, OH

Re: Newbie Fouled Up System with 10.4 Upgrade

Post by frogprince »

ASX: thanks for your quick and kind reply. When I tried to fsck the drive, I got:

Code: Select all

fsck -fy /dev/adaop2
fsck: could not determine file system type
print file system type
print not found
When I touched the power button to initiate shutdown, I saw at the top of the text
readout:

Code: Select all

casper 103 slim: login_getclass: unknown class 'default'
casper 103 slim: login_getclass: no default/fallback class 'default'

casper 103 init: login_getclass: unknown class 'daemon"
casper 103 init: login_getclass: no default/fallback class 'daemon'
Since the system boots normally up to slim, including the brief flash of the
nVidia screen, might there be a simple edit of a file to fix this?
Vas you efer in Zinzinnati? GhostBSD running on a Lenovo 500X Ideapad procured from local resale shop because I'm cheap.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: Newbie Fouled Up System with 10.4 Upgrade

Post by ASX »

Code: Select all

fsck -fy /dev/adaop2
note that in the above command there is a typo: vowel 'o' instead of '0' (zero), that should have been:

Code: Select all

fsck -fy /dev/ada0p2
and that would explain why 'could not determine file system type'.
Since the system boots normally up to slim, including the brief flash of the
nVidia screen, might there be a simple edit of a file to fix this?
No, taking a shortcut will lead to future unexpected behavior ... worse of all, an undetected filesystem inconsistency might lead to data loss. (in case of doubts about consistency it is always better to reinstall).

First, assure yourself that your filesystem is in a consistent state, that is what fsck is for.
Once your filesystem state is certainly OK, proceed to change the root password.
Third, reboot and retry to login, as user and if that fail, as root.

From there, depending on your results it should be possile to restore the system either by completing the update, or by rolling back the changes. (It is still not clear to me if you originally ran "freebsd-update install").
frogprince
Posts: 74
Joined: Mon Jul 10, 2017 9:50 pm
Location: Cincinnati, OH

Re: Newbie Fouled Up System with 10.4 Upgrade

Post by frogprince »

ASX: thank you. I will double check my spelling on the disk ID. I was not clear on this, but yes, i did run freebsd-update install.
Vas you efer in Zinzinnati? GhostBSD running on a Lenovo 500X Ideapad procured from local resale shop because I'm cheap.
frogprince
Posts: 74
Joined: Mon Jul 10, 2017 9:50 pm
Location: Cincinnati, OH

Re: Newbie Fouled Up System with 10.4 Upgrade

Post by frogprince »

ASX: my spelling on the disk slice id was only in my post; it was correct on my system. When I repeated the fsck attempt, I got the same result.

I ran:

Code: Select all

gpart show -p
which told me that the filesystem on ada0p2 (there is no line through the zero, but it is a zero; I was careful about that) is clearly freebsd-ZFS. But of course, in my limited experience with this filesystem, I had no snapshot to restore from. I've tried umount and fsck; both insist that the system cannot tell what file system type that slice is made of. With fsck, the system told me that fsck would not work, and I should try fsck_zfs. That wouldn't run either. I went to /sbin and listed, and there is fsck, fsck_ufs, fsck_msdos, fsck_ext2fs, fsck_ffs, and fsck_4.2bsd, but no fsck_zfs. Nor can I install it without root access.

I also tried running e2fsck, but got an error message stating that to do so, I had to have r/w access or be root. I tried running passwd directly from the single user # prompt, and went through the process. But at the end, I got an error stating:

Code: Select all

passwd: pam_chauthtok ( ): error in service module
At this point, I think that I'm going to have to bite the bullet and reinstall/rebuild the system. The reinstallation is easy; it's the rebuild with all the software that takes the time. If I try to upgrade to 10.4 again, I'll have to do a lot more research. The Freebsd documentation is a bit skimpy for pedagogical purposes. I do have copies of Drew Lavigne's two books, and probably need to go back and reread them.

In any case, thanks for all your help. I document this to try and help the next user.
Vas you efer in Zinzinnati? GhostBSD running on a Lenovo 500X Ideapad procured from local resale shop because I'm cheap.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: Newbie Fouled Up System with 10.4 Upgrade

Post by ASX »

There is no fsck for ZFS! my fault, I was assuming you were using UFS.

ZFS is a COW (Copy on write) filesystem, and that assure that the filesystem is always in a consistent state and thus doesn't need fsck at all.

The nearest thing to fsck is probably "scrub", but it only check for blocks correctness by verifying the block CRC, additionally scrub apply to 'pools' not to 'filesystems/datasets'.

Code: Select all

zpool scrub <your-pool>
zpool status 
Unlike fsck that must be run on an unmounted filesystem, the scrub process can be run at any time including when the system is in use. If you reboot while a scrub process is in progress, when the machine restart the scrub process will continue from where it was interrupted.
frogprince
Posts: 74
Joined: Mon Jul 10, 2017 9:50 pm
Location: Cincinnati, OH

Re: Newbie Fouled Up System with 10.4 Upgrade

Post by frogprince »

ASX: I ran

Code: Select all

zpool scrub tank
which went quickly, but did not fix anything. I still got the same error message for passwd, and although the boot process runs perfectly normally through the nVidia load screen and into slim, I still get a black screen after logging in either as root or username. When I get a couple of hours free, I'll reinstall.
Vas you efer in Zinzinnati? GhostBSD running on a Lenovo 500X Ideapad procured from local resale shop because I'm cheap.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: Newbie Fouled Up System with 10.4 Upgrade

Post by ASX »

frogprince wrote:ASX: I ran

Code: Select all

zpool scrub tank
which went quickly, but did not fix anything. I still got the same error message for passwd, and although the boot process runs perfectly normally through the nVidia load screen and into slim, I still get a black screen after logging in either as root or username. When I get a couple of hours free, I'll reinstall.
The command "zpool scrub tank" will start the process, that run in background.

The command "zpool status" will show you the status of the pool and the scrub progress ;)

Code: Select all

# zpool status
  pool: zroot
 state: ONLINE
  scan: scrub repaired 0 in 3h6m with 0 errors on Mon Oct 16 19:28:26 2017
config:

	NAME        STATE     READ WRITE CKSUM
	zroot       ONLINE       0     0     0
	  ada0p2    ONLINE       0     0     0

errors: No known data errors
frogprince
Posts: 74
Joined: Mon Jul 10, 2017 9:50 pm
Location: Cincinnati, OH

Re: Newbie Fouled Up System with 10.4 Upgrade

Post by frogprince »

ASX: I really appreciate your patience with me on this situation.

I ran zpool scrup tank through to its conclusion, but it found no errors.

I found this entry on a search: http://www.freebsdonline.com/content/view/662/528/

"If you get on FreeBSD the following error:

pam_chauthtok(): error in service module

when trying to login as root from console, after you've upgraded from 7.x to 8.x release
then boot to single mode choosing single mode from start menu or press space when
boot counter starts then type

boot -s

And in single mode remove root user and add a new one."

How on earth can one remove and replace the root user? I tried

Code: Select all

pw userdel -n root
cannot remove user 'root'
All the passwords in /etc/master.passwd are salted, and the passwd command gives the above error. I've finally given up and gone off to reinstall. Thanks, ASX, for all your time and help.
Last edited by frogprince on Thu Oct 26, 2017 10:57 pm, edited 1 time in total.
Vas you efer in Zinzinnati? GhostBSD running on a Lenovo 500X Ideapad procured from local resale shop because I'm cheap.
Post Reply