# Second disc has three cylinders less than the first - gmirror problem



## vicf (Oct 18, 2010)

I got 2 disks in this box and system says the second disk on sata1 port has 3 cylinders less than first disk on sata0 port, but the disks are the same model.

System is 8.1-RELEASE with GENERIC kernel
Motherboard INTEL D945GCL

```
atapci0: Intel ICH7 UDMA100 controller
atapci1: Intel ICH7 SATA300 controller
```

Disks:

```
ad4: 476940MB <WDC WD5000AAKS-00V1A0 05.01D05> at ata2-master UDMA100 SATA
ad6: 476938MB <WDC WD5000AAKS-00V1A0 05.01D05> at ata3-master UDMA100 SATA
```

In dmesg, I got this message after "GEOM_MIRROR: Device mirror/gm0 launched (1/1).":


```
GEOM: mirror/gm0s1: geometry does not match label (16h,63s != 255h,63s).
```

fdisk /dev/ad4:


```
parameters extracted from in-core disklabel are:
cylinders=969021 heads=16 sectors/track=63 (1008 blks/cyl)

The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 976769073 (476938 Meg), flag 80 (active)
	beg: cyl 0/ head 1/ sector 1;
	end: cyl 1023/ head 15/ sector 63
```


fdisk /dev/ad6:

p
	
	



```
arameters extracted from in-core disklabel are:
cylinders=969018 heads=16 sectors/track=63 (1008 blks/cyl)

The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 976770081 (476938 Meg), flag 80 (active)
	beg: cyl 0/ head 1/ sector 1;
	end: cyl 313/ head 15/ sector 63
```

The problem is I'm trying to do gmirror the whole disk like handbook, but I got the "gmirror: Provider ad6 too small". I tried other 2 Samsumg disks (same model too) but FreeBSD got the second disk 3 cylinders less too.

I tried set geometry in fdisk, but no luck. It seems the fdisk can't save new geomatry value and show a "class not found" message. So I got 2 questions:

1. Any ideas why this happen and how to solve? 

2. And there is some problem make a mirror in a partition (ad4s1) instead the whole disk (ad4)?


----------



## phoenix (Oct 18, 2010)

Create a single slice on each drive, make it the same size on each drive.

Then gmirror the slice, instead of the drives.  Use ad4s1 and ad6s1 for the gmirror.


----------



## aragon (Oct 18, 2010)

You could also build your gmirror with ad6 initially, then insert ad4 after.  A slice is better IMHO, and it's what I do too.


----------



## vicf (Oct 19, 2010)

I think I will do gmirror the slice. But the "always 3 cylinders less" is really annoying. Thanks for all the answers.


----------

