2

I am running tests for MBR recovery on Red Hat Linux 7. I tried to intentionally erase the MBR with:

dd if=/dev/random of=/dev/sda bs=1 count=512

I can see with

fdisk -l /dev/sda

that the partition table is damaged but once I reboot, the system boots fine ! how can i manage to really damage the MBR sector? PS: my installation is RHEL 7 with a separate /boot partition (/dev/sda1) and the rest of the system on LVM.

dawud
  • 14,918
  • 3
  • 41
  • 61
Kwakou
  • 21
  • 2
  • In principle you're using the correct command. Are you sure you're not using UEFI and GPT? If it is the case, MBR could not make any sense. Also, there are some BIOSes who refuse OS to write into MBR somehow, to block boot sector viruses. Could it be that option? – Nikita Kipriyanov Jun 02 '16 at 08:09
  • Hi Nikita. no i am using Bios and dos type partition. however, it is VM (vmware) box, i don't know if it makes any difference – Kwakou Jun 02 '16 at 08:34
  • Vmware also runs bios, you could enter it if you tick some checkbox in vm settings and reboot. Also check VM settings itself. I didn't heard about VMware silently ignores writes to mbr sector, but I will not be surprised much if it do. It is full of stupid surprises. – Nikita Kipriyanov Jun 02 '16 at 08:49

1 Answers1

0

Your dd needs to damage the partitions used on the root partition. The damage on your boot partition can be completely invisible until you try to mount it.

Note that this could be useful to begin your tests though. Try to mount /boot!

Julie Pelletier
  • 1,000
  • 6
  • 8
  • Hi Julie. when i reboot, the /boot is automatically mounted. but the fact you say dd needs to damage partitions seems what i have to look at. Because (of the use of LVM) /dev/sda1 (which hosts the boot partition) starts at cylinder 2048 - seems to be specific with RHEL 7 default LVM installation ?? - fdisk -l /dev/sda Device Boot Start End Blocks Id System /dev/sda1 * 2048 1026047 512000 83 Linux /dev/sda2 1026048 16777215 7875584 8e Linux LVM – Kwakou Jun 02 '16 at 08:13