[...]
aic0 at isa0 port 0x340-0x35f irq 11
scsibus0 at aic0: 8 targets, 8 luns per target
[...]
scsibus0: waiting 2 seconds for devices to settle...
aic0: unrecognized MESSAGE EXTENDED; sending REJECT
sd0 at scsibus0 target 0 lun 0: <TANDEM, 4255-1, 5n53> SCSI2 0/direct fixed
sd0: 1916 MB, 2857 cyl, 15 head, 91 sec, 514 bytes/sect x 3910198 sectors
st0 at scsibus0 target 3 lun 0: <SANKYO, CP1000, 7_30> SCSI2 1/sequential removable
st0: drive empty
cd0 at scsibus0 target 6 lun 0: <IBM, CDRM00203\134000\134000\134000\134000\134000!K, 8B06> SCSI2 5/cdrom removable
sd0: no disk label
Now, the CD and the tape are fine, but I'd really like to get a filesystem
on the SCSI HD to get a little breathing space for the system. All the
infomation I've seen about creating new filesystems in NetBSD assumes that
I am doing a new installation and want to share the machine with some
other OS like Windows. This doesn't apply in my case as NetBSD is already
installed and running and has the whole machine to itself.
What I've gleaned so far suggests that fdisk and disklabel are used for
this purpose, but they've defied my attempts to use them and the man pages
are not much help. Here's fdisk:
# fdisk -i sd0
fdisk: can't read fdisk partition table: Invalid argument
NetBSD disklabel disk geometry:
cylinders: 2857 heads: 15 sectors/track: 91 (1365 sectors/cylinder)
BIOS disk geometry:
cylinders: 2857 heads: 15 sectors/track: 91 (1365 sectors/cylinder)
Do you want to change our idea of what BIOS thinks? [n] n
We haven't written the MBR back to disk yet. This is your last chance.
NetBSD disklabel disk geometry:
cylinders: 2857 heads: 15 sectors/track: 91 (1365 sectors/cylinder)
BIOS disk geometry:
cylinders: 2857 heads: 15 sectors/track: 91 (1365 sectors/cylinder)
Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Should we write new partition table? [n] y
fdisk: can't write fdisk partition table: Invalid argument
Not much help there. Maybe disklabel can do something:
# disklabel -i sd0
disklabel: can't read master boot record: Invalid argument
partition> P
4 partitions:
# size offset fstype [fsize bsize cpg/sgs]
d: 3910198 0 unused 0 0 # (Cyl. 0 - 2864*)
partition> d
Filesystem type [?] [unused]: 4.2BSD
Start offset [0c, 0s, 0M]:
Partition size ('$' for all remaining) [2864.61c, 3910198s, 1916.73M]: $
partition> W
Label disk [n]? y
disklabel: warning, boot block size % sector-size != 0
disklabel: warning, super block size % sector-size != 0
disklabel: ioctl DIOCWDINFO: Label magic number or checksum is wrong!
(disklabel or kernel is out of date?)
Label not written
I'm guessing this is because fdisk didn't write what it was supposed to
write. Some blind fumbling suggests that fdisk can write the magic number
when invoked with the "-u" switch, and that NetBSD likes "169" as a magic
number. But here further questions arise: if I want to create, say, a
swap partition and two data partitions on the device, do I need a
different magic number to specify the swap space? Does the swap space
reside inside the NetBSD space or as a separate entity? Looking at the
IDE boot drive shows this:
# fdisk wd0
NetBSD disklabel disk geometry:
cylinders: 1010 heads: 9 sectors/track: 55 (495 sectors/cylinder)
BIOS disk geometry:
cylinders: 1009 heads: 9 sectors/track: 55 (495 sectors/cylinder)
Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: sysid 169 (NetBSD)
start 55, size 499895 (244 MB), flag 0x80
beg: cylinder 0, head 1, sector 1
end: cylinder 1009, head 8, sector 55
This suggests to me that the swap space is inside the NetBSD space,
correct?
Disklabel shows this about the IDE drive:
# disklabel wd0
# /dev/rwd0d:
type: unknown
disk: netbsd
label:
flags:
bytes/sector: 512
sectors/track: 55
tracks/cylinder: 9
sectors/cylinder: 495
cylinders: 1010
total sectors: 499950
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # microseconds
track-to-track seek: 0 # microseconds
drivedata: 0
8 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: 434555 55 4.2BSD 1024 8192 16 # (Cyl. 0*- 877)
b: 65340 434610 swap # (Cyl. 878 - 1009)
c: 499895 55 unused 0 0 # (Cyl. 0*- 1009)
d: 499950 0 unused 0 0 # (Cyl. 0 - 1009)
This suggests that the NetBSD space has "8 partitions" but for the life of
me I can only see 4 here. Offset suggests that the first cylinder be left
alone, presumable for the boot record and partition table. Lets try it on
the SCSI drive:
BIOS disk geometry:
cylinders: 2857 heads: 15 sectors/track: 91 (1365 sectors/cylinder)
Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: sysid 169 (NetBSD)
start 91, size 3910107 (1909 MB), flag 0x0
beg: cylinder 0, head 1, sector 1
end: cylinder 808, head 14, sector 27
Should we write new partition table? [n] y
fdisk: can't write fdisk partition table: Invalid argument
What the blazes do I need to do to use this friggin' HD with NetBSD?
Surely somebody can give me a clue?
My thoughts:
Next step: blow away NetBSD, install linux instead.
--
-John (John.T...@attglobal.net)
> sd0 at scsibus0 target 0 lun 0: <TANDEM, 4255-1, 5n53> SCSI2 0/direct fixed
> sd0: 1916 MB, 2857 cyl, 15 head, 91 sec, 514 bytes/sect x 3910198 sectors
^^^
Unless it's a typo, I think this is the problem. You need to reformat the
disk with 512 byte sectors.
The Adaptec BIOS may let you do this. NetBSD-current (and possibly 1.6, I
don't remember) allow you to specify a block size argument to scsictl when
formatting drives. 1.5 doesn't.
Andrew
> What I've gleaned so far suggests that fdisk and disklabel are used for
> this purpose, but they've defied my attempts to use them and the man pages
> are not much help. Here's fdisk:
>
> # fdisk -i sd0
Actually, you don't need fdisk unless you want to boot from this disk.
If you're only making it your second disk, you can usually skip that.
If you think you might want to boot from this disk later, and you want
to set it up right from the start, try "fdisk -aiu".
> # disklabel -i sd0
> disklabel: can't read master boot record: Invalid argument
You need "-I" in there, to write a brand new label.
> This suggests to me that the swap space is inside the NetBSD space,
> correct?
Yes. swap is usually partition "b". Logically, you can think of all
the NetBSD partitions as living inside the MBR partition, though in
fact, the MBR is only used by NetBSD to find the disklabel (and also
by the BIOS, to boot, of course). The disklabel doesn't necesarily
have to jibe with the anything in the MBR. In particular, you can add
other MBR partitions to the label, in order to mount say, a primary
DOS partition under NetBSD.
> 8 partitions:
> # size offset fstype [fsize bsize cpg/sgs]
> a: 434555 55 4.2BSD 1024 8192 16 # (Cyl. 0*- 877)
> b: 65340 434610 swap # (Cyl. 878 - 1009)
> c: 499895 55 unused 0 0 # (Cyl. 0*- 1009)
> d: 499950 0 unused 0 0 # (Cyl. 0 - 1009)
>
> This suggests that the NetBSD space has "8 partitions" but for the life of
> me I can only see 4 here. Offset suggests that the first cylinder be left
> alone, presumable for the boot record and partition table. Lets try it on
> the SCSI drive:
Well, you can change that number to 4, with "disklabel -e", if it
bothers you. It doesn't really matter. If you decide to add any
partitions higher than "h", though, change that number to 16. You
can't go any higher than "p" (16), in any case.
I think you're likely to get the best results, by the way, by setting
the 2gb drive up with swap and one BSD partition for "/usr", while leaving
the 250mb as "/".
--
Frederick
> I think you're likely to get the best results, by the way, by setting
> the 2gb drive up with swap and one BSD partition for "/usr", while leaving
> the 250mb as "/".
Thanks; it's working now. I'm copying /usr to the new drive, will edit
fstab to reflect the changes and remount /usr.
--
-John (John.T...@attglobal.net)
Damn. I spoke too soon. When I rebooted, all my changes vanished and the
SCSI HD is just as inaccessible as before. And since this box normally
runs headless, I had to find a monitor so I could read the boot messages.
Once again, the drive has no label:
scsibus0: waiting 2 seconds for devices to settle...
aic0: unrecognized MESSAGE EXTENDED; sending REJECT
sd0 at scsibus0 target 0 lun 0: <TANDEM, 4255-1, 5n53> SCSI2 0/direct fixed
sd0: 1916 MB, 2857 cyl, 15 head, 91 sec, 514 bytes/sect x 3910198 sectors
st0 at scsibus0 target 3 lun 0: <SANKYO, CP1000, 7_30> SCSI2 1/sequential removable
st0: drive empty
cd0 at scsibus0 target 6 lun 0: <IBM, CDRM00203\134000\134000\134000\134000\134000!K, 8B06> SCSI2 5/cdrom removable
sd0: no disk label
And the partitions I made have disappeared:
# disklabel -i sd0
disklabel: can't read master boot record: Invalid argument
partition> P
8 partitions:
# size offset fstype [fsize bsize cpg/sgs]
c: 3910198 91 unused 0 0 # (Cyl. 0*- 2864*)
d: 3910198 0 unused 0 0 # (Cyl. 0 - 2864*)
h: 3910198 91 unused 0 0 # (Cyl. 0*- 2864*)
And once again it is refusing to write any changes to the drive:
partition> P
8 partitions:
# size offset fstype [fsize bsize cpg/sgs]
c: 408006 91 swap # (Cyl. 0*- 298*)
d: 3468052 408135 4.2BSD 0 0 0 # (Cyl. 299 - 2839*)
partition> W
Label disk [n]? y
disklabel: warning, boot block size % sector-size != 0
disklabel: warning, super block size % sector-size != 0
disklabel: warning, partition h: size 0, but offset 3876600
disklabel: ioctl DIOCWDINFO: Label magic number or checksum is wrong!
(disklabel or kernel is out of date?)
Label not written
newfs won't format:
# newfs -O -S 512 sd0d
write error: 3910197
wtfs: Invalid argument
Fdisk refuses to write the requistite magic number:
Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: sysid 169 (NetBSD)
start 1, size 3910197 (1909 MB), flag 0x0
beg: cylinder 0, head 0, sector 2
end: cylinder 808, head 14, sector 27
Should we write new partition table? [n] y
fdisk: can't write fdisk partition table: Invalid argument
Y'know, this is not the most intuitive process, and at least I'm somewhat
familiar with Unix-like systems, having run linux for several years now.
--
-John (John.T...@attglobal.net)
^^^
Again: you need to *low-level* format the drive with 512 byte sectors.
Andrew
Oh, my. I thought that *had* to be a typo, but after seeing it twice, I guess not.
--
Frederick
Don't newfs the whole drive -- use "/dev/rsd0h".
> Fdisk refuses to write the requistite magic number:
>
> Partition table:
> 0: <UNUSED>
> 1: <UNUSED>
> 2: <UNUSED>
> 3: sysid 169 (NetBSD)
> start 1, size 3910197 (1909 MB), flag 0x0
> beg: cylinder 0, head 0, sector 2
> end: cylinder 808, head 14, sector 27
> Should we write new partition table? [n] y
> fdisk: can't write fdisk partition table: Invalid argument
That looks strange, starting at "sector 2". Try the low-level format first,
as Andrew Doran suggests.
> Y'know, this is not the most intuitive process, and at least I'm somewhat
> familiar with Unix-like systems, having run linux for several years now.
The main difference (as far as setting up drives goes) is that all the
partitions are set in the disklabel, rather than imputed from the MBR.
This turns out to be more flexible, though it's main reason for being
was actually that other NetBSD platforms don't have MBR's (and I think
i386 wasn't even the first NetBSD port).
--
Frederick
>> sd0 at scsibus0 target 0 lun 0: <TANDEM, 4255-1, 5n53> SCSI2 0/direct fixed
>> sd0: 1916 MB, 2857 cyl, 15 head, 91 sec, 514 bytes/sect x 3910198 sectors
> Again: you need to *low-level* format the drive with 512 byte sectors.
OK. I tried "newfs -S 512 /dev/sd0c" and it chugged away for a half hour
or so and came back without complaint. I was then able to mount and use
the filesystem, but the disklabel, partitions and everything else vanished
again after a reboot.
Now I'm doing "scsictl sd0 format" and have left it running. I didn't
see any option to select sector size with scsictl, though. It's been going
for 3.5hrs so far. I suppose I can let it go for a few days if that's
what it takes.
Thanks...
--
-John (John.T...@attglobal.net)
> Now I'm doing "scsictl sd0 format" and have left it running. I didn't
> see any option to select sector size with scsictl, though. It's been going
> for 3.5hrs so far.
48 hours later, I'm not sure anything has been accomplished. "ps" still
shows "scsictl sd0 format"
I know low-level formats take a while, but 48+ hours still seems
excessive. Suspecting that scsictl isn't really doing anything, I shut
down, reboot and discover that sd0 still reports 514-byte sectors:
sd0 at scsibus0 target 0 lun 0: <TANDEM, 4255-1, 5n53> SCSI2 0/direct fixed
sd0: 1916 MB, 2857 cyl, 15 head, 91 sec, 514 bytes/sect x 3910198 sectors
Does scsictl have a method of explicitly defining sector size?
Alternatively, is there a NetBSD analog to the FreeBSD "camcontrol"
utility that allows one to specify sector size when low-level formatting a
scsi device?
--
-John (John.T...@attglobal.net)
> I know low-level formats take a while, but 48+ hours still seems
> excessive. Suspecting that scsictl isn't really doing anything, I shut
> down, reboot and discover that sd0 still reports 514-byte sectors:
>
> sd0 at scsibus0 target 0 lun 0: <TANDEM, 4255-1, 5n53> SCSI2 0/direct fixed
> sd0: 1916 MB, 2857 cyl, 15 head, 91 sec, 514 bytes/sect x 3910198 sectors
>
> Does scsictl have a method of explicitly defining sector size?
The scsictl from NetBSD-current (but not any release version) has this
capability. I've built a statically linked version and put it here if you
want to try it:
http://www.interlude.eu.org/~ad/scsictl.gz
Here's the relevant bit from the updated manual page:
format [blocksize [immediate]]
(Low level) format the named device. If the optional blocksize parameter
is provided, the device geometry will be modified to use the specified
blocksize. If this parameter is different form the Current or Default
Mode Page 3 parameters, the device will update Mode Page 3 at the suc-
cessful completion of the Format. Device geometry may change as a result
of using a new device blocksize. When the optional blocksize parameter
is specified, the Defect List on the drive will revert to the original
primary defect list created at the time of manufacture if available. The
drive will usually recertify itself during the Format and add any other
defective blocks to the new Defect List. Some disks may not support the
ability to change the blocksize and may enter a Degraded Mode when fed a
Format command of this type. If this happens the standard recovery for
the drive requires issuing a correct Format command, i.e. one without the
blocksize parameter.
When the immediate parameter is also specified, the disk is instructed to
return from the format command right away. It continues to format, and
every ten seconds scsictl issues a TEST UNIT READY command to check the
associated sense data. This associated sense data has a progress indica-
tor which indicates how far the format is progressing. Note well that
most SCSI disk drives prior to a few years ago do not support this op-
tion.
> On Sat, 14 Sep 2002 14:17:44 GMT, John Thompson <jo...@starfleet.thompson.us> wrote:
>
>> I know low-level formats take a while, but 48+ hours still seems
>> excessive. Suspecting that scsictl isn't really doing anything, I shut
>> down, reboot and discover that sd0 still reports 514-byte sectors:
>>
>> sd0 at scsibus0 target 0 lun 0: <TANDEM, 4255-1, 5n53> SCSI2 0/direct fixed
>> sd0: 1916 MB, 2857 cyl, 15 head, 91 sec, 514 bytes/sect x 3910198 sectors
>>
>> Does scsictl have a method of explicitly defining sector size?
>
> The scsictl from NetBSD-current (but not any release version) has this
> capability. I've built a statically linked version and put it here if you
> want to try it:
>
> http://www.interlude.eu.org/~ad/scsictl.gz
Thanks. I'll give that a try.
--
-John (John.T...@attglobal.net)