Re: Really odd "BTX halted" problem booting FreeBSD on VALinux h
> > I have recently created a disklabel on a slice of an ata disk with > > disklabel. Of course i had to create an entry in /etc/disktab to do > > that, but encountered no other problem. > Last time I had to do that, I used dd to copy the first couple of > blocks from a working disk onto the new one, and then used disklabel > to edit the new one to look like I wanted it. My way in this case is very similar: disklabel -r ad0sx >dl disklabel -R -r adosy dl where ad0sx is an existing partition, ad0sy the one to create. I think this is less dangerous than using dd. > Only took a minute or two to do the work, and an hour or so to > figure out that's what I had to do. You´re a good guy then. There were two weeks between my first attempts to create a FreeBSD slice in an extended partition and reaching the goal, including many hexedit sessions to see what´s going on. For 4.2 it´s for sure too late, but in the longterm it would be great to have extended slices supported, as many users (like me) will join BSD from a multi-OS installation, where it can be hard to get a sufficient primary slice. Linux (and best thing in this area: BeOS) show, that it´s possible to do so. John, are there any substantial obstacles in the design of FreeBSD to achieve this or is it "just" rewriting fdisk, disklabel, sysinstall and maybe newfs? I would like to join the work for this, but can´t do this alone: lack of experience in this area. Ciao Siegbert To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-stable" in the body of the message
Dangerously dedicated (was Re: Really odd "BTX halted" problem booting FreeBSD on VALinux h)
John Baldwin wrote: > It is kind of semantic. However, on the alpha it is hardly dangerous. Nor > do we fake a MBR on the alpha (which is what makes it dangerous). The alpha > architecture doesn't use MBR's, but the PC arch does. Thus, having a disklabel > on the alpha is normal, having one at the start of a PC disk requires ugly > hacks that break the PC arch, hence the difference. Do I understand you correctly? Are you saying there are potential problems with a "dangerously dedicated" HDD on a PC? I don't use Micros~1 products on any of my machines (acutally, I use nothing but FreeBSD) so I've assumed that there's no reason to do anything other than "dangerously dedicated". Am I wrong is thinking that?? Is this one of those issues where "if it boots, it'll be fine" or is it something that could bite me later?? -Bill To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-stable" in the body of the message
Re: Really odd "BTX halted" problem booting FreeBSD on VALinux h
On 28-Oct-00 Matt Dillon wrote: >:> # optional dd if you are paranoid >:> # dd if=/dev/zero of=/dev/da0 bs=32k count=4 >:> fdisk -I da0 >:> disklabel -w -r da0s1 auto >:> >:> That's much preferable to having to use sysinstall if all you want to >:> do is initialize a label on a slice. >: >:Yes, this is definitely the desired behavior. >: >:-- >: >:John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ > > John, can you explain how the MBR bootstraps a slice? Should I make > disklabel zero-out the fdisk partition table area in the slice rather > then installing the dummy fdisk partition table? That is, for the > case where -B is used on a slice (da0s1) verses on the whole-disk (da0)? Just ignore the slice table within a slice. It is only used when boot1 is splatted over top of the MBR for the dangerously dedicated mode. It is unused and ignored otherwise. > -Matt -- John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-stable" in the body of the message
Re: Really odd "BTX halted" problem booting FreeBSD on VALinux h
:> # optional dd if you are paranoid :> # dd if=/dev/zero of=/dev/da0 bs=32k count=4 :> fdisk -I da0 :> disklabel -w -r da0s1 auto :> :> That's much preferable to having to use sysinstall if all you want to :> do is initialize a label on a slice. : :Yes, this is definitely the desired behavior. : :-- : :John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ John, can you explain how the MBR bootstraps a slice? Should I make disklabel zero-out the fdisk partition table area in the slice rather then installing the dummy fdisk partition table? That is, for the case where -B is used on a slice (da0s1) verses on the whole-disk (da0)? -Matt To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-stable" in the body of the message
Re: Really odd "BTX halted" problem booting FreeBSD on VALinux h
On 28-Oct-00 Matt Dillon wrote: >:> I think you are specifying the wrong arguments to disklabel; I >:> seem to rememebr a -w/-W distinction... >: >:Nope. >: >:> In any case, I'm running with a disklabel inside a DOS partition >:> on all but one box of mine, and always have been. I installed >:> 4.1 on my laptop that way. >: >:Sysinstall can create a disklabel inside of a MBR slice fine. The >:problem is that the disklabel(8) _program_ itself doesn't know how >:to create a virgin disklabel for a MBR slice. >: >:-- >: >:John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ > > The patchset I put on the lists earlier today will allow disklabel > to install a virgin label on a slice. Did it not get out? As matters > currently stand, disklabel can only edit a preexisting label on a slice. If your patch works it looks great to me. I was just referring to our currently checked in code in disklabel(8). :) > I'll post it again... included below (this time without the file > descriptor cruft that snuck into my previous posting of the patch). With > the patch you can do this: I did wonder about the file descriptor patch the first go-round... :) > # optional dd if you are paranoid > # dd if=/dev/zero of=/dev/da0 bs=32k count=4 > fdisk -I da0 > disklabel -w -r da0s1 auto > > That's much preferable to having to use sysinstall if all you want to > do is initialize a label on a slice. Yes, this is definitely the desired behavior. -- John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-stable" in the body of the message
Re: Really odd "BTX halted" problem booting FreeBSD on VALinux h
:> I think you are specifying the wrong arguments to disklabel; I :> seem to rememebr a -w/-W distinction... : :Nope. : :> In any case, I'm running with a disklabel inside a DOS partition :> on all but one box of mine, and always have been. I installed :> 4.1 on my laptop that way. : :Sysinstall can create a disklabel inside of a MBR slice fine. The :problem is that the disklabel(8) _program_ itself doesn't know how :to create a virgin disklabel for a MBR slice. : :-- : :John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ The patchset I put on the lists earlier today will allow disklabel to install a virgin label on a slice. Did it not get out? As matters currently stand, disklabel can only edit a preexisting label on a slice. I'll post it again... included below (this time without the file descriptor cruft that snuck into my previous posting of the patch). With the patch you can do this: # optional dd if you are paranoid # dd if=/dev/zero of=/dev/da0 bs=32k count=4 fdisk -I da0 disklabel -w -r da0s1 auto That's much preferable to having to use sysinstall if all you want to do is initialize a label on a slice. -Matt Index: sbin/disklabel/disklabel.c === RCS file: /home/ncvs/src/sbin/disklabel/disklabel.c,v retrieving revision 1.28.2.3 diff -u -r1.28.2.3 disklabel.c --- sbin/disklabel/disklabel.c 2000/07/01 06:47:46 1.28.2.3 +++ sbin/disklabel/disklabel.c 2000/10/27 19:24:00 @@ -1347,10 +1347,17 @@ warn("cannot open %s", namebuf); return (NULL); } - if (ioctl(f, DIOCGDINFO, &lab) < 0) { - warn("ioctl DIOCGDINFO"); - close(f); - return (NULL); + + /* +* Try to use the new get-virgin-label ioctl. If it fails, +* fallback to the old get-disdk-info ioctl. +*/ + if (ioctl(f, DIOCGDVIRGIN, &lab) < 0) { + if (ioctl(f, DIOCGDINFO, &lab) < 0) { + warn("ioctl DIOCGDINFO"); + close(f); + return (NULL); + } } close(f); lab.d_boot0 = NULL; Index: sys/kern/subr_diskslice.c === RCS file: /home/ncvs/src/sys/kern/subr_diskslice.c,v retrieving revision 1.82 diff -u -r1.82 subr_diskslice.c --- sys/kern/subr_diskslice.c 2000/01/28 11:51:08 1.82 +++ sys/kern/subr_diskslice.c 2000/10/27 19:23:28 @@ -366,12 +366,46 @@ int slice; struct diskslice *sp; struct diskslices *ssp; + struct partition *pp; slice = dkslice(dev); ssp = *sspp; sp = &ssp->dss_slices[slice]; lp = sp->ds_label; switch (cmd) { + + case DIOCGDVIRGIN: + lp = (struct disklabel *)data; + if (ssp->dss_slices[WHOLE_DISK_SLICE].ds_label) { + *lp = *ssp->dss_slices[WHOLE_DISK_SLICE].ds_label; + } else { + bzero(lp, sizeof(struct disklabel)); + } + + lp->d_magic = DISKMAGIC; + lp->d_magic2 = DISKMAGIC; + pp = &lp->d_partitions[RAW_PART]; + pp->p_offset = 0; + pp->p_size = sp->ds_size; + + lp->d_npartitions = MAXPARTITIONS; + if (lp->d_interleave == 0) + lp->d_interleave = 1; + if (lp->d_rpm == 0) + lp->d_rpm = 3600; + if (lp->d_nsectors == 0) + lp->d_nsectors = 32; + if (lp->d_ntracks == 0) + lp->d_ntracks = 64; + + lp->d_bbsize = BBSIZE; + lp->d_sbsize = SBSIZE; + lp->d_secpercyl = lp->d_nsectors * lp->d_ntracks; + lp->d_ncylinders = sp->ds_size / lp->d_secpercyl; + lp->d_secperunit = sp->ds_size; + lp->d_checksum = 0; + lp->d_checksum = dkcksum(lp); + return (0); case DIOCGDINFO: if (lp == NULL) To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-stable" in the body of the message