On 08/09/13 23:34, Kenneth R Westerback wrote: > On Fri, Aug 09, 2013 at 04:54:01PM -0400, Kenneth R Westerback wrote: >> On Fri, Aug 09, 2013 at 11:38:16AM +0200, Federico Giannici wrote: ... >> disklabel(8) contains a description of the 'z' command available >> in the -E mode. It should kill 'c' dead. Just add 'a' back with the >> same parameters it had brfore. >> >> Not that Nick's solution isn't more fun! >> >> .... Ken > > Or it could be a nifty snare in the kernel that is accidentally preserving > info that should not be preserved. This is probably not the best patch, but > it does let me use 'disklabel -e sd2' to set 'c' to 'unused'. > > .... Ken
This makes things much better. ok nick@ on the general idea and the results, but I won't pass judgement on the implementation. Nick. > > Index: subr_disk.c > =================================================================== > RCS file: /cvs/src/sys/kern/subr_disk.c,v > retrieving revision 1.150 > diff -u -p -r1.150 subr_disk.c > --- subr_disk.c 3 Jul 2013 15:21:40 -0000 1.150 > +++ subr_disk.c 10 Aug 2013 03:23:26 -0000 > @@ -655,6 +674,8 @@ setdisklabel(struct disklabel *olp, stru > if (DL_GETPOFFSET(npp) != DL_GETPOFFSET(opp) || > DL_GETPSIZE(npp) < DL_GETPSIZE(opp)) > return (EBUSY); > + if (i == RAW_PART) > + continue; > /* > * Copy internally-set partition information > * if new label doesn't include it. XXX