diff options
author | Mark Johnston <markj@FreeBSD.org> | 2017-10-25 00:51:00 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2017-10-25 00:51:00 +0000 |
commit | 64a16434d8dbd5432e2f1a49007e53a449d43830 (patch) | |
tree | e9cdb0a8780646580c9a0d35fd94332c6a2443ad /sbin/dumpon | |
parent | 7b79d6d61ac82b21e2acc396a4ea66d0e92c79d9 (diff) | |
download | src-64a16434d8dbd5432e2f1a49007e53a449d43830.tar.gz src-64a16434d8dbd5432e2f1a49007e53a449d43830.zip |
Notes
Diffstat (limited to 'sbin/dumpon')
-rw-r--r-- | sbin/dumpon/dumpon.8 | 23 | ||||
-rw-r--r-- | sbin/dumpon/dumpon.c | 18 |
2 files changed, 35 insertions, 6 deletions
diff --git a/sbin/dumpon/dumpon.8 b/sbin/dumpon/dumpon.8 index b0c8e2c12de4..572bd030aef1 100644 --- a/sbin/dumpon/dumpon.8 +++ b/sbin/dumpon/dumpon.8 @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 10, 2016 +.Dd October 24, 2017 .Dt DUMPON 8 .Os .Sh NAME @@ -38,6 +38,7 @@ .Nm .Op Fl v .Op Fl k Ar public_key_file +.Op Fl z .Ar special_file .Nm .Op Fl v @@ -114,6 +115,22 @@ This flag requires a kernel compiled with the kernel option. .Pp The +.Fl z +option configures the kernel to compress the dump in gzip format before writing +it to the dump device. +This reduces the amount of space required for the dump and accelerates +recovery with +.Xr savecore 8 +since less data needs to be copied from the dump device. +When compression is enabled, the +.Nm +utility will not verify that the dump device is sufficiently large for a full +dump. +This flag requires a kernel compiled with the +.Dv GZIO +kernel option. +.Pp +The .Fl l flag causes .Nm @@ -272,3 +289,7 @@ utility appeared in .Sh BUGS Because the file system layer is already dead by the time a crash dump is taken, it is not possible to send crash dumps directly to a file. +.Pp +It is currently not possible to configure both compression and encryption. +The encrypted dump format assumes that the kernel dump size is a multiple +of the cipher block size, which may not be true when the dump is compressed. diff --git a/sbin/dumpon/dumpon.c b/sbin/dumpon/dumpon.c index e3701eace3db..8530c63b889d 100644 --- a/sbin/dumpon/dumpon.c +++ b/sbin/dumpon/dumpon.c @@ -71,7 +71,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n", - "usage: dumpon [-v] [-k public_key_file] special_file", + "usage: dumpon [-v] [-k public_key_file] [-z] special_file", " dumpon [-v] off", " dumpon [-v] -l"); exit(EX_USAGE); @@ -190,11 +190,12 @@ main(int argc, char *argv[]) int ch; int i, fd; int do_listdumpdev = 0; - bool enable; + bool enable, gzip; + gzip = false; pubkeyfile = NULL; - while ((ch = getopt(argc, argv, "k:lv")) != -1) + while ((ch = getopt(argc, argv, "k:lvz")) != -1) switch((char)ch) { case 'k': pubkeyfile = optarg; @@ -205,6 +206,9 @@ main(int argc, char *argv[]) case 'v': verbose = 1; break; + case 'z': + gzip = true; + break; default: usage(); } @@ -247,9 +251,11 @@ main(int argc, char *argv[]) fd = open(dumpdev, O_RDONLY); if (fd < 0) err(EX_OSFILE, "%s", dumpdev); - check_size(fd, dumpdev); - bzero(&kda, sizeof(kda)); + if (!gzip) + check_size(fd, dumpdev); + + bzero(&kda, sizeof(kda)); kda.kda_enable = 0; i = ioctl(fd, DIOCSKERNELDUMP, &kda); explicit_bzero(&kda, sizeof(kda)); @@ -260,6 +266,8 @@ main(int argc, char *argv[]) #endif kda.kda_enable = 1; + kda.kda_compression = gzip ? KERNELDUMP_COMP_GZIP : + KERNELDUMP_COMP_NONE; i = ioctl(fd, DIOCSKERNELDUMP, &kda); explicit_bzero(kda.kda_encryptedkey, kda.kda_encryptedkeysize); free(kda.kda_encryptedkey); |