Are there any OpenBSD Kernel/Architecture Books?

2021-12-20 Thread Thomas Windisch
What resources would be a good primer on the OpenBSD kernel and general
architecture and give me a good understanding of the internals?

FreeBSD has this:

https://docs-legacy.freebsd.org/doc/13.0-RELEASE/usr/local/share/doc/freebsd/en_US.ISO8859-1/books/arch-handbook/book.html

I understand that in OpenBSD there is the mantra that source code is
documentation. But as a beginner I'm afraid that I do need something 
explicit that would allow me read the source code in an effective manner.



Re: Recover partition table/FFS2 after overwrite?

2021-09-09 Thread Thomas Windisch
On Thu, Sep 09, 2021 at 12:07:04PM +0200, Jan Stary wrote:
> On Sep 08 16:31:36, thomaswindi...@thomaswindisch.net wrote:
> > I mangaged to restore my drive using 
> > 
> > #fdisk -iy
> > #disklabel -R
> > #fsck
> > 
> > Thanks Geoff and David.
> > 
> > After reinstalling OpenBSD everything seems so be running fine.
> 
> If you reinstalled anyway, why did you bother restoring?
> 

I copied what I needed from /var and /usr to /home and only kept /home
on the new install (by not setting a mount point for /home and latter
adding it manually).

> > Almost.
> > 
> > When I now run grep I get this:
> > 
> > $ grep
> > warning: libc.so.96.0: minor version >= 1 expected, using it anyway
> > ld.so: grep: can't load library 'libz.so.6.0'
> > Killed
> > 
> > I was previously running -current and I reinstalled -release 6.9.
> > It seems that grep is a remnant of the old install? How come?
> > 
> > 

On Wed, Sep 08, 2021 at 10:15:30PM -, Stuart Henderson wrote:
> On 2021-09-08, Thomas Windisch  wrote:
> > I mangaged to restore my drive using
> >
> > #fdisk -iy
> > #disklabel -R
> > #fsck
> >
> > Thanks Geoff and David.
> >
> > After reinstalling OpenBSD everything seems so be running fine.
> > Almost.
> >
> > When I now run grep I get this:
> >
> > $ grep
> > warning: libc.so.96.0: minor version >= 1 expected, using it anyway
> > ld.so: grep: can't load library 'libz.so.6.0'
> > Killed
> >
> > I was previously running -current and I reinstalled -release 6.9.
> > It seems that grep is a remnant of the old install? How come?
>
> If you "downgrade" you will need to clean up newer libraries,
> things from packages, sometimes perl modules, etc. It is for this reason
> that this is really not a supported thing to do.

I did not downgrade via the "Upgrade" option but via the "Install"
option. The installer running newfs should cleared all data in /usr, /var, 
and /, right?

After rebooting I now cannot boot. The error I now get is:

Abort trap



>
> --
> Please keep replies on the mailing list.
>


I guess I'll just backup /home to another drive and do clean reinstall.



Re: Recover partition table/FFS2 after overwrite?

2021-09-08 Thread Thomas Windisch
I mangaged to restore my drive using 

#fdisk -iy
#disklabel -R
#fsck

Thanks Geoff and David.

After reinstalling OpenBSD everything seems so be running fine.
Almost.

When I now run grep I get this:

$ grep
warning: libc.so.96.0: minor version >= 1 expected, using it anyway
ld.so: grep: can't load library 'libz.so.6.0'
Killed

I was previously running -current and I reinstalled -release 6.9.
It seems that grep is a remnant of the old install? How come?



Recover partition table/FFS2 after overwrite?

2021-09-06 Thread Thomas Windisch
I think I just overwrote my file system by using sd1 instead of sd2:

# pv install69.img > /dev/rsd1c

sd1 is softraid crypto device that holds the system partitions and data:

$ df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/sd1a  1.9G143M1.7G 8%/
/dev/sd1f  843G734G   66.2G92%/home
/dev/sd1b  9.7G   14.5M9.2G 0%/tmp
/dev/sd1e 48.4G   40.8G5.2G89%/usr
/dev/sd1d 19.4G   16.9G1.5G92%/var

# disklabel sd1
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: SR CRYPTO
duid: a1f07cee2aba3a55
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 121600
total sectors: 1953518528
boundstart: 64
boundend: 1953504000
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize   cpg]
  a:  4208960   64  4.2BSD   2048 16384 12960 # /
  b: 20980896  4209024  4.2BSD   2048 16384 12960 # /tmp
  c:   19535185280  unused
  d: 41945696 25189920  4.2BSD   2048 16384 12960 # /var
  e:104872320 67135616  4.2BSD   2048 16384 12960 # /usr
  f:   1781496064172007936  4.2BSD   8192 65536 52270 # /home


The system is currently up and running.
I'm not sure what has been overwritten. Possibly only sd1a /?
Is it possible to recover from this without loosing access to the data in 
/home, /var, /usr?




Re: blacklistd analogue

2021-03-24 Thread Thomas Windisch
On Wed, Mar 24, 2021 at 08:33:35PM +0200, jeanpierre wrote:
> Does there exist an OpenBSD analogue for FreeBSD's blacklistd daemon?
> 
> For the sake of completeness: blacklistd is a daemon that, using pf
> anchors, blocks connections from abusive hosts to parctiular services
> (e.g. sshd) until they start behaving themselves again.
> 
> I find it very useful for timming down log files.
> 
> Regards,
> Jean-Pierre
> 

I believe that you would be able to achieve that with pf:

https://www.openbsd.org/faq/pf/filter.html#stateopts