On Sun, Mar 14, 2021 at 10:53:22AM +0000, Joseph Mayer wrote:

> On Sunday, 14 March 2021 08:46, Otto Moerbeek <o...@drijf.net> wrote:
> > On Sun, Mar 14, 2021 at 01:17:05AM +0000, Joseph Mayer wrote:
> >
> > > Hi,
> > > Apologies if I missed any earlier clarification on the mailing list of
> > > this question:
> > > What should the size of my swap partition be exactly, at least, for it
> > > to guaranteedly be big enough to contain a whole kernel crash dump, if
> > > the kernel crashes?
> > > I would presume the exact size of the RAM, or are there headings that add
> > > some bytes or kilobytes, or some further annotations that may take how
> > > much, a gigabyte extra?
> > > Thanks,
> > > Joseph
> >
> > A crash dump needs a bit more than physical RAM. If you use the
> > autoallocater when creating a disklabel, it uses max 2 * physmem + 256M,
> > to have room for two crash dumps. See
> > src/sbin/disklable/editor.c:editor_allocspace().
> >
> > -Otto
> 
> Hi Otto,
> 
> Thank you very much for your response.
> 
> Just curious, when would a dump partition ever contain two crash dumps,
> would this be in case the subsequent reboot would crash before reaching
> savecore(8)?

Ugh, I was wrong */var* is sized to be able to contain two crash dumps.
swap is set to physmem + 256MB.

> (Then followup on an old feature request: If crash dumping could be
> done to swap files would be great. To my best awareness this is not
> supported today.
> 
> Actually for machines that ordinarily don't actually use swap memory
> anyhow as in all memory used always fits in RAM, crash dumping is the
> only reason to have a swap partition today.)
> 
> Joseph

Dumping to a swap file is much more complex than dumping to "real"
swap, is you would need to be able to interpret filesystems.

        -Otto

Reply via email to