Re: Replace disks

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

 



On 27/03/18 10:47, Mateusz Korniak wrote:
> On Tuesday 27 of March 2018 10:51:06 Gandalf Corvotempesta wrote:
>> I have to replace all disks (one per time, or, if possible, all at the
>> same time), by
>> adding new disks in spare slots (I have 3 free slots in this server).
>> I know that mdadm is able to replace a disks without bringing offline
>> the previous one, thus without affecting the redundancy. This is what
>> I would like to do.
>> Any suggestions ?
> 
> I do replacing S with D like that:
> 
> Copy partition table:
> 
> sfdisk -d /dev/sdS | sfdisk -L /dev/sdD

I think you're missing a major point. It sounds to me like the new
drives are larger than the old ones, so no he does not want to copy the
partition table. And does sfdisk update the partition UUIDs as it copies
them?

No, I'm guessing the disks have just one partition, so do the same with
the new disks.
> 
> Add new disk as spare:
> 
> mdadm /dev/mdX --add /dev/sdDX
> 
> For each partition start moving data to new disk:
> 
> mdadm /dev/mdX --replace /dev/sdSX   
> 
I believe you can do these two at the same time, ie

mdadm /dev/mdX --add /dev/sdDX --replace /dev/sdDX --with /dev/sdSX

> Watch progress:
> 
> watch cat /proc/mdstat
> 
> When done, move next disk.

Very much agreed, although if he can add several new drives physically,
I also believe you can replace them at the same time

mdadm /dev/mdX --add /dev/sdDX /dev/sdEX --replace /dev/sdSX /dev/sdTX
 --with /dev/sdDX /dev/sdEX

https://raid.wiki.kernel.org/index.php/Replacing_a_failed_drive

> 
>> The final configuration should be an increased raid/filesystem,
>> growing from the current 500GB to a 2TB
> 
> I grow FS on LVM level with online expandable FSs like ext4.
> 
> 
Which you can't do just yet ... the new array will be the exact same
size as the old one, with a large chunk of unused disk space. LVM will
see that the array hasn't grown and will barf if you try and increase
the file-system size.

mdadm --grow /dev/mdX --size=max

https://raid.wiki.kernel.org/index.php/A_guide_to_mdadm#Growing_an_array

Cheers,
Wol
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux