Hello All,
I am trying to figure out where exactly grub2 is stored on disk.
BIOS (vmware)
DOS style layout
server with gui installation using seperate /boot (ext4) as first partition and / (ext4)
inspecting the MBR reveals
dd if=/dev/sda count=1 bs=512 | od -t x1 -A x
1+0 records in
1+0 records out
512 bytes copied, 6.5017e-05 s, 7.9 MB/s
000000 33 c0 fa 8e d8 8e d0 bc 00 7c 89 e6 06 57 8e c0
000010 fb fc bf 00 06 b9 00 01 f3 a5 ea 1f 06 00 00 52
000020 52 b4 41 bb aa 55 31 c9 30 f6 f9 cd 13 72 13 81
000030 fb 55 aa 75 0d d1 e9 73 09 66 c7 06 8d 06 b4 42
000040 eb 15 5a b4 08 cd 13 83 e1 3f 51 0f b6 c6 40 f7
000050 e1 52 50 66 31 c0 66 99 e8 66 00 e8 35 01 4d 69
000060 73 73 69 6e 67 20 6f 70 65 72 61 74 69 6e 67 20
000070 73 79 73 74 65 6d 2e 0d 0a 66 60 66 31 d2 bb 00
000080 7c 66 52 66 50 06 53 6a 01 6a 10 89 e6 66 f7 36
000090 f4 7b c0 e4 06 88 e1 88 c5 92 f6 36 f8 7b 88 c6
0000a0 08 e1 41 b8 01 02 8a 16 fa 7b cd 13 8d 64 10 66
0000b0 61 c3 e8 c4 ff be be 7d bf be 07 b9 20 00 f3 a5
0000c0 c3 66 60 89 e5 bb be 07 b9 04 00 31 c0 53 51 f6
0000d0 07 80 74 03 40 89 de 83 c3 10 e2 f3 48 74 5b 79
0000e0 39 59 5b 8a 47 04 3c 0f 74 06 24 7f 3c 05 75 22
0000f0 66 8b 47 08 66 8b 56 14 66 01 d0 66 21 d2 75 03
000100 66 89 c2 e8 ac ff 72 03 e8 b6 ff 66 8b 46 1c e8
000110 a0 ff 83 c3 10 e2 cc 66 61 c3 e8 76 00 4d 75 6c
000120 74 69 70 6c 65 20 61 63 74 69 76 65 20 70 61 72
000130 74 69 74 69 6f 6e 73 2e 0d 0a 66 8b 44 08 66 03
000140 46 1c 66 89 44 08 e8 30 ff 72 27 66 81 3e 00 7c
000150 58 46 53 42 75 09 66 83 c0 04 e8 1c ff 72 13 81
000160 3e fe 7d 55 aa 0f 85 f2 fe bc fa 7b 5a 5f 07 fa
000170 ff e4 e8 1e 00 4f 70 65 72 61 74 69 6e 67 20 73
000180 79 73 74 65 6d 20 6c 6f 61 64 20 65 72 72 6f 72
000190 2e 0d 0a 5e ac b4 0e 8a 3e 62 04 b3 07 cd 10 3c
0001a0 0a 75 f1 cd 18 f4 eb fd 00 00 00 00 00 00 00 00
0001b0 00 00 00 00 00 00 00 00 01 b4 04 00 00 00 80 20
0001c0 21 00 83 fd 3e 3f 00 08 00 00 00 a8 0f 00 00 fd
0001d0 3f 3f 83 fe ff ff 00 b0 0f 00 00 08 80 02 00 fe
0001e0 ff ff 82 fe ff ff 00 b8 8f 02 00 f8 7f 00 00 fe
0001f0 03 7c 05 b4 f7 bd 00 b0 0f 03 00 50 90 0c 55 aa
after that until first partition disk contains all zeroes…
Disk /dev/sda: 125 GiB, 134217728000 bytes, 262144000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0004b401
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1028095 1026048 501M 83 Linux
/dev/sda2 1028096 42973183 41945088 20G 83 Linux
/dev/sda3 42973184 51359743 8386560 4G 82 Linux swap / Solaris
/dev/sda4 51359744 262143999 210784256 100.5G 5 Extended
/dev/sda5 51361792 262143999 210782208 100.5G 8e Linux LVM
examining a centos/redhat7 based installation (using same disk layout/type) picture is very different…
the grub code is present in MBR gap and disk starts with eb …
any help is very appreciated also if i do something wrong would be great to know!
Thank you in advance
Michael.