LinHES Forums http://forum.linhes.org/ |
|
How to Restore Grub boot partition http://forum.linhes.org/viewtopic.php?f=5&t=25604 |
Page 1 of 1 |
Author: | drhood [ Sat Jan 11, 2020 8:01 am ] |
Post subject: | How to Restore Grub boot partition |
Hi All I need some assistance with boot up on LinHES. In the course of freeing up disk space, I believe I have deleted the partition that contains grub2. After I press the power button, the bios list of disks and F2, Del, F6 options appear. Then a black screen and a blinking cursor. For an explantion of why I deleted the boot partition, well... the best reason is ignorance. I did not realize that the system depended on a small partition of 2mb (I think). Note: A separate partition with grub2 is unfamiliar to me. I am familiar with grub being on the first few sectors of the disk/partition designated for boot up that also has the root (/) file system on it (not sure if that sentence is accurate). My first partition (sda1) on the disk has zero (0) space in front of it, which suggests that grub2 is not installed in that location, and the likely alternative explanation is that the system was using the small partition I deleted. I can boot into a manjaro liveCD and chroot into sda1 and mount all of the other data partitions on sda. Note: /boot is on disk/partition sda1. I searched for a possible solution in the LinHES forum, as well as on the internet and found the following potential (?) solutions to restore grub2.
Which of the above two links should I use to restore the boot partition? Alternatively, is it easier to move sda1 slightly and free up a few megabytes at the beginning of the disk and install grub2 there? Should I download LinHES install iso onto a thumbdrive and use that to boot restore grub2? Thanks for any assistance. |
Author: | mattbatt [ Sat Jan 11, 2020 11:40 pm ] |
Post subject: | Re: How to Restore Grub boot partition |
I would try the Manjaro option since Manjaro is close to Arch and so is LinHES. I Manjaro dual booted on my LInHES box and it's bootloader works fine. But I'm not an expert, wait until a smart person answers. |
Author: | drhood [ Sun Jan 12, 2020 6:41 am ] |
Post subject: | Re: How to Restore Grub boot partition |
mattbatt wrote: I would try the Manjaro option since Manjaro is close to Arch and so is LinHES. I Manjaro dual booted on my LInHES box and it's bootloader works fine. But I'm not an expert, wait until a smart person answers. Thanks, the quick reply is appreciated. I will wait a bit longer for confirmation of your the manjaro or other option. I think this should be solvable. However, I am not an expert in Linux. |
Author: | knappster [ Sun Jan 12, 2020 7:49 am ] |
Post subject: | Re: How to Restore Grub boot partition |
FYI, here is the output of "fdisk -l" and "df -h" on my machine. It looks like the boot partition is sda4. Code: [mythtv@linhes ~]$ fdisk -l Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: gpt Disk identifier: 185ABB4F-2CC8-4FB5-BFEC-222D974A228E Device Start End Sectors Size Type /dev/sda1 2048 9766911 9764864 4.7G Microsoft basic data /dev/sda2 9766912 25368575 15601664 7.5G Microsoft basic data /dev/sda3 25368576 25369140 565 282.5K Microsoft basic data /dev/sda4 25370624 25374719 4096 2M BIOS boot /dev/sda5 25376768 52203519 26826752 12.8G Microsoft basic data /dev/sda6 52209664 61974527 9764864 4.7G Microsoft basic data /dev/sda7 61976576 976771071 914794496 436.2G Microsoft basic data [mythtv@linhes ~]$ df -h Filesystem Size Used Avail Use% Mounted on dev 3.9G 0 3.9G 0% /dev run 3.9G 476K 3.9G 1% /run /dev/sda1 4.5G 3.9G 414M 91% / shm 3.9G 0 3.9G 0% /dev/shm /dev/sda7 437G 118G 319G 27% /data/storage/disk0 /dev/sda5 13G 3.2G 8.8G 27% /home /dev/sda6 4.5G 195M 4.1G 5% /data/srv/mysql /dev/sr0 3.0G 3.0G 0 100% /media/cdrom I am also apprehensive to give advice on fixing it since things could go downhill in a hurry. I guess the most important thing is whether you have a good backup? I wonder if you would be able to try "upgrading" from the installation cd, since it overwrites certain partitions. Generally speaking, I think you could boot from another disk with grub and press 'e' on bootup to edit the grub command that the disk will initiate. If you were able to copy the command that Linhes would normally produce then it should boot normally to confirm that the bootloader is the only issue. This is really just a diagnostic measure and not a fix, though. I think this is what I've done when mbr has bombed on other distros. |
Author: | drhood [ Sun Jan 12, 2020 2:18 pm ] |
Post subject: | Re: How to Restore Grub boot partition |
knappster wrote: FYI, here is the output of "fdisk -l" and "df -h" on my machine. It looks like the boot partition is sda4. I am also apprehensive to give advice on fixing it since things could go downhill in a hurry. I guess the most important thing is whether you have a good backup? I wonder if you would be able to try "upgrading" from the installation cd, since it overwrites certain partitions. Generally speaking, I think you could boot from another disk with grub and press 'e' on bootup to edit the grub command that the disk will initiate. If you were able to copy the command that Linhes would normally produce then it should boot normally to confirm that the bootloader is the only issue. This is really just a diagnostic measure and not a fix, though. I think this is what I've done when mbr has bombed on other distros. Thanks for the tip. Where do I find the command that Linhes would normally use to boot up the system? Is it /etc/default/grub? |
Author: | knappster [ Sun Jan 12, 2020 3:23 pm ] |
Post subject: | Re: How to Restore Grub boot partition |
I believe it is from: Code: /boot/grub/grub.cfg I am looking at it on another machine and it looks like it could be complex to type by hand. I would say beginning at line: Code: menuentry 'LinHES' --class arch ... stopping just before Code: menuentry 'LinHES --no-splash' ... Alternatively, you may get lucky and boot from a LiveCD and then select to boot from the hard drive on its menu instead of booting from the CD. It's been a number of years since I've dealt with a fouled MBR, but it seemed like at least one instance resulted in this finding grub and booting to the OS. Sorry for your misfortune, but hopefully you can boot into LinHES and create a backup that you can copy to a remote machine before you start fiddling with the MBR partition. Even if you can't boot into LinHES, it should have daily backups on the HDD that you could potentially copy to a remote device after booting from a LiveCD. They are contained in: Code: /data/storage/disk0/backup/system_backups
|
Author: | drhood [ Sat Feb 22, 2020 7:47 pm ] |
Post subject: | Re: How to Restore Grub boot partition |
Thanks everyone! I ended up doing a clean reinstall of LinHES followed by a restore of the last backup in /data/storage/backups/system_backups. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |