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

OpenBSD hard disk drives



Hello all, i will ask you to excuse my poor english for the next :/

I have OpenBSD 3.4, and i encounter some problems on it for hard disk:

First, this is a part of my dmesg boot:
# dmesg | grep wd
wd0 at pciide0 channel 0 drive 0: <Maxtor 5T040H4>
wd0: 16-sector PIO, LBA, 38146MB, 16383 cyl, 16 head, 63 sec, 78125000
sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
dkcsum: wd0 matched BIOS disk 80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302

And at the "boot>" prompt i have an "+" after hd0, what indicates that i
can have my /bsd kernel after the 8G limit. (but not /boot second-stage
loader, If i have understood all the boot procedure well).

So, i don't unterstand after the OS has been loaded, how I can reach my
various discs.
I have read FAQ, lots of man pages and documentations on internet, but
unfortunately, the disk under OpenBSD seems to differ from other OS.
Documentations that i have found are talking about devices that doesn't exist
in /dev.

I'd like to know what are the disk devices in /dev, and that an expert
says to me if am mistaken:

I currently have this partition:
# fdisk wd0
Disk: wd0       geometry: 4863/255/63 [78124095 Sectors]
Offset: 0       Signature: 0xAA55
         Starting       Ending       LBA Info:
 #: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
*0: A5    1   0  1 -  511 254 63 [       16065:     8209215 ] FreeBSD
 1: 07  512   0  1 - 1023 254 63 [     8225280:     8225280 ] HPFS/QNX/AUX
 2: A5 1024   0  1 - 3071 254 63 [    16450560:    32901120 ] FreeBSD
 3: A6 3786 254 63 - 4862 254 62 [    60838154:    17285940 ] OpenBSD

=> I have booted on the 3 with a cd (because /boot is after 8G).
=> The FreeBSD are in reality OpenBSD paritions, but i have'nt find how
   to boot not on the first OpenBSD partition, so i set an different
   number for them, then i say at the boot> prompt (from a CD)
   "boot hd0a:/bsd" and it boot on the right partition (3).
   (boot hd0{b,c,d,e,f}:/bsd does'nt work).

And this disklabel:
# disklabel wd0
# using MBR partition 3: type A6 off 60838154 (0x3a0510a) size 17285940
 (0x107c334)
# /dev/rwd0c:
type: ESDI
disk: ESDI/IDE disk
label: Maxtor 5T040H4
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 16383
total sectors: 78125000
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#      size   offset  fstype [fsize bsize   cpg]
a:  2097648 61099920  4.2BSD   2048 16384    16   # (Cyl. 60615 - 62695)
b:   261766 60838154    swap                      # (Cyl. 60355*- 60614)
c: 78125000        0  unused      0     0         # (Cyl.    0 - 77504*)
d:  4194288 63197568  4.2BSD   2048 16384    16   # (Cyl. 62696 - 66856)
e:  4194288 67391856  4.2BSD   2048 16384   328   # (Cyl. 66857 - 71017)
f:   524160 71586144  4.2BSD   2048 16384    16   # (Cyl. 71018 - 71537)
g:  4194288 72110304  4.2BSD   2048 16384    16   # (Cyl. 71538 - 75698)
h:   524160 76304592  4.2BSD   2048 16384    16   # (Cyl. 75699 - 76218)
i: 10490444    16065 unknown                      # (Cyl.   15*- 10423*)
j: 41945714 10506510 unknown                      # (Cyl. 10423*- 52035*)
k:  8385929 52452225 unknown                      # (Cyl. 52035*- 60355*)
l:  1295342 76828752  4.2BSD   2048 16384    16   # (Cyl. 76219 - 77504*)

And that i think ( that is probably wrong :( ):
/dev/wd0* seems to be the partitions that i am using, not the partition 0.
Then how can I reach has each partition "in hard"?
(example: if i make hexdump -Cv -n 512 /dev/xxxx, it will display me the
first block of the partition)

What are the /dev/rwd0* devices ? (disklabel uses it, /dev/rwd0c it says!!)
Are /dev/wd* devices equivalent to /dev/rwd*, in spite of the fact that
the major device number differ?
(I ask this because as 'hexdump -Cv -n 512 /dev/rwd0i' and
'hexdump -Cv -n 512 /dev/wd0i' give me the same result).

So, if a want to access to the 'x' disklabel of the partition 0
(not b,c,i,j or k of course), while i have booted with an install on the
partition 3,
which dev/xxxx device do i have to use? (I want to mount it).

Why boot>, the first-stage boot loader is talking about "hd0" device for
my hard disk? OpenBSD don't have hd0 device anywhere!
So, what represents under the first-stage boot loader, for example:
hd0{a,b,c}:/bsd , hd0{i,j,k}:/bsd, hd1a:/bsd
(I suppose that I would have a 'hd1a' device if I had a second disk?)

And how i coul access to any OpenBSD install independently of the boot>
which is running?
example: the first-stage boot loader loaded in memory is from the partition
0, how can i say it to boot /bsd kernel from the partition 0 (OpenBSD),
or /bsd kernel from the partition 3 (OpenBSD) ?

I have'nt find any documentation to establish a link between devices under
the first stage boot loader and /dev/xxx devices! :(

And how i can mount, for example, the '/' directory of the partition 0
in the tree of the partition 3, which i'm running ?

I do not see at all how to do, because if i can access to the whole
partition x, i don't know hox to access to an disklabel from another
partition.

# mkdir /mnt/link
# mount_ffs /dev/xxx /mnt/link ??

all that I tested answered me "Device busy" or "Device not configured" :(

thanks to all will answer me :)