Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 1997 09:54:49 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        j@uriah.heep.sax.de, volf@oasis.IAEhv.nl
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/4303
Message-ID:  <199710122354.JAA13707@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> I completely disagree: if I set dumpon to a non swap device by accident, 
>> (for example /dev/rsd0s1e) I could/will lose part of my file system.
>
>dumpon should perhaps issue a warning if the device looks like
>something that has a filesystem on it.  It should refuse to dump to

dumpon should do what it is told.  It is less dangerous than swapon.

>any device that was opened by the time the dump happens.

Then it would be impossible to dump to (active) swap devices.  Swap devices
are not closed on shutdown (this is a bug - it leaves media locked).

>> But that is not the point. In kern_shutdown.c the following code can be
>> found (arround line 320 in function dumpsys):
>> 
>>         if ((minor(dumpdev)&07) != 1)
>>                 return;
>
>This used to be an (undocumented) feature, but turned into a bug over
>time.  A device with (minor & 07) == 1 is no longer something very
>special.  Swapping could have happened to anything else, nor would it
>make much sense that you could dump to /dev/rfd0.1720 but not to any
>other floppy device. ;-)  Let alone tape drives...

No, such devices are very special, although swap devices are not.
Someone broke the minor numbering convention for floppies and and cdroms,
but drivers for these disk devices and all tape devices won't have a
dump routine, so dumpon on them will fail.

The bugs are:
- the above check is not performed in the sysctl to set the dump device,
  so dumpon can succeed although the dump device is unusable.
- the above check is not compatible with the checking for swap devices.
- the (partition for) the dump device may change after the dump device is
  if the media is removable or the device containing the partition is
  repartitioned.  Thus most of the checking done in the sysctl is not
  final, and the wrong device may be written to at dump time.  The
  (minor & 07) check is useful for preventing problems here - just follow
  the convention that the 'b' partition is always for disposable data.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710122354.JAA13707>