K
K
KPOBABAK2019-07-14 11:51:24
linux
KPOBABAK, 2019-07-14 11:51:24

Cancel sgdisk command action on debian?

Good afternoon! Linux experts need help!
Wanted to replace a failed drive in raid1 with a debian
sdc - the new
sdd drive is working.
I hurried up and executed the command sgdisk -R /dev/sdd /dev/sdc instead of sgdisk -R /dev/sdc /dev/sdd
i.e. as I understand it, I wrote the markup from an empty disk to a working one ...
and after rebooting everything will be fine.
How to undo this command. or write back the markup that is currently used in the kernel?
so long as it works...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KPOBABAK, 2019-07-19
@KPOBABAK

(I will add that the host is very remote and there is no physical access to it)
In general, I had the following solution ...
Since I could see the current RAID 1 configuration
sdd 8:48 0 2.7T 0 disk
├─sdd1 8:49 0 512M 0 part
└─md0 9:0 0 511.4M 0 raid1 /boot
├─sdd2 8:50 0 100G 0 part
└─md1 9:1 0 100G 0 raid1
├─vg0-root 253:0 0 15G 0 lvm /
└─vg0 -swap 253:4 0 6G 0 lvm [SWAP]
├─sdd3 8:51 0 1M 0 part
├─sdd4 8:52 0 2T 0 part
└─md126 9:126 0 2T 0 raid1
├─vg_hdd-data 253:2 0 200G 0 lvm /mnt/data
└─vg_hdd-data2 253:3 0 1000G 0 lvm /mnt/
data2 linux RAID and partition 1M analogue of sdd3 made with bios boot type on a new disk. I added what I needed to raid 1. Then I installed the grub bootloader on a new disk (for this, apparently, a 1M partition is needed on the old disk).
After synchronization, I rebooted the system and everything started successfully from the new sdc disk. The second disk flew out of the array, and I already copied the sdc partition structure back with the correct command, installed the bootloader and re-added the necessary one to raid 1.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question