I’ve 2 disk 1T.
I partitioned the disk in this way:
x is letter of your disk (check it with command fdisk -l)
fdisk /dev/sdx
This is a sequence of command in fdisk
n
p
1
+500G
t
8e
… ecc … and in this way i created 3 partition primary and 3 partition in the extended area
500G 256G 124G 64G 32G 32G
Now i must clone the partition table in the second disk
sfdisk -d /dev/sdx | sfdisk /dev/sdy
I crete the device raid md0
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdx /dev/sdy
add the md0 in phisical lvm
pvcreate /dev/md0
group lvm
vgcreate backup-raid /dev/md0
logical volume
lvcreate -L+500G -n backupRaid backup-raid
format the new raid area
mkfs.ext4 -j /dev/backup-raid/backupRaid
Configure mdadm.conf
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
Create a mount point
mkdir /media/backup
and modify /etc/fstab
/dev/mapper/backup--raid-backup--raid /media/backup ext4 rw 0 0
and now…
reboot for check if all this ok
Troubleshiting