LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Fixing MBR (Boot Record) Kali (I know, I know..) (https://www.linuxquestions.org/questions/linux-newbie-8/fixing-mbr-boot-record-kali-i-know-i-know-4175622553/)

StevenSmithCIS 01-27-2018 10:19 PM

Fixing MBR (Boot Record) Kali (I know, I know..)
 
Greetings again. I've read the sticky about Kali, and I know. It's just the version I installed because it was the one we used in school, and was before I'd gotten on here. I also have Mint installed.

My question is: Some time ago, somehow, my boot record must've gotten nuked. I have several partitions with different OS's, but I nuked (on purpose) my Windows partition. Since then, it won't boot.. just says it can't find the operating system, even though I KNOW there is ONE on an external drive, and two others on my hard drive.

What would I have to do to get it to boot up again? Right now, I'm using a live USB stick I made. I'd eventually like to put another flavor where Windows used to be, but want to get it to boot first.

Thank you for any help. I understand if nobody wants to help. :/

FDISK -l Dump:

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 9E6C7635-5EF7-4C37-A94F-C3BB98660A15

Device Start End Sectors Size Type
/dev/sda1 2048 1339070463 1339068416 638.5G Linux filesystem
/dev/sda4 1339070464 1936906239 597835776 285.1G EFI System
/dev/sda5 1936906240 1952602111 15695872 7.5G Linux swap




Disk /dev/sdb: 7.6 GiB, 8166703104 bytes, 15950592 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: 0x025df2bd

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 15950591 15948544 7.6G c W95 FAT32 (LBA)


Disk /dev/sde: 149.1 GiB, 160041885696 bytes, 312581808 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: 0x44fdfe06

Device Boot Start End Sectors Size Id Type
/dev/sde1 * 63 312576704 312576642 149G 83 Linux


Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 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: 0x955ded33

Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 501622783 501620736 239.2G 7 HPFS/NTFS/exFAT
/dev/sdc2 501622784 1236725759 735102976 350.5G 83 Linux
/dev/sdc3 1236727806 1529694207 292966402 139.7G 5 Extended
/dev/sdc5 1236727808 1529694207 292966400 139.7G 83 Linux


Disk /dev/loop0: 2.4 GiB, 2558234624 bytes, 4996552 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

syg00 01-27-2018 10:31 PM

Hmmmm ...
Code:

/dev/sda4 1339070464 1936906239 597835776 285.1G EFI System
285G ???. What filesystem ?.

If this is indeed a UEFI based system, go into the boot menu, and change the default boot to one you know exists - Linux is fine. Start with the simple possibilities first ...

AwesomeMachine 01-27-2018 10:46 PM

I would reinstall grub. Do you know how to do that?

StevenSmithCIS 01-30-2018 10:29 PM

Quote:

Originally Posted by syg00 (Post 5812422)
Hmmmm ...
Code:

/dev/sda4 1339070464 1936906239 597835776 285.1G EFI System
285G ???. What filesystem ?.

If this is indeed a UEFI based system, go into the boot menu, and change the default boot to one you know exists - Linux is fine. Start with the simple possibilities first ...

File system *should* be EXT2 according to gparted.

You mean BIOS boot menu? It doesn't have anything there, obviously.. just hardware devices.

I'm really new to linux, and have never had this problem before, so not sure what you mean by the boot menu. (?)

Thank you.

StevenSmithCIS 01-30-2018 10:29 PM

Quote:

Originally Posted by AwesomeMachine (Post 5812427)
I would reinstall grub. Do you know how to do that?

No.

frankbell 01-30-2018 10:52 PM

To format your MBR under Linux, use dd: https://www.axllent.org/docs/view/erase-your-mbr/

Here's another article that might be helpful: https://neosmart.net/wiki/fix-mbr/

You may then have to update/reinstall GRUB. http://www.brighthub.com/computing/l...les/36648.aspx

Brains 01-30-2018 11:22 PM

Quote:

Originally Posted by StevenSmithCIS (Post 5813636)
You mean BIOS boot menu? It doesn't have anything there, obviously.. just hardware devices.

I'm really new to linux, and have never had this problem before, so not sure what you mean by the boot menu. (?)

Obviously you didn't look hard enough, don't know how to navigate the bios which is easy if you can read what's in there, or you don't know how to read. Every bios or EFI firmware interface (computer settings) have a boot section in settings that allow you to prioritize boot devices. You can set the internal drive first, CD drive second, or second internal drive as second boot device, or network boot device, floppy drive, USB drive etc. etc. etc. If you can add drives to the computer, you can select which drive to boot.

Go back and take a harder look. If you can't read this post, ask a friend to do it for you.

yancek 01-31-2018 06:23 AM

You indicate you "had" some release of windows, which one? The reference in your original output indicates you have an EFI partition. Newer windows (8 & 10) pre-installed were almost always EFI, is that what you had? Might help if you indicate which Linux versions you think you have installed.

Which Linux are you using on the usb?
Try mounting /dev/sda4 and posting the output, you can do an online search for mount Linux partition and get thousands of hits, pretty simple.
As suggested above, a more thorough search through your BIOS might provide something. If you indeed have an EFI system you should see "boot from EFI file" or something similar in the boot options.

fatmac 01-31-2018 10:30 AM

I wouldn't start from here! ;)

Looking at sda, this is where I'd start, back up anything you want off of this disk, then reinstall Linux on there.
Once you have a working Linux on sda, add your other disks boot details to your grub.cfg - that should then let you choose which to boot at start up.

StevenSmithCIS 01-31-2018 02:07 PM

Quote:

Originally Posted by Brains (Post 5813649)
Obviously you didn't look hard enough, don't know how to navigate the bios which is easy if you can read what's in there, or you don't know how to read. Every bios or EFI firmware interface (computer settings) have a boot section in settings that allow you to prioritize boot devices. You can set the internal drive first, CD drive second, or second internal drive as second boot device, or network boot device, floppy drive, USB drive etc. etc. etc. If you can add drives to the computer, you can select which drive to boot.

Go back and take a harder look. If you can't read this post, ask a friend to do it for you.

Lol. I've been in the BIOS several times and haven't seen any Linux 'drives' to boot from, but I'll look again and see if there is something else that I haven't already seen. As far as I know, BIOS only contains HARDWARE to boot from, not the software that boots from each drive...

StevenSmithCIS 01-31-2018 02:19 PM

Quote:

Originally Posted by yancek (Post 5813767)
You indicate you "had" some release of windows, which one? The reference in your original output indicates you have an EFI partition. Newer windows (8 & 10) pre-installed were almost always EFI, is that what you had? Might help if you indicate which Linux versions you think you have installed.

Which Linux are you using on the usb?
Try mounting /dev/sda4 and posting the output, you can do an online search for mount Linux partition and get thousands of hits, pretty simple.
As suggested above, a more thorough search through your BIOS might provide something. If you indeed have an EFI system you should see "boot from EFI file" or something similar in the boot options.

I had Windows 8.1

Kali Linux on the USB

I'll be honest, I know NOTHING about the mounting process and it confuses me a bit, as a long-time Windows user (out of necessity).

If I do a "mount /dev/sda4" it gives me: "mount: /: /dev/sda4 already mounted on /."

Ok, yeah, I've done searching online before and come up with thousands of things. That's usually how I end up messing something up even worse, by trying several different things, and not knowing exactly what I'm doing, which is why I just came here instead.

Ok, well. NBD I guess. Perhaps I'll just poke around and try to figure it out. Might take me a week or two, but my other work is going okay, so I have a little time now.

Thank you!

Brains 01-31-2018 03:04 PM

Quote:

Originally Posted by StevenSmithCIS (Post 5813925)
Lol.not the software that boots from each drive...

UEFI firmware interface is software based, not a bios. And the file you would specify to boot from the interface has a .efi extension, it is also software.

This is what syg00 was referring too. Because of the 285.1GB "EFI" partition which would be formatted FAT32 (LIKE /dev/sdb1). Pretty much all computers with Windows 8.1 pre-installed are UEFI. The UEFI firmware interface is configured to boot Windows 8.1 by default without entering the interface settings. Now that the default boot item "Windows" is gone, you can press an F (F10, F11, F12) key to get a boot menu and select another OS that was installed before Windows was deleted, which in turn would be selecting a "software" file, but all you would see is the name it was given in the menu.

Typically Windows would have been installed on /dev/sda, the first drive listed and labeled GPT, this is also the drive Fdisk utility reported a EFI partition. So why don't you entertain us and tell us "where was Windows?", it looks like you already installed Linux on that drive and deleted the Microsoft reserved partition and the recovery partition. Everything points to a UEFI system.

We are here to help, but you don't tell us information we need, you just expect us to guess from the Fdisk output you posted.

As mentioned, entertain us with the mess you presented.

Brains 01-31-2018 03:06 PM

All I can figure out here is that you screwed up the EFI FAT formatted boot partition and you won't be able to boot anything till you re-do the whole damn thing. But talk to the pros first this time.

Brains 01-31-2018 03:14 PM

The EFI boot (system) partition is only supposed to be 200-300MB, not 285GB, everything required to boot your systems was in there.

Brains 01-31-2018 03:23 PM

Quote:

Lol
And stop laughing at people willing to help, we didn't do this stupidity, you did!

yancek 01-31-2018 04:06 PM

Quote:

If I do a "mount /dev/sda4" it gives me: "mount: /: /dev/sda4 already mounted on /."
Then you can find where it is mounted by using the df -h command from a terminal.

I find it extraordinary that you have an EFI partition of over 280GB!! I've rarely seen one over 500MB, the standard being 200-500MMB. Be interesting to know how that happened.

Your other drives, sdc and sde are MBR/DOS and you won't be able to boot them from the EFI partition even if you could access them. If you have an actual install on one of those drives, you should be able to select either drive from the boot option on boot.


All times are GMT -5. The time now is 06:53 PM.