:: Re: [DNG] [OT] Help on change (spli…
Top Page
Delete this message
Reply to this message
Author: Hector Gonzalez Jaime
Date:  
To: dng
Subject: Re: [DNG] [OT] Help on change (split) partitions of an md raid

On 6/27/23 11:51, Antony Stone wrote:
> On Tuesday 27 June 2023 at 19:34:25, al3xu5 via Dng wrote:
>
>> Hi all
>>
>> I know I am OT (again), but I need help and hope you will excuse me...
>>
>> I have two identical disk, each with two partitions of the same size, with
>> no unpartitioned space left:
>>
>> DISK1: Disk1Part1 + Disk1Part2
>> DISK2: Disk2Part1 + Disk2Part2
>>
>> I have a md RAID1 (mirror) on those disks:
>>
>> md1: Disk1Part1 + Disk2Part1
>> md2: Disk1Part2 + Disk2Part2
>>
>> Now I need to split each of the 2nd partitions in two smaller partitions,
>> so as to obtain:
>>
>> DISK1: Disk1Part1 + Disk1Part2 + Disk1Part3
>> DISK2: Disk2Part1 + Disk2Part2 + Disk2Part3
>>
>> and:
>>
>> md1: Disk1Part1 + Disk2Part1
>> md2: Disk1Part2 + Disk2Part2
>> md3: Disk1Part3 + Disk2Part3
>>
>> Please can you suggest the best and safe way (correct procedure, commands,
>> tools to use etc.) to do this (obviously, I have a backup of all the data)?

0.  Verify your backup really has all your data and can be restored, as
these steps will destroy md2 and all its data.  You will have to restore
after this.
> 1. Unmount anything which is using /dev/md2
>
> 2. mdadm --stop /dev/md2
>
> 3. Use fdisk, sfdisk, parted or whatever your preferred tool of choice is, to
> delete /dev/sda2 and /dev/sdb2 (I'm guessing at your device names here)
>
> 4. Create /dev/sda2 / sda3 and /dev/sdb2 / sdb3 with whatever sizes you
> require
>
> 5. mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
>
> 6. Same as above for md3 / sda3 / sdb3
>
> 7. Use /usr/share/mdadm/mkconf to re-create /etc/mdadm/mdadm.conf
>
> 8. Use "update-initramfs -u -k all" to re-create your initramfs with knowledge
> of the new arrays
>
> 9. Format /dev/md2 and /dev/md3 and mount as you wish...
>
>
> I would expect steps 4, 5 and 6 to show some warnings about the partitions
> containing raid signatures. Confirm that you want to delete them.
>
>
> Antony.
>

--
Hector Gonzalez
cacho@???