I have two hdds of 4TB each on CentOS 7. I need to copy partitions of one to the other so that I can use the second to take periodic backups from the first. Tried sgdisk using -R option but it did not help, while parted
was able to read correctly the information. The output is as follows:
# parted -ml | sed 's/^/ /'
BYT;
/dev/sda:4001GB:scsi:512:4096:gpt:ATA WDC WD40EFRX-68W:;
1:1049kB:53.5MB:52.4MB:fat16:EFI System Partition:boot;
2:53.5MB:263MB:210MB:xfs::;
3:263MB:537GB:537GB:xfs::;
4:537GB:554GB:17.2GB:linux-swap(v1)::;
5:554GB:4001GB:3446GB:xfs::;
BYT;
/dev/sdb:4001GB:scsi:512:4096:gpt:ATA WDC WD40EFRX-68W:;
1:1049kB:53.5MB:52.4MB:fat16:EFI System Partition:boot;
2:53.5MB:263MB:210MB:xfs::;
3:263MB:525GB:524GB:xfs::;
4:525GB:541GB:16.8GB:::;
5:541GB:4001GB:3459GB:::;
#
Keeping in view of having to mount them together, how could the partitions be cloned?
Edit: I was able to accomplish by using the following as mentioned elsewhere:
sgdisk --backup=table /dev/sda
sgdisk --load-backup=table /dev/sdb
sgdisk -G /dev/sdb
But I am not sure if it is still safe to reboot. Help please!