Bug 118713 - [minidump] [patch] Display media size required for a kernel dump
Summary: [minidump] [patch] Display media size required for a kernel dump
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2007-12-15 03:40 UTC by Michael Haro
Modified: 2022-10-17 12:38 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Haro freebsd_committer freebsd_triage 2007-12-15 03:40:00 UTC
My raw swap partition is smaller than the amount of ram on my system.  This is okay since freebsd now has minidump support and it doesn't require swap to be the same size as ram.  Unfortunately I was still unable to save a dump when a kernel panic occured.  The attached patch displays the size required.

I assume you could do a better job at making the output pretty, but this does the job and answered my question, allowing me to resize some partitions so I'd have enough swap space to capture dumps.

Fix: 

if (error == ECANCELED)
                printf("\nDump aborted\n");
-       else if (error == ENOSPC)
+       else if (error == ENOSPC) {
                printf("\nDump failed. Partition too small.\n");
-       else
+               printf("media size (%llu) < required space (%llu)\n",
+                      (unsigned long long)di->mediasize,
+                      SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2);
+       } else
                printf("\n** DUMP FAILED (ERROR %d) **\n", error);
 }--QhO4DAwSflVc4kUEgeubbUj67g64Xg26dp7XAkDy2UiFOtHg
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- i386/i386/minidump_machdep.c.orig   2007-04-06 11:15:02.000000000 -0700
+++ i386/i386/minidump_machdep.c        2007-12-07 00:04:48.373609771 -0800
@@ -375,9 +375,12 @@
How-To-Repeat: Enter a condition that causes a kernel panic and have a swap partition that's too small to dump to.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-05-18 05:31:03 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:41 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:38:19 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>