vi: not found - 2.11BSD

180 views
Skip to first unread message

Cesar Gimenes

unread,
Feb 13, 2021, 8:21:51 AM2/13/21
to pid...@googlegroups.com
Hello

I'm trying to put the 2.11BSD on the LAN, for this I set the SR switches to 102 and entered single user mode and reached the “#" prompt.

The intention was to edit the configuration files but then I realized that I don't have the vi installed. At least not in PATH.

Does anyone have any tips?

i can learn to use ed :)
but as i'm following the tutorial and it talks explicitly about vi, so i am worried that maybe my installation is not 100%.

Thank you!

Cesar

Johnny Billquist

unread,
Feb 13, 2021, 8:26:48 AM2/13/21
to pid...@googlegroups.com
It's just not in the root partition. You need to mount things, get
termcap up and the rest of the environment before you have vi (and it's
really vi, and not vim. Just be warned...).

Also, please remember to run fsck on things. People tend to skip/forget
this, and it can really mess your system up. Whenever you want to go
multiuser, and get everything up and running, run fsck before.

It can be setup to do these things automatically, but by default it is
not. I guess for the impatient, that's good. But you're pretty much sure
to get a broken system sooner or later going down that path.

Also, get your system up to the current patch level.

Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: b...@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol

Cesar Gimenes

unread,
Feb 13, 2021, 8:58:18 AM2/13/21
to pid...@googlegroups.com
Hello Johnny

> It's just not in the root partition. You need to mount things, get termcap up and the rest of the environment before you have vi (and it's really vi, and not vim. Just be warned...).

Understand! I will look for the other tutorials and try to find out how to mount the other partitions.

> Also, please remember to run fsck on things. People tend to skip/forget this, and it can really mess your system up. Whenever you want to go multiuser, and get everything up and running, run fsck before.

Interesting, I didn't know I needed it. I'll pay attention to that.

> It can be setup to do these things automatically, but by default it is not. I guess for the impatient, that's good. But you're pretty much sure to get a broken system sooner or later going down that path.

I'm in no hurry here, the idea is to learn and have fun. Doing things as correctly as possible. Learning step by step how to set up and maintain the system is part of the fun.

> Also, get your system up to the current patch level.

This part is where I am most lost, for now I have the default configuration, installed by install.sh, I just built PiDP-11 and I'm experimenting with the systems. I still need to learn the correct way to download things, apply patches, etc. Anyway, a lot to learn.

If you have any documents or links that you find interesting for me to read please let me know.

Thank you for your help!

Cesar

david_...@brown.edu

unread,
Feb 13, 2021, 10:01:58 AM2/13/21
to Cesar Gimenes, pid...@googlegroups.com
I would do fsck -p, follow the directions if it finds something on root. If it comes back clean, then enter control-D to leave single user mode and enter multi-user mode.

-- ddj
Dave Johnson

> On Feb 13, 2021, at 8:58 AM, Cesar Gimenes <c...@crg.eti.br> wrote:
>
> Hello Johnny
> --
> You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/B4398A36-B005-4363-B49C-5B89B07EBC36%40crg.eti.br.

Cesar Gimenes

unread,
Feb 13, 2021, 1:11:35 PM2/13/21
to pid...@googlegroups.com
Hello!

> I would do fsck -p, follow the directions if it finds something on root. If it comes back clean, then enter control-D to leave single user mode and enter multi-user mode.

Now I understand, these are the two instructions that are missing from the tutorial.
After getting the “#" prompt I need to run fsck:

fsck -p -t scratch

Then ^d to go to multiuser mode.
The system will mount the other drivers, etc.

Now I have the system ready and I can use the vi editor.

I will try to configure the network and maybe transfer some files on the network.

If you have any more tips I would love to read.

Cesar

Clem Cole

unread,
Feb 13, 2021, 5:32:00 PM2/13/21
to Cesar Gimenes, [PiDP-11]
Cesar, you need to be careful.  fsck -p -t scratch_file may not be (probably is not) what you want.  The scratch file can not be on the system that is being checked and that seems like it will try to open a scratch file when checking the root file system using the root filesystem, which would be a bad idea.

The problem for you is that if you need a scratch file for a later pass how do you get fsck to only use it on the later passes with a known good filesystem?   When the late Ted Kowalski and I first ran into this issue in the mid-1970s when fsck was birthed, it was not a problem because -p did not yet exist (Bill Joy added to the UCB version a few years later).  In those days on the sixth edition, you ran just fsck on the root file system.  If it was dirty, you fixed it and rebooted and tried again.  If it was clean, then you ran it on the other partitions independently and you only used the scratch file for the large partitions (also - truth be known, when we first wrote it, we did not have disks that large - we just had RK05s).

If I recall when some of the new features like -p from Joy's Vax version was backported to the PDP-11 by the 2.9/2.10 team, Ted's scratch file hack had to be resurrected (we had run out of memory for some tables in a 16-bit address space -- Ted's answer to the problem is quite creative BTW - take a look at the code).   So the 2.X folks added some stuff to control the needs of the -p switch.  See: BSD 2.11 man8/fsck

I'm doing this by memory (which for an old guy can be dangerous - as I do not have 2.11 running on a system, only V7).  But I believe you want: fsck -p1 on a separate line checking the return code.  If it comes back clean then run:  fsck -p2-4 -t /tmp/scratch_file again checking the return code, if all is good go to multi-user.  The key is the root file system should be small enough for the tables to fit in memory and thus fsck can be run without a scratch file.   When you run it on the larger partitions that need the scratch file, it will be placed in the /tmp directory on the root filesystem and you should be fine.

Best wishes,
Clem


--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.

Cesar Gimenes

unread,
Feb 13, 2021, 8:03:18 PM2/13/21
to [PiDP-11]
Thanks for the help Clem.

I'm writing everything down and gradually understanding how the system works and how to keep things in order.

So much to learn and do and I just passed the boot.
It looks like it was a good idea to have added PiDP-11 to my little collection.

Thank you again!

Clem Cole

unread,
Feb 13, 2021, 8:21:35 PM2/13/21
to Cesar Gimenes, [PiDP-11]
Good luck,best wishes and hope you have a fun ride.

--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.

Johnny Billquist

unread,
Feb 13, 2021, 8:42:31 PM2/13/21
to david_...@brown.edu, Cesar Gimenes, pid...@googlegroups.com
On 2021-02-13 16:01, david_...@brown.edu wrote:
> I would do fsck -p, follow the directions if it finds something on root. If it comes back clean, then enter control-D to leave single user mode and enter multi-user mode.

Good advice, but it won't work straight off like that.
fsck in 2.11BSD can't work on large file systems without a temporary
file. The root file system is small enough, but usually the others are not.
The common invocation becomes:

fsck -p -t /_FSCK_TMP_FILE

which is what you'll find in /etc/rc

But that line in /etc/rc is not run if you go through single user, and
then hit ^D.

Which is another reason I really urge people to change /etc/boot to do
automatic boots.
Also, if the root file system is corrected, it is important that you
reboot without syncing the file system, or else the system will write
back the in memory contents to file, and loose the fixing that fsck did.

Johnny

Johnny Billquist

unread,
Feb 13, 2021, 8:56:31 PM2/13/21
to Cesar Gimenes, [PiDP-11]
On 2021-02-13 23:31, Clem Cole wrote:
> Cesar, you need to be careful. fsck -p -t scratch_filemay not be
> (probably is not) what you want.  The scratch file can not be on the
> system that is being checked and that seems like it will try to open a
> scratch file when checking the root file system using the root
> filesystem, which would be a bad idea.

No. That line is correct. The temporary file is opened and used when
needed. The root file system does not require a temporary file.

If you were to look at /etc/rc you'll that this is exactly what it does.
With the following comment:

echo Automatic reboot in progress... >/dev/console 2>&1
date >/dev/console 2>&1
# this will *only* work if fsck can do your root file system
# without a temporary file, and if the root file system is
# checked alone in a pass by itself -- be careful! This can
# *seriously* mess you up.
fsck -p -t /_FSCK_TMP_FILE >/dev/console 2>&1
case $? in

So people should not create very large root systems, and in /etc/fstab,
the root file system should be checked first, and alone. Which is the
case by default, but people should be aware, so that they don't get
creative.

> I'm doing this by memory (which for an old guy can be dangerous - as I
> do not have 2.11 running on a system, only V7).  But I believe you want:
> fsck -p1 on a separate line checking the return code.  If it comes back
> clean then run:**fsck -p2-4 -t /tmp/scratch_file again checking the
> return code, if all is good go to multi-user.  The key is the root file
> system should be small enough for the tables to fit in memory and thus
> fsck can be run without a scratch file.   When you run it on the larger
> partitions that need the scratch file, it will be placed in the/tmp
> directory on the root filesystem and you should be fine.

You could, but just -p -t /foo is enough. fsck do handle things the
right way here.

If fsck needs to modify the root file system, it will not run through
the other ones, but will instead finish at that point, and you need to
reboot. And the reboot needs to be without a sync.

Johnny
Reply all
Reply to author
Forward
0 new messages