Solved Trying to change shell via single-user and chsh output is broken

hnk

New Member


Messages: 16

Hi!

It seems that my last portmaster upgrade going from shells/fish 2.7.0 to 3.0.0 somewhat failed or whatever.
When I try to login it says "cant find /usr/local/bin/fish" and basicly I'm locked out. Root-login is turned off.

This is the result with editor/vi, chsh, editor/nano and all the output is broken. If I run cat /etc/master.passwd everything pastes just fine.

Note, this is FreeBSD12 running on a VMWare VPS and I'm troubleshooting from the vps-providers console.

Regards
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,188
Messages: 29,492

In single user mode only the root filesystem is mounted and it's mounted read-only. Remount the filesystem read/write and make sure other filesystems (namely /usr, /var, /tmp and perhaps /usr/local) are mounted to. Some application like to have swap, so enable that too.
 
OP
OP
hnk

hnk

New Member


Messages: 16

In single user mode only the root filesystem is mounted and it's mounted read-only. Remount the filesystem read/write and make sure other filesystems (namely /usr, /var, /tmp and perhaps /usr/local) are mounted to. Some application like to have swap, so enable that too.
I have run the following commands before trying to run chsh, in this order:
mount -ruw /
mount -a
swapon -a

I'm actually not quite sure about the -ruw options but shouldn't the mount -a make / rw?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,188
Messages: 29,492

I'm actually not quite sure about the -ruw options but shouldn't the mount -a make / rw?
Normally a -a doesn't (re)mount already mounted filesystems, but the root filesystem is a notable exception:
Code:
     -a      All the file systems described in fstab(5) are mounted.
             Exceptions are those marked as "noauto", those marked as "late"
             (unless the -l option was specified), those excluded by the -t
             flag (see below), or if they are already mounted (except the root
             file system which is always remounted to preserve traditional
             single user mode behavior).
For vi(1) and all, make sure your TERM variable is correct. Or else vi(1) will be stuck in a very limited VT100 mode. On modern FreeBSD versions you should be able to set TERM to xterm, even on the console.
 
OP
OP
hnk

hnk

New Member


Messages: 16

Normally a -a doesn't (re)mount already mounted filesystems, but the root filesystem is a notable exception:
Code:
     -a      All the file systems described in fstab(5) are mounted.
             Exceptions are those marked as "noauto", those marked as "late"
             (unless the -l option was specified), those excluded by the -t
             flag (see below), or if they are already mounted (except the root
             file system which is always remounted to preserve traditional
             single user mode behavior).
For vi(1) and all, make sure your TERM variable is correct. Or else vi(1) will be stuck in a very limited VT100 mode. On modern FreeBSD versions you should be able to set TERM to xterm, even on the console.
echo $TERM
dumb


export TERM="xterm" did the trick. Now I only have to change the shell.

Thank you so very much for your help! Much appreciated!
 
Top