disklabel / disklabel64 change needs reboot / disk change
Changing disk label from disklabel to disklabel64 format
or vice versa needs reboot (or disk change, eg natacontrol detach / attach).
This has worked without reboot earlier,
as described in disklabel(8) & disklabel64(8);
problem was introduced with devfs as I remeber.
Problem seems to be that in kernel disklabel survives
erasure of label on device (disklabel -W .. / dd if=/dev/zero of=DISK ..)
#1 Updated by dillon about 5 years ago
:Changing disk label from disklabel to disklabel64 format
:or vice versa needs reboot (or disk change, eg natacontrol detach / attach).
:This has worked without reboot earlier,
:as described in disklabel(8) & disklabel64(8);
:problem was introduced with devfs as I remeber.
:Problem seems to be that in kernel disklabel survives
:erasure of label on device (disklabel -W .. / dd if=/dev/zero of=DISK ..)
Devfs is supposed to flag writes to the dos slice and/or label area
and re-probe. There's probably some logic missing.
#2 Updated by alexh about 5 years ago
To fix this, please add the following lines in "case DIOCWLABEL:"
disk_msg_send_sync(DISK_SLICE_REPROBE, dev->si_disk, sp);
just after line 648:
set_ds_wlabel(ssp, slice, *(int *)data != 0);
I can't do it right now, but I'll be back to work on this and more on the
This should solve the disklabel issue at least. Direct writes (e.g. dd) should
be detected properly with the DSF_REPROBE magic. If not, please post some more
info on the disk/slice structure.
#3 Updated by thomas.nikolajsen almost 5 years ago
Patch supplied in prev. message didn't solve problem:
after applying patch disk slice is read-only after 'disklabel -W <slice>',
so dd fails (trying to zero initial part of slice).
Details on disk/slice:
fdisk -i ad4 # install MBR
disklabel64 -rw ad4s2 auto # initially (slice empty) succeeds
disklabel64 -W ad4s2
dd if=/dev/zero of=/dev/ad4s2 bs=512 count=32 # succeedes on master; fails w/
patch (issue1667 Feb. 9th 2010) (read-only)
disklabel32 -rw ad4s2 auto # fails 'disk already has a label of a different
disklabel64 ad4s2 # shows 64-bit label