Got the following scenario in a two-disk RAID1 (mdadm) Debian-based server (no LVM involved):
Partitions (same for mirror /dev/sdb):
- Unassigned space (formerly /dev/sda1 with Windows).
- /dev/sda2 linux-raid /dev/md0 (/)
- /dev/sda3 extended:
- /dev/sda5 linux-raid /dev/md1 (swap)
- /dev/sda6 linux-raid /dev/md2 (/home)
- /dev/sda7 linux-raid /dev/md3 (/usr/local/share/data)
Ideally, for the sake of disk space, I would like to achieve:
- /dev/sda1 linux-raid /dev/md0 (/).
- /dev/sda2 linux-raid /dev/md1 (/home)
- /dev/sda3 extended:
- /dev/sda5 linux-raid /dev/md2 (swap)
- /dev/sda6 linux-raid /dev/md3 (/usr/local/share/data)
Following a (at first sight) simpler approach I'm also willing to try:
- /dev/sda1 linux-raid /dev/md0 (/) (hoping mdadm --grow /dev/md0 --size=max command will be able to auto-take care of occupying the unused space before)
- /dev/sda3 extended:
- /dev/sda5 linux-raid /dev/md1 (swap)
- /dev/sda6 linux-raid /dev/md2 (/home)
- /dev/sda7 linux-raid /dev/md3 (/usr/local/share/data)
All of which I assume it has to be done offline (i.e. by means of a live distro).
What I'm not sure (regarding the first approach) is whether I have firstly to fully dismiss the RAID1 array and then to hard-copy the partitions one by one, then re-create the RAID1 or there is another simpler approach.
I would like to know your experience / suggestions regarding both / other approaches.