[CentOS] Disk geometry problem.

Mon May 28 11:23:42 UTC 2012
Rafał Radecki <radecki.rafal at gmail.com>

Hi all.

I have a CentOS server:
CentOS release 5.7 (Final)
2.6.18-274.3.1.el5 x86_64

I have two SSD disks attached:
smartctl -i /dev/sdc
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce
Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model:     INTEL SSDSA2CW120G3
Serial Number:    CVPR13010957120LGN
Firmware Version: 4PC10362
User Capacity:    120,034,123,776 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Mon May 28 13:12:18 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

smartctl -i /dev/sdd
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce
Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model:     INTEL SSDSA2CW120G3
Serial Number:    CVPR126101YK120LGN
Firmware Version: 4PC10362
User Capacity:    120,034,123,776 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Mon May 28 13:12:35 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

fdisk shows:
fdisk -l /dev/sdc

Disk /dev/sdc: 120.0 GB, 120034123776 bytes
32 heads, 32 sectors/track, 228946 cylinders
Units = cylinders of 1024 * 512 = 524288 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               3         491      250368   83  Linux
/dev/sdc2             492      228946   116968960   fd  Linux raid
autodetect

fdisk -l /dev/sdd

Disk /dev/sdd: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

hdparm shows:
hdparm -I /dev/sdc > ~/tmp/hdparm_sdc (file attached)
hdparm -I /dev/sdd > ~/tmp/hdparm_sdd (file attached)

diff hdparm_sd[cd]
2c2
< /dev/sdc:
---
> /dev/sdd:
6c6
<       Serial Number:      CVPR13010957120LGN
---
>       Serial Number:      CVPR126101YK120LGN
85c85
< Logical Unit WWN Device Identifier: 5001517959613b9f
---
> Logical Unit WWN Device Identifier: 50015179595b6a83
88c88
<       Unique ID       : 959613b9f
---
>       Unique ID       : 9595b6a83

hdparm -g /dev/sdc /dev/sdd

/dev/sdc:
 geometry      = 14593/255/63, sectors = 234441648, start = 0

/dev/sdd:
 geometry      = 14593/255/63, sectors = 234441648, start = 0

sfdisk shows:

sfdisk -g /dev/sdc;sfdisk -G /dev/sdc
/dev/sdc: 14593 cylinders, 255 heads, 63 sectors/track
!!!! /dev/sdc: 228946 cylinders, 32 heads, 32 sectors/track !!!!

sfdisk -g /dev/sdd;sfdisk -G /dev/sdd
/dev/sdd: 14593 cylinders, 255 heads, 63 sectors/track
/dev/sdd: 14593 cylinders, 255 heads, 63 sectors/track

I have /dev/sdc{1,2} mounted and used by /dev/md0, /dev/md1 RAID1. I
would like to add /dev/sdd{1,2} to these RAID's but sfdisk has problems
when I try to make partitions on /dev/sdd.

sfdisk -d /dev/sdc | sfdisk /dev/sdd
Checking that no-one is using this disk right now ...
OK

Disk /dev/sdd: 14593 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdd1          0       -       0          0    0  Empty
/dev/sdd2          0       -       0          0    0  Empty
/dev/sdd3          0       -       0          0    0  Empty
/dev/sdd4          0       -       0          0    0  Empty
Warning: given size (233937920) exceeds max allowable size (233933761)

sfdisk: bad input

As I see in fdisk's and sfdisk output there is a difference at some level
in disk geometry. Could you suggest a solution?

Best regards,
Rafal.