Re: 3.8 snapshot bsd.rd installer clobbers MacOS partitions (or whatever is at sd0a ?)
Martin Reindl <[email protected]> Sun, 18 Sep 2005 16:11:26 +0200
| Newsgroups | gmane.os.openbsd.mac68k |
|---|---|
| Organization | catai.org |
| Message-ID | <[email protected]> |
Andrew Daugherity <[email protected]> wrote: > Summary: bsd.rd 3.8 snapshot installer overwrites the sd0a partition, > rather than asking which one to newfs/mount. Also, disklabel does not > see the partition created by pdisk. > > Snapshot date / kernel revision: OpenBSD 3.8 (RAMDISK) #18: Sun Sep 4 > 12:38:54 EDT 2005 > [email protected]:/usr/src/sys/arch/mac68k/compile/RAMDISK > > Machine: Quadra 605, upgraded to real 68040, 36MB RAM, 1GB disk, Mac OS 7.6.1 > > Reproduce: Run the installer and watch it use sd0a (MacOS in my case) > instead of the partition created with pdisk. > > Fix: patch the install script? Well, no, things are not that easy here. Documentation is a wee bit optimistic and installing mac68k needs some experience. > Details: After reading about the "video address hack" option in the > Booter program, I discovered that 3.7 does indeed boot on my Quadra > 605; however, as has been reported by others, the ADB keyboard (Apple > Keyboard II) does not work with the RAMDISK kernel. I managed to rig > up a serial console with a Mac modem cable + DB25/DB9 adapter + the > DB9 null-modem cable I use on i386 boxen, and proceeded with the > install, figuring I'd see if the keyboard worked in GENERIC after > installing. RAMDISK detects your hardware, so i really wonder why it doesn't work. Other 'Cuda' machines work. But then, an ADB overhaul is due anyway. > In the disk partitioning phase, I deleted the Linux and NetBSD > partitions that were on the disk (as neither one had enough space > allocated to be functional) and created a new OpenBSD partition in > their stead. The MacOS and NetBSD swap partitions were left alone. > The next step in the installer listed the "OpenBSD filesystems" as > "sd0a /", and asked if I wanted to proceed (the disklabel editor was > never invoked). Figuring sd0a was the partition I had just created > and the Mac partitions would be higher in the virtual disklabel, like > DOS partitions on i386 (big mistake on my part, apparently!), I said > YES, and did a double-take when it reported the size as 160MB instead > of the 800MB partition I had just created. If you wanted to replace NetBSD with OpenBSD, then you could have just reused the partitions and would have a working system now. Yes, disklabel was not invoked. Disklabel only gets invoked when there are no Mac OS headers on the disk, e.g. a 'blank' disk. But the booter cannot load kernels from there. So we got pdisk replacing disklabel here, and contrary to macppc, where you mark an OpenBSD partition and create slices _inside_ this partition, on mac68k the slices are supposed to be generated by pdisk. Currently the safest way to install is using slices generated by mkfs in Mac OS or reuse slices from NetBSD. > I suppose this is user error, but in my defense, I would like to point > out that (a) pdisk only listed partition numbers, not sd0a, etc. > names; (b) disklabel, which enumerates the partitions differently, was > never invoked; and (c) the installer never asked which partition I > wanted to format and mount -- it just picked sd0a and ran with it. > The INSTALL.mac68k file refers to disklabel editing (not deleting the > whole-disk sd0c partition, etc.), but the disklabel editor is NOT > invoked from the install script -- at least not in interactive mode. (a) pdisk in fact lists the slices, but it's only reliable when you know what you're doing, meaning going the mkfs way pointed out above. And yes, only disklabel editing is currently documented. (b) disklabel is useless on disks with Mac OS headers. (c) yes there is some glue missing when using pdisk modified slices (but not mkfs generated ones) > I verified the network works (it does, despite INSTALL.mac68k claiming > LC-PDS ethernet cards don't work), and then dropped to a shell to > examine the disklabel output (which is different than the partition > map, not even showing my OpenBSD partition!). Complete serial console > log follows. That's good. You are probably the first one testing this after the nubus changes. > If this should be filed as a bug report, I will gladly do so. No it's just fine, thank you. I put additional comments below. [install process] > Available disks are: sd0 sd1. > Which one is the root disk? (or 'done') [done] sd0 > This disk has been setup under MacOS. You will now edit a MacOS partition > table. Be careful not to remove the MacOS partitions in use. It warns you :) > Edit /dev/sd0c - > Command (? for help): ? > Notes: > Base and length fields are blocks, which vary in size between media. > The base field can be <nth>p; i.e. use the base of the nth partition. > The length field can be a length followed by k, m, g or t to indicate > kilo, mega, giga, or tera bytes; also the length can be <nth>p; i.e. use > the length of the nth partition. > The name of a partition is descriptive text. > > Commands are: > h help > p print the partition table > P (print ordered by base address) > i initialize partition map > s change size of partition map > c create new partition (standard OpenBSD type) > C (create with type also specified) > n (re)name a partition > d delete a partition > r reorder partition entry in map > t change a partition's type > w write the partition table > q quit editing (don't save changes) > Command (? for help): p > > Partition map (with 512 byte blocks) on '/dev/sd0c' > #: type name length base ( size ) > 1: Apple_partition_map Apple 63 @ 1 > 2: Apple_Driver43*Macintosh 32 @ 64 > 3: Apple_HFS MacOS 327676 @ 96 (160.0M) > 4: Apple_Unix_SVR2 NetBSD SWAP 137744 @ 327772 ( 67.3M) > 5: Apple_UNIX_SVR2 Linux 619848 @ 465516 (302.7M) > 6: Apple_Unix_SVR2 NetBSD Root & Usr 1024471 @ 1085364 (500.2M) > 7: Apple_Free Extra 5 @ 2109835 > > Device block size=512, Number of Blocks=2109840 (1.0G) > DeviceType=0x1, DeviceId=0x1 > Drivers- > 1: @ 64 for 19, type=0x1 > > Command (? for help): d > Partition number: 5 > Command (? for help): p > > Partition map (with 512 byte blocks) on '/dev/sd0c' > #: type name length base ( size ) > 1: Apple_partition_map Apple 63 @ 1 > 2: Apple_Driver43*Macintosh 32 @ 64 > 3: Apple_HFS MacOS 327676 @ 96 (160.0M) > 4: Apple_Unix_SVR2 NetBSD SWAP 137744 @ 327772 ( 67.3M) > 5: Apple_Free Extra 619848 @ 465516 (302.7M) > 6: Apple_Unix_SVR2 NetBSD Root & Usr 1024471 @ 1085364 (500.2M) > 7: Apple_Free Extra 5 @ 2109835 > > Device block size=512, Number of Blocks=2109840 (1.0G) > DeviceType=0x1, DeviceId=0x1 > Drivers- > 1: @ 64 for 19, type=0x1 > > Command (? for help): d > Partition number: 6 > Command (? for help): p > > Partition map (with 512 byte blocks) on '/dev/sd0c' > #: type name length base ( size ) > 1: Apple_partition_map Apple 63 @ 1 > 2: Apple_Driver43*Macintosh 32 @ 64 > 3: Apple_HFS MacOS 327676 @ 96 (160.0M) > 4: Apple_Unix_SVR2 NetBSD SWAP 137744 @ 327772 ( 67.3M) > 5: Apple_Free Extra 1644324 @ 465516 (802.9M) > > Device block size=512, Number of Blocks=2109840 (1.0G) > DeviceType=0x1, DeviceId=0x1 > Drivers- > 1: @ 64 for 19, type=0x1 > > Command (? for help): c > First block: 465516 > Length in blocks: 1644300 > Name of partition: OpenBSD > Command (? for help): p > > Partition map (with 512 byte blocks) on '/dev/sd0c' > #: type name length base ( size ) > 1: Apple_partition_map Apple 63 @ 1 > 2: Apple_Driver43*Macintosh 32 @ 64 > 3: Apple_HFS MacOS 327676 @ 96 (160.0M) > 4: Apple_Unix_SVR2 NetBSD SWAP 137744 @ 327772 ( 67.3M) > 5: Apple_UNIX_SVR2 OpenBSD 1644300 @ 465516 (802.9M) > 6: Apple_Free Extra 24 @ 2109816 > > Device block size=512, Number of Blocks=2109840 (1.0G) > DeviceType=0x1, DeviceId=0x1 > Drivers- > 1: @ 64 for 19, type=0x1 > > Command (? for help): w > Writing the map destroys what was there before. Is that okay? [n/y]: y At this point you have a unusable map. I'm pretty sure the information about partition 5 didn't get written to disk, but we can blame pdisk here (or me, for not fixing it). Arrange your disk with mkfs from Mac OS, don't touch pdisk in the installer, and it will be fine. > Command (? for help): q > Available disks are: sd1. > Which one do you wish to initialize? (or 'done') [done] > > OpenBSD filesystems: > sd0a / > > The next step *DESTROYS* all existing data on these partitions! > Are you really sure that you're ready to proceed? [no] y > /dev/rsd0a: 327676 sectors in 752 cylinders of 4 tracks, 109 sectors > 160.0MB in 2 cyl groups (648 c/g, 137.95MB/g, 17664 i/g) > /dev/sd0a on /mnt type ffs (rw, asynchronous, local, ctime=Sun Sep 18 > 03:20:32 2005) It just picked whatever it found first, Mac OS in this case. Really be careful here. Glue missing! martin