Answer the question
In order to leave comments, you need to log in
Is it possible to restore the partition table?
Today on one of the servers hetzner replaced one of the disks in the raid. I connected through the recovery system and when it became necessary to synchronize the old disk with the new one, when transferring the partition table, I mixed up the names of the old and new disks in the command
sgdisk -R /dev/sda /dev/sdb
. Can I somehow restore this raid to work?
Answer the question
In order to leave comments, you need to log in
You can try, but it will take a long time gpart -if /dev/sda
A quick option without keys.
If the system is on the fly, partition information is still in memory. Namely, in /sys/block/sd?/sd??/start and /sys/block/sd?/sd??/size. They are in sectors. Start is literally the same as start in the partition table, and size is, well, size, entered as +sectors in fdisk. In general, you can write the partition table again using this information from / sys
In general, I would not have such a problem. It's not about neatness. It's just that partitioning the disk is very standard - if it's an MBR disk, then 2048..+127M is /boot (there is a 1M gap in front of it, as it is understood, because the partition starts in sector 2048), the rest is LVM PV. If this is a GPT disk, then 1M gap, then from sector 2048 to 4095 - 1M - bios_grub, then + 126M - /boot, the rest is LVM PV. If there are two disks, they are all Software RAID arrays.
This standardization is very, very helpful.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question