On Fri, Jan 22, 2010 at 6:44 AM, Bret S. Lambert <bret.lamb...@gmail.com> wrote: > On Fri, Jan 22, 2010 at 05:42:25AM +0100, Song Li wrote: >> Hi, >> >> Here comes a question again: what's the naming convention of the >> device on OpenBSD? >> >> I am still using the newly installed OpenBSD release 4.6. >> >> It did take me some effort to find out the name of device for me to >> use with fdisk and mount: >> >> fdisk /dev/rwd0c >> and >> mount /dev/sd0i >> >> The first one is especially confusing to me since other attemps like >> "fdisk /dev/rwd0a", "fdisk /dev/rwd0d" do not work. In face, the >> examples given by the man page of fdisk use "fdisk /dev/wd0" for mbr >> and "fdisk /dev/rwd0c" for the OpenBSD. It does make perfect sense to >> me. On my OpenBSD system, however, fdisk cannot find device /dev/wd0 >> and "fdisk /dev/rwd0c" gives the mbr information. This seems very >> confusing to me. > > It works for me here on my sd device: > > $ fdisk sd0 > Disk: sd0 geometry: 20673/240/63 [312581808 Sectors] > Offset: 0 Signature: 0xAA55 > Starting Ending LBA Info: > #: id C H S - C H S [ start: size ] > ----------------------------------------------------------------------------- -- > 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused > 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused > 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused > *3: A6 0 1 1 - 20672 239 63 [ 63: 312575697 ] OpenBSD > > so I'm not sure what's going on with you.
"fdisk sd0" is not a problem to me now either after I've seen Aaron's comments on fdisk. The problem on mount still exists though: What seems a little counter intuitive to me is: I would see sd0 as a shortcut of /dev/sd0 for fdisk, but "fdisk /dev/sd0" does not work. In addition, the fact that we need "mount /dev/sd0i /mnt/usb" and the slice letter 'i' seems weird to me. I can now see the possible rationale behind: OpenBSD assigns slice letters for *all* devices together in sequence, while other OS may just start it over for a different device. OpenBSD may have a reason for this design but that's what confused me, esp., after the change of device name from ad to wd, and the alias of /dev/rwd0c for wd0, etc. > >> >> For the mount device: what's the device naming convention and the >> rationale behind it? I do not think it's a good idea to search through >> all the device and find out the device name. Linux and FreeBSD use >> slightly different convention but they both make sense to me. What >> about OpenBSD? > > The naming convention is device driver name, device number, partition > letter (e.g., mount /dev/sd1e /mnt/foo). And as far as I know, it's > been like that since the BSDs were in diapers, so I'm not sure why > it's coming as a surprise. > I happen to have FreeBSD 6.4 in hand. The following commands work as expected: fdisk ad4 fdisk /dev/ad4 fdisk da0 fdisk /dev/da0 mount /dev/ad4s4 /mnt/openbsd mount -t msdosfs /dev/da0s1 /mnt/usb and the following commands do not work: mount ad4s4 /mnt/openbsd mount -t msdosfs da0s1 /mnt/usb The works and not-works all seem reasonable to me, while those on OpenBSD are different. >> >> >> For your reference, the output of various fdisk commands is listed >> below. The first one gives correct information. > > Great! output of the various commands which doesn't specify which > command was run is *totally* useful! Since the first line of the output for each command shows the device, I thought it's quite self-explanary. But I can see now how it may lead to confusion. Sorry, should have made them more clear. > >> >> Disk: /dev/rwd0c geometry: 15566/255/63 [250069680 Sectors] >> Offset: 0 Signature: 0xAA55 >> Starting Ending LBA Info: >> #: id C H S - C H S [ start: size ] >> ----------------------------------------------------------------------------- -- >> 0: 07 0 1 1 - 8923 254 63 [ 63: 143363997 ] NTFS >> 1: 83 8924 0 1 - 10941 254 63 [ 143364060: 32419170 ] Linux files* >> 2: A5 13425 0 1 - 15565 254 63 [ 215672625: 34395165 ] FreeBSD >> *3: A6 10942 0 1 - 13424 254 63 [ 175783230: 39889395 ] OpenBSD >> Disk: /dev/rwd0a geometry: 15566/255/63 [250069680 Sectors] >> Offset: 0 Signature: 0xAA55 >> Starting Ending LBA Info: >> #: id C H S - C H S [ start: size ] >> ----------------------------------------------------------------------------- -- >> 0: E8 15356 77 8 - 229721 118 4 [ 246698998: 3443776305 ] <Unknown ID> >> 1: 01 0 0 1 - 267349 89 4 [ 0: 0 ] DOS FAT-12 >> 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused >> 3: 3F 0 0 1 - 267349 89 4 [ 0: 0 ] <Unknown ID> >> Disk: /dev/rwd0b geometry: 15566/255/63 [250069680 Sectors] >> Offset: 0 Signature: 0x3834 >> Starting Ending LBA Info: >> #: id C H S - C H S [ start: size ] >> ----------------------------------------------------------------------------- -- >> 0: 20 58716 3 28 - 118439 184 60 [ 943272756: 959461431 ] Willowsoft >> 1: 31 52413 63 48 - 100661 37 61 [ 842018861: 775102496 ] <Unknown ID> >> 2: 37 57639 15 25 - 115302 140 12 [ 925971504: 926363958 ] <Unknown ID> >> 3: 31 53486 55 56 - 104879 180 37 [ 859256110: 825636402 ] <Unknown ID> >> Disk: /dev/rwd0d geometry: 15566/255/63 [250069680 Sectors] >> Offset: 0 Signature: 0x3831 >> Starting Ending LBA Info: >> #: id C H S - C H S [ start: size ] >> ----------------------------------------------------------------------------- -- >> 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused >> 1: 73 75192 139 32 - 75194 99 17 [ 1207968268: 29596 ] <Unknown ID> >> 2: 03 1 215 4 - 58686 13 6 [ 29613: 942761802 ] XENIX /usr >> 3: 08 37963 38 28 - 145529 126 55 [ 609878016: 1728053362 ] AIX fs