Port-i386 archive

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

Re: Disk Problems



Hi Robert, you wrote:

 >   | The disk settings are identical except for the BIOS settings
 >   | and the partition alignment and offset parameter. I am and was
 >   | unsure about the consequences of this.
 > 
 > There are no consequences on any modern drive.   If you were using an
 > old (say 512MB or something) drive that didn't support LBA addressing
 > it would matter, but there are probably not many of those still around
 > in a workable state.   Everything from at least the past 10 years
 > (probably much older than that) supports LBA, and for that, all that
 > matters are the block numbers.   The cylinder/head/sector stuff is
 > all just a fiction these days (can you imagine how big a drive would
 > need to be to actually have 63 heads - that is, 63 platters (0r 32, using
 > both sides) not just lots of heads positioned around the drive to
 > lower rotational delays - even then, 63 would be a real feat of engineering.
 > I suppose one could imagine, 4 platters, making 7 usable surfaces, and
 > 9 heads on each surface - that might just be able to be manufactured in
 > a way that makes the drive still be able to be mounted in a standard size 
 > slot,
 > but ...   these days manufacturers mostly don't even tell you what's actually
 > inside the sealed section so very few people would know if there actually
 > was such a thing)
 > 
 > That is, the drive uses block numbers, NetBSD uses block numbers, nothing
 > that you care about is in the slightest bit interested in some fictional
 > conversion to cyl/head/sector values (and these days, it would probably make
 > sense for fdisk to simply hide all tha nonsense for any drive bigger than
 > a GB or so).   Given the ranges of values allowed for cyl, head, and sector
 > (max 1024, 255, and 63) the biggest number of sectors that are possible is
 > 1024*255*63 - ie: 16450560 which is 8422686720 bytes (just under 8GB).
 > Any drive larger than that (eg: your 2TB drives) cannot possibly do anything
 > particularly useful with c/h/s values.
 > 
 > They are kept around just so the drive manufacturers can keep selling
 > drives to all those people (???) still using ancient software that
 > believes c/h/s is the only way to access a disk.

It all sounds reasonable to me. One of my problems was that I
did not know, how NetBSD addresses the disk. Now I do!


 >   | root@asus:/root # fdisk -A 3963/63 -b 1024/63/63 /dev/rwd1d
 > 
 > -A isn't doing anything useful for you (and you wouldn't really want those
 > values anyway, just giving them to make them the same as wd0 isn't really
 > very useful), and you didn't read the fdisk man page carefully enough...
 > 
 >      -b cylinders/heads/sectors
 >              Specify the BIOS geometry parameters for cylinders, heads, and
 >              sectors.  It is used only in conjunction with the -u flag.

I noticed the comments on the -b option. The problem was, I
could not get fdisk to display it's supposed action anyway
other than with the above statement (where it says, what it is
going to do, but does not!).

 > Try
 >      fdisk -u -f -b 1024/63/63 /dev/rwd1d

I did that with no success:

root@asus:/root # fdisk -u -f -b 1024/63/63 /dev/rwd1d
fdisk: Partition data not specified
usage: fdisk [-aBFfIilSuv] [-A ptn_alignment[/ptn_0_offset]] \
             [-b cylinders/heads/sectors] \
             [-0123 | -E num [-s id/start/size[/bootmenu]]] \
             [-t disktab] [-T disktype] \
             [-c bootcode] [-r|-w file] [device]
        -a change active partition
        -f force - not interactive
        -i initialise MBR code
        -I ignore errors about no space or overlapping partitions
        -l list partition types
        -u update partition data
        -v verbose output, -v -v more verbose still
        -B update bootselect options
        -F treat device as a regular file
        -S output as shell defines
        -r and -w access 'file' for non-destructive testing
root@asus:/root # 

 > or, to be more cautious, just
 >      fdisk -u wd1
 > and say 'y' when it asks
 >      Do you want to change our idea of what BIOS thinks? [n]
 > and then when prompted, give the values you want, and then eventually
 > allow fdisk to write it all back.

I tried that one too:

root@asus:/root # fdisk -u /dev/rwd1d
Disk: /dev/rwd1d
NetBSD disklabel disk geometry:
cylinders: 3876021, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 3907029168

BIOS disk geometry:
cylinders: 1024, heads: 18, sectors/track: 63 (1134 sectors/cylinder)
total sectors: 3907029168

Partitions aligned to 1134 sector boundaries, offset 63

Do you want to change our idea of what BIOS thinks? [n] y

Geometries of known disks:
Disk 0: cylinders 1024, heads 63, sectors 63 (3907029168 sectors, 1907729MB)
Disk 1: cylinders 1024, heads 18, sectors 63 (3907029168 sectors, 1907729MB)

BIOS's idea of #cylinders: [0..1024 default: 1024] 
BIOS's idea of #heads: [0..256 default: 18] 63
BIOS's idea of #sectors: [1..63 default: 63] 63
Disk: /dev/rwd1d
NetBSD disklabel disk geometry:
cylinders: 3876021, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 3907029168

BIOS disk geometry:
cylinders: 1024, heads: 63, sectors/track: 63 (3969 sectors/cylinder)
total sectors: 3907029168

Partitions aligned to 1134 sector boundaries, offset 63

Are you happy with this choice? [n] y

Partition table:
0: NetBSD (sysid 169)
    start 2048, size 3907027120 (1907728 MB, Cyls 0/32/33-984386/17/63), Active
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector enabled, timeout 20 seconds.
First active partition: 0
Which partition do you want to change?: [none] 

We haven't written the MBR back to disk yet.  This is your last chance.
Partition table:
0: NetBSD (sysid 169)
    start 2048, size 3907027120 (1907728 MB, Cyls 0/32/33-984386/17/63), Active
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector enabled, timeout 20 seconds.
First active partition: 0
Should we write new partition table? [n] y
root@asus:/root # 


gives the unexpected result:

root@asus:/root # fdisk /dev/rwd1d
Disk: /dev/rwd1d
NetBSD disklabel disk geometry:
cylinders: 3876021, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 3907029168

BIOS disk geometry:
cylinders: 1024, heads: 18, sectors/track: 63 (1134 sectors/cylinder)
total sectors: 3907029168

Partitions aligned to 1134 sector boundaries, offset 63

Partition table:
0: NetBSD (sysid 169)
    start 2048, size 3907027120 (1907728 MB, Cyls 1/14/33-3445351), Active
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector enabled, timeout 20 seconds.
First active partition: 0
root@asus:/root # 

It seems that fdisk will not do what I command!

I don't know if some part of (the beginning of) the disk
is write protected? That seemed to be the initial problem:
When I somehow had my raid partition defined too close to
the start of the disk, it was impossible to write data to
wd1 but not to wd0.

For peace of mind I still would like the disks to be
identically configured, but you have me almost convinced
it is not necessary.

Best regards
  Ib-Michael
-- 
Email: i.m.martinsen(at)gmail.com
Running NetBSD/i386 v6.1.4

Listen to my music on http://www.soundcloud.com/indiamikemike
or http://www.soundclick.com/indiamikemike

      The ASCII Ribbon Campaign
()     No HTML/RTF in email
/\     No Word docs in email
      Respect for open standards


Home | Main Index | Thread Index | Old Index