HELP!!! CENTOS 7 BOOT Recovery

General support questions
Post Reply
kdavid
Posts: 5
Joined: 2010/03/12 12:06:03

HELP!!! CENTOS 7 BOOT Recovery

Post by kdavid » 2020/02/13 17:19:51

Hi Guys,

I need some urgent help on a matter. Another administrator was working on the VM( Both Centos) So i took over and accidentally cleared the wrong VM while running some partition deletion and creation. Upon trying to retore the checkpoint , i then realize the Virutal Machine Test, was actually the LIVE. So to therefore i had to revert to an old backup , loosing data.

My issue at hand. I am missing my Partitions.

when i attempted the rescue i was greeted by " You dont have any Linux partitions. The system will reboot automatically when you exit from the shell. "

Out put for lsblk below :
20200213_131014 copy.jpg
20200213_131014 copy.jpg (54.32 KiB) Viewed 1369 times
Can this information be recover at all ?
Fingers crossed.

I am thinking to myself, i can extract the boot partition from the backup VM which is exactly the same but not as current with data and use that boot partition to get the vm started. Once thats possible i can attempt a recovery for the other deleted partitions ? Not 100% sure.

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: HELP!!! CENTOS 7 BOOT Recovery

Post by desertcat » 2020/02/13 18:13:14

kdavid wrote:
2020/02/13 17:19:51
Hi Guys,

I need some urgent help on a matter. Another administrator was working on the VM( Both Centos) So i took over and accidentally cleared the wrong VM while running some partition deletion and creation. Upon trying to retore the checkpoint , i then realize the Virutal Machine Test, was actually the LIVE. So to therefore i had to revert to an old backup , loosing data.

My issue at hand. I am missing my Partitions.

when i attempted the rescue i was greeted by " You dont have any Linux partitions. The system will reboot automatically when you exit from the shell. "

Out put for lsblk below :20200213_131014 copy.jpg

Can this information be recover at all ?
Fingers crossed.

I am thinking to myself, i can extract the boot partition from the backup VM which is exactly the same but not as current with data and use that boot partition to get the vm started. Once thats possible i can attempt a recovery for the other deleted partitions ? Not 100% sure.
This is confusing. Did you delete the Virtual Machine, or did you delete the OS itself, as in the OS that boots the computer itself ie NOT the Virtual Machine but the REAL OS? If you deleted the VM that is one thing, if you deleted the REAL OS you are so screwed. If you deleted the REAL OS and IF you have the entire disk backed up, then simply do an entire disk restore, and that will restore the disk as it was complete with the created partitions.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: HELP!!! CENTOS 7 BOOT Recovery

Post by hunter86_bg » 2020/02/14 14:29:50

You can recreate the partition table:
You need to:
1. Get the old VM running and run

Code: Select all

 fdisk -l
2. Use fdisk on the broken VM and recreate the partition table on all disks



Be careful - Some disks use GPT, others use Legacy partition table. Pick the correct one. Deleting a partition is not wiping your data - just editing the partition table. Once you have the partirikn table back to before the disaster - you will have your filesystems on the correct location.If you still can't boot - use rescue CD/DVD and reinstall grub/rebuild initramfs/initrd .

kdavid
Posts: 5
Joined: 2010/03/12 12:06:03

Re: HELP!!! CENTOS 7 BOOT Recovery

Post by kdavid » 2020/02/17 17:17:53

desertcat

My apologies for the confusion. I delete all partitions, but the virtual machine is still there.

kdavid
Posts: 5
Joined: 2010/03/12 12:06:03

Re: HELP!!! CENTOS 7 BOOT Recovery

Post by kdavid » 2020/02/17 17:31:54

hunter86_bg wrote:
2020/02/14 14:29:50
You can recreate the partition table:
You need to:
1. Get the old VM running and run

Code: Select all

 fdisk -l
2. Use fdisk on the broken VM and recreate the partition table on all disks



Be careful - Some disks use GPT, others use Legacy partition table. Pick the correct one. Deleting a partition is not wiping your data - just editing the partition table. Once you have the partirikn table back to before the disaster - you will have your filesystems on the correct location.If you still can't boot - use rescue CD/DVD and reinstall grub/rebuild initramfs/initrd .

Hi Hunter 86,

How do i tell if it is GPT or Legacy Partition table the system uses ?

kdavid
Posts: 5
Joined: 2010/03/12 12:06:03

Re: HELP!!! CENTOS 7 BOOT Recovery

Post by kdavid » 2020/02/17 17:58:29

Okay never mind, when i ran fdisk -l on the backup vm, it return the following and i saw the file system stating GPT.
See image below.
Attachments
Screenshot from 2020-02-17 12-54-35.png
Screenshot from 2020-02-17 12-54-35.png (64.13 KiB) Viewed 1228 times

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: HELP!!! CENTOS 7 BOOT Recovery

Post by hunter86_bg » 2020/02/18 21:25:45

'Disk Lavel Type' must be the same.
Create the partitions just as they were.

Yet, therr is no guarantee - but theoretically it should work.

Post Reply