2

Hello i have a failed driver in a raid so i had to replace it with a new hard disk. The problem is that although both hard disk are Seagate 1TB they differ slightly in size

# sfdisk -s
/dev/sda: 976762584
/dev/sdb: 976761527

and when i try to use sfdisk to copy the partition table i get:

# sfdisk -d /dev/sda | sfdisk /dev/sdb
Checking that no-one is using this disk right now ...
OK

Disk /dev/sdb: 121601 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/sdb: unrecognized partition table type
Old situation:
No partitions found
Warning: given size (15718400) exceeds max allowable size (15717743)

sfdisk: bad input

I searched google but didn't find a complete solution.

Any insight on how can i make it to work is appreciated

Debrian
  • 154
  • 2
  • 12
  • Whoever built that RAID array in the first place needs a smacking. Why would any sane person create a 2.00041 TB array, thus requiring a 1.0002 TB drive?! I guess you can get a 1.5TB replacement. – David Schwartz Jul 31 '13 at 11:13
  • /dev/sda1 actualy has 2 partitions like this:/dev/sda1 * 2048 1937805311 968901632 fd Linux raid autodetect /dev/sda2 1937805312 1953523711 7859200 fd Linux raid autodetect i was hoping i could make the swap partition smaller. – Debrian Jul 31 '13 at 12:04

1 Answers1

2

You can't. Either you'll have to get a disk that's at least as large as the other one or you'll have to resize the RAID, which is a somewhat involved process.

What I would do is to just start over, create a new RAID with one missing disk on the new, smaller drive, copy the data over and then add the old drive to that array.

Of course, make sure you have a backup first.

Sven
  • 98,649
  • 14
  • 180
  • 226