From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <66b9839fdb955f8f969063ccff722c4c@quanstro.net> To: 9fans@9fans.net From: erik quanstrom Date: Tue, 1 Jul 2008 09:25:12 -0400 In-Reply-To: <20080701120805.22ECF1E8C22@holo.morphisms.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] 9vx Topicbox-Message-UUID: d2bcdafa-ead3-11e9-9d60-3106f5b1d025 >> Here's the fix for the fdisk problem: >> >> /sys/src/cmd/disk/prep/edit.c:503,508 - edit.c:503,509 >> */ >> for(i=0; inctlpart; i++) { >> p = edit->ctlpart[i]; >> + if(strncmp(p->ctlname, "data", 5) != 0) >> if(p->changed) >> if(fprint(ctlfd, "delpart %s\n", p->ctlname)<0) { >> fprint(2, "delpart failed: %s: %r\n", p->ctlname); on second read, with this approach, i would think that strcmp() not strncmp should be used. > > That would work, but one wonders why > the normal kernel doesn't have this problem. this must be a quirk of the interaction between devsd and fdisk. by hand data does disappear: ; lc 9fat ctl data nvram plan9 raw ; for(i in 9fat data nvram plan9 data)echo delpart $i>ctl ; lc ctl raw by the way, be very careful with this before applying this patch: ; diff -c /sys/src/9/port/devsd.c /n/dump/2008/0701/sys/src/9/port/devsd.c /sys/src/9/port/devsd.c:147,153 - /n/dump/2008/0701/sys/src/9/port/devsd.c:147,152 */ pp = unit->part; for(i = 0; i < unit->npart; i++){ - if(pp->name) if(strcmp(name, pp->name) == 0) break; pp++; this is required because npart is set to the number of partitions allocated. the names never-set partitions might be 0. otherwise "delpart missingpart>/dev/sdXX/ctl" will be a noisy and somewhat gratituous synonym for "echo reboot>/dev/reboot". - erik