NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: setup a drive with disklabel



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

HELLO,

On May 3, 2008, at 20:44, Al - image hosting services wrote:
Hi Michael,

It doesn't seem to matter what list I ask a question on, you seem to
answer. THANKYOU!!

Well, the question is ultimately macppc-specific, on a different machine the answer would likely be different and you probably wouldn't have run into it in the first place. I'm not sure if you're aware of it but many NetBSD ports use their own 'native' partitioning scheme ( sparc for instance uses SunOS- compatible disklabels ) or with a NetBSD disklabel either mirroring the 'native' partitioning more or less ( macppc does that if an apple partition map is present, sgimips to some extent as well ) or with NetBSD slices living in a 'native' partition ( x86, prep and others do that with MBR partitions ), or a mixture of all that. Additionally, Apple OpenFirmware understands both Apple partition maps and MBR partition sectors, and to make things even more confusing there's a good chance that at least some Apple OF versions can boot from PReP boot images.

I am setting up a drive, but I can't seem to get things right with
disklabel. I have the computer netbooted and I would like to do
everything
manually with NetBSD. Where I am stuck is when I ran: "dd if=/dev/ zero
of=/dev/sd0c bs=8k count=1". Shouldn't this delete the disklabel?

It's supposed to wipe out any previously existing partitioning
schemes, like an Apple partition map.

It is still there after I do this (I really don't want to reboot
unless I really
have too).

What you get is the kernel's copy of the disk label.

I think the only way to get rid of this information and to get it to
generate new information is to reboot.

Doesn't matter - change your partition map using disklabel it will change both the kernel's and the one on the disk. I don't see why you want an empty disk label in between.

I really didn't want to reboot, because I thought that if I did I would not be able to read what is on the monitor (that it would be all scrambled again).

You don't have to reboot.

I was getting a disk label for that drive that wasn't right. It didn't have a c: partition (the whole
disk) and it had something besides label: fictitious.

Hmm, the c partition should always exist, probably was type 'unused'. A fictitious label is one the kernel made up when attaching the disk without finding a disk label on it.

I rebooted and the video mode is right for the monitor. So, I could see that it didn't have a
disk label. Now, when I look at disklabel /dev/sd0c, it looks right.

Good :)

I would like to delete everything that is in the disklabel. Then
reload
the drives geometry, then use "disklabel -i /dev/sd0c" to partition
the
drive.  I should then be able to use newfs to format the partitions
and
installboot to install bootxx. This sound good in theory, but in
practical
application I seem to be missing something.

What do you think you're missing?

What I really thought that I was missing was a way to delete the kernels
disk label. Although, I may be still over complicating this.

Yes, you are ;)

This is what I did:
disklabel /dev/sd0c > label
disklabel -r -R /dev/sd0c label
disklabel -i /dev/sd0c

I setup the partitions. At first this didn't seem right, but it looks like
I did it right.

#        size    offset     fstype [fsize bsize cpg/sgs]
a: 5120000 0 4.2BSD 0 0 0 # (Cyl. 0 -
2499)
b: 681984 5120000 swap # (Cyl. 2500 -
2832)
c: 490234752 0 unused 0 0 # (Cyl. 0 -
239372*)
e: 71680000 5801984 4.2BSD 0 0 0 # (Cyl. 2833 -
37832)
f: 40960000 77481984 4.2BSD 0 0 0 # (Cyl. 37833 -
57832)
g: 371792768 118441984 4.2BSD 0 0 0 # (Cyl. 57833 -
239372*)

Looks sane to me.

My question is should partition "a" start with cylinder 0?

Nothing wrong with that, there's still room enough for bootxx.

Then ran:
newfs /dev/sd0a
newfs /dev/sd0e
newfs /dev/sd0f
newfs /dev/sd0g

cp /usr/mdec/ofwboot /
installboot -v /dev/rwd0c /usr/mdec/bootxx /ofwboot

shutdown -r now

Then I get put back into the open firmware.

setenv boot-device pci/@D/@0,0
setenv boot-file
reset-all

Then:
0 bootr

HURRAY!!! I can boot from the hard drive.

:)

but if I do:
setenv auto-boot? true
reset-all

Then the monitor says that the frequency is outside the range, please
select another setting. So, I am stuck again.

That's one of the most annoying OpenFirmware bugs Apple ever came up with. Newer versions ( some 2.x and all 3.x ) don't set up the video hardware if you never drop to the OpenFirmware prompt. There is a workaround though, by putting some forth commands into the boot- command variable forcing the console to initialize. I don't know the magic words off my head but they were posted numerous times on port- macppc and googling them up shouldn't be too difficult.

have fun
Michael

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQEVAwUBSB0NXcpnzkX8Yg2nAQKm3Qf9GvPm33McNgTdlGHfz629W83pBa3iC76B
xALZbI8h3e76j9IsPLSIwGQTx4S9/e84RUTqLet1lWd7tN8dimPVkkTZwacDuX+d
2Ctg/cvLVOD0DKLKZLVUxvuQh42N4o9aYE0wn3mLPXVnxTOwNoLBJQ340oDxxpGu
CphEEbJ24aiMzNT2gkwZFj3Hv3mTVlbnXbb2TRqr0QRbS6IfNw468M5Cb8ThP0Fu
j6QcgPvNt/sCviS3Foi3ZjZ6Xu5y55c4w3Rz4z0gjXw/WoLULOe1647O0i+BECp+
TFFeWQq7MLOJpRCGspCnNzeoJshRxTwTlLPIxxEGSVwW/p68ndE5xg==
=lnpL
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index