Subject: Re: Huge (> 1TB) disk
To: None <yutaka@mailhost.net>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-users
Date: 05/15/2002 10:39:44
On Wed, May 15, 2002 at 12:45:53PM +0900, yutaka@mailhost.net wrote:
> 
> 
> Manual,
> 
> I tried your version of disklabel command and the result follows;
> 
> 
> ... information aboutn the huge disk ...
> $ /sbin/dmesg | grep sd1
> sd1 at scsibus1 target 0 lun 0: <Indy 240, 0, 0001> SCSI3 0/direct
> fixed
> sd1: 1144 GB, 146553 cyl, 128 head, 128 sec, 512 bytes/sect x
> -1893842944 sectors

OK, this is a bug in the kernel, but only affects the display

> sd1: no disk label
> sd1: no disk label
> $ 
> 
> 
> ... output of NetBSD-1.5.2's /sbin/disklabel ...
> log01# /sbin/disklabel sd1
> # /dev/rsd1d:
> type: SCSI
> disk: 0
> label: fictitious
> flags:
> bytes/sector: 512
> sectors/track: 128
> tracks/cylinder: 128
> sectors/cylinder: 16384
> cylinders: 146553
> total sectors: -1893842944
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0           # microseconds
> track-to-track seek: 0  # microseconds
> drivedata: 0 
> 
> 4 partitions:
> #        size   offset     fstype   [fsize bsize cpg/sgs]
>   d: -1893842944        0     unused        0     0         # (Cyl.
> 0 - 146552)
> disklabel: boot block size 0
> disklabel: super block size 0
> log01# 
> 
> ... output of Manuel's version of disklabel ...
> log01# /home/yk/disklabel sd1
> # /dev/rsd1d:
> type: SCSI
> disk: 0
> label: fictitious
> flags:
> bytes/sector: 512
> sectors/track: 128
> tracks/cylinder: 128
> sectors/cylinder: 16384
> cylinders: 146553
> total sectors: 2401124352
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0           # microseconds
> track-to-track seek: 0  # microseconds
> drivedata: 0 
> 
> 4 partitions:
> #        size   offset     fstype   [fsize bsize cpg/sgs]
>   d: -1893842944        0     unused        0     0         # (Cyl.
> 0 - 146552)
> disklabel: boot block size 0
> disklabel: super block size 0
> log01# 
> 
> 
> I am following the procedure shown in The NetBSD Guide Appendix B.
> 
> log01# dd if=/dev/zero of=/dev/rsd1d bs=1m count=1
> 1+0 records in
> 1+0 records out
> 1048576 bytes transferred in 1 secs (1048576 bytes/sec)
> log01# /home/yk/disklabel -I -i sd1
> partition> I
> # Current values:
> # /dev/rsd1d:
> type: SCSI
> disk: 0
> label: fictitious
> flags:
> bytes/sector: 512
> sectors/track: 128
> tracks/cylinder: 128
> sectors/cylinder: 16384
> cylinders: 146553
> total sectors: 2401124352
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0           # microseconds
> track-to-track seek: 0  # microseconds
> drivedata: 0 
> 
> Disk type [?] [SCSI]: 
> Disk name [0]: 
> Label name [fictitious]: yutaka
> Number of partitions [4]: 8
> Sector size (bytes) [512]: 
> Number of sectors per track [128]: 
> Number of tracks per cylinder [128]: 
> Number of sectors/cylinder [16384]: 
> Total number of cylinders [146553]: 
> Total number of sectors [2401124352]: 
> Hardware sectors interleave [1]: 
> Sector 0 skew, per track [0]: 
> Sector 0 skew, per cylinder [0]: 
> Head switch time (usec) [0]: 
> Track seek time (usec) [0]: 
> partition> d
> Filesystem type [?] [unused]: 
> Start offset [0c, 0s, 0M]: 0s
> Partition size ('$' for all remaining) [146553c, 2401124352s,
> 1.17242e+06M]: $
> partition> c
> Filesystem type [?] [unused]: 
> Start offset [0c, 0s, 0M]: 0s
> Partition size ('$' for all remaining) [0c, 0s, 0M]: $
> partition> a
> Filesystem type [?] [unused]: 4.2BSD
> Start offset [0c, 0s, 0M]: 0s
> Partition size ('$' for all remaining) [0c, 0s, 0M]: $
> partition> P
> 8 partitions:
> #        size   offset     fstype   [fsize bsize cpg/sgs]
>   a: -1893842944        0     4.2BSD        0     0     0   # (Cyl.
> 0 - 146552)
>   c: -1893842944        0     unused        0     0         # (Cyl.
> 0 - 146552)
>   d: -1893842944        0     unused        0     0         # (Cyl.
> 0 - 146552)
> partition> W
> Label disk [n]? y
> Label written
> partition> Q
> log01# newfs -m 5 -b 8192 -f 1024 -i 32768 /dev/rsd1a
> preposterous size -1893842944
> log01# 
> 
> 
> For me, it seems your fix is half way done. I am not sure if you are
> the one who is commiting the NetBSD code but hope your effort gives
> peopole to user over 1TB disk with NetBSD.

Yes, there are still some display bugs left in disklabel; I'll look at this.
However, as already said, you can't have a filesystem larger than 1T,
so you have to make your partition a bit smaller to make it work.

> 
> And it is sorry to say but I will tring on other OS for now. Not just
> because of this issue but I found Ultra 160 SCSI is not functioning as
> 160MB/s.

What controller do you have ?

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--