Project

General

Profile

Actions

Bug #14767

closed

Kernel textdumps are not recovered properly on systems with multiple swap partitions

Added by Vladimir Suhhanov 7 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
FreeBSD
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.09
Release Notes:
Default
Affected Version:
2.8.0
Affected Architecture:
All

Description

ZFS guided auto-install, selected zfs-mirror, two disks.
As a result we have two swap partitions in fstab

@
  1. Device Mountpoint FStype Options Dump Pass#
    /dev/gpt/efiboot0 /boot/efi msdosfs rw 2 2
    /dev/ada0p3 none swap sw 0 0
    /dev/ada1p3 none swap sw 0 0

@

Original rc.dumpon consists function

@
dumpon_try() {
if /sbin/dumpon "${1}" ; then # Create a symlink in devfs for savecore
echo "Using ${1} for dump device."
ln -fs "${1}" /dev/dumpdev
return 0
fi
echo "Unable to specify $1 as a dump device."
return 1
}

@

This function overwrites the symlink for dump device with last one tried device.
As a result we have symlink, but no dump for the savecore, because the dump is saved on the first partition, not the last one.
You can test it by entering command in console.

sysctl debug.kdb.enter=1

As a workaround, I've modified code

@
dumpon_try() {
local dump_device="$1"

if /sbin/dumpon "$dump_device" ; then
    # Create a symlink in devfs for savecore only if it doesn't exist
if [ ! -e "/dev/dumpdev" ]; then
ln -s "$dump_device" /dev/dumpdev
fi # Print a message for each dump device found
echo "Using $dump_device for dump device."
return 0
fi
echo "Unable to specify $dump_device as a dump device." 
return 1
}

@

Actions #1

Updated by Jim Pingle 7 months ago

  • Subject changed from If multiple swap devices found, rc.dumpon overwrites the dumpdev symlink with last one to Kernel textdumps are not recovered properly on systems with multiple swap partitions
  • Assignee set to Jim Pingle
  • Target version set to 2.8.0
  • Plus Target Version set to 23.09
Actions #2

Updated by Jim Pingle 7 months ago

  • Status changed from New to In Progress

The problem isn't with rc.dumpon, it's in rc.savecore.

The OS supports multiple dump devices and it can use them all (see dumpon -l output) so the part that needs correcting is in rc.savecore -- It's hardcoded to use the symlink to the last dump device when really it should be iterating over dumpdev -l output.

Actions #3

Updated by Jim Pingle 7 months ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Vladimir Suhhanov 7 months ago

Tested, works fine. Thanks, Jim.

Actions #5

Updated by Jim Pingle 7 months ago

  • Status changed from Feedback to Resolved

Tested and working as expected on snapshots as well.

Actions #6

Updated by Jim Pingle 6 months ago

  • Target version changed from 2.8.0 to 2.7.1
Actions

Also available in: Atom PDF