:: Re: [DNG] [OT] Help on change (spli…
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Antony Stone
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [DNG] [OT] Help on change (split) partitions of an md raid
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)?


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.

--
1960s: Let's build a network which can withstand a nuclear war!
1970s: Hm, that looks good, we'll run it on TCP/IPv4.
1980s: Nice, how about letting everyone join?
1990s: Hey, you can make money out of this!
2000s: Oh, you can lose it, too.
2010s: Alright, let's just plug absolutely everything into it.
2020s: Meh, my lightswitch is now connected to my lamp via China.

                                                   Please reply to the list;
                                                         please *don't* CC me.