LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-02-2017, 09:30 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 299

Rep: Reputation: 5
I think I blew up the MBR or GRUB, help please!


Today I just put a new SSD in my desktop. I did have a little trouble booting up the OS because I had plugged the DVI into the wrong port, when I couldn't see the monitor I did end up turning off the computer several times before I finally found the problem. I don't know if the problem occured when I was physicaly in the box or during boot when I turned it back off several times but now my system will not boot. The grub screen does display but after selecting the Linux Mint option it goes to a screen that says ->

`Welcome to emergency mode! After loggin in, type "journalct1 -xb" to view system logs, "systemct1 reboot" to reboot, "systemct1 default" or ^D to try agin to boot into default mode. Give root password for maintenance (or press Control-D to continue):`

I think I have blown up my MBR or GRUB. I have validated that my boot drive is /dev/sda1.
Any ideas on how I can go about fixing this issue. I do have a live USB that I can boot into and make repairs. Thanks.
 
Old 07-03-2017, 02:25 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,783

Rep: Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574
Quote:
Originally Posted by Garrett85 View Post
`Welcome to emergency mode! After loggin in, type "journalct1 -xb" to view system logs, ...
And did you ?.
 
Old 07-03-2017, 05:00 AM   #3
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 553

Rep: Reputation: 277Reputation: 277Reputation: 277
Quote:
Originally Posted by Garrett85 View Post
I think I have blown up my MBR or GRUB. I have validated that my boot drive is /dev/sda1.
On systems using MBR, normally /dev/sda is the MBR and /dev/sdaX are any other partitions on the drive. If, when installing Linux Mint, it offered you /dev/sda1 as a default boot drive, I would like you to please verify if your machine boots with MBR or UEFI.

Then check if the SSD was formatted using MBR or GPT. Boot your live USB and post the output of the following:
Code:
fdisk -l /dev/sda
gdisk -l /dev/sda
 
Old 07-03-2017, 06:52 PM   #4
Garrett85
Member
 
Registered: Jan 2011
Posts: 299

Original Poster
Rep: Reputation: 5
output

Quote:
Originally Posted by aragorn2101 View Post
On systems using MBR, normally /dev/sda is the MBR and /dev/sdaX are any other partitions on the drive. If, when installing Linux Mint, it offered you /dev/sda1 as a default boot drive, I would like you to please verify if your machine boots with MBR or UEFI.

Then check if the SSD was formatted using MBR or GPT. Boot your live USB and post the output of the following:
Code:
fdisk -l /dev/sda
gdisk -l /dev/sda
mint@mint ~ $ sudo fdisk -l /dev/sda
Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 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: 0x0006ad62

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 440152438 440150391 209.9G 83 Linux
/dev/sda2 452200446 468860927 16660482 8G 5 Extended
/dev/sda3 440154112 452198399 12044288 5.8G 83 Linux
/dev/sda5 452200448 468860927 16660480 8G 82 Linux swap / Solaris

Partition table entries are not in disk order.
mint@mint ~ $ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************

Disk /dev/sda: 468862128 sectors, 223.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 7C92F06E-E76E-421C-B43F-8003D85C5E29
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 468862094
Partitions will be aligned on 2048-sector boundaries
Total free space is 6902 sectors (3.4 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 440152438 209.9 GiB 8300 Linux filesystem
3 440154112 452198399 5.7 GiB 8300 Linux filesystem
5 452200448 468860927 7.9 GiB 8200 Linux swap

Last edited by Garrett85; 07-03-2017 at 06:53 PM.
 
Old 07-04-2017, 04:58 AM   #5
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 553

Rep: Reputation: 277Reputation: 277Reputation: 277
Ok, so you do have a proper MBR. Notice how gdisk says "Invalid GPT and valid MBR". gdisk is mainly for GPT drives, so for MBR you should always use fdisk. The 2 commands were just for testing. Don't worry, gdisk didn't convert anything physically. It only did a conversion in memory so that it can display something.

Anyway, the mistake was when you pointed the installation of the bootloader to /dev/sda1 instead of /dev/sda.

You can repair this by booting your live USB, mount the /dev/sda1 partition somewhere (e.g. /mnt) and install grub in /dev/sda. Follow this and go to "Fixing a broken system": https://help.ubuntu.com/community/Grub2/Installing

All the best.
 
Old 07-04-2017, 05:04 AM   #6
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat CentOS Fedora SuSE
Posts: 353

Rep: Reputation: 51
Once you've added disk, usual linux problem is disk reoredering. Probably the new disk becomes sda and old becomes sdb, while you still have references in your /etc/fstab to /dev/sdaX. Fix /etc/fstab to reflect reality or use mount by LABEL or by UUID.
 
Old 07-04-2017, 09:46 AM   #7
Garrett85
Member
 
Registered: Jan 2011
Posts: 299

Original Poster
Rep: Reputation: 5
bootloader?

Quote:
Originally Posted by aragorn2101 View Post
Anyway, the mistake was when you pointed the installation of the bootloader to /dev/sda1 instead of /dev/sda.
All the best.
When did I point the installation of the bootloader to /dev/sda1?

Thanks, your instructions and link seem to correlate with a local Linux professional I just talked to.
 
Old 07-04-2017, 09:47 AM   #8
Garrett85
Member
 
Registered: Jan 2011
Posts: 299

Original Poster
Rep: Reputation: 5
fstab

Quote:
Originally Posted by voleg View Post
Once you've added disk, usual linux problem is disk reoredering. Probably the new disk becomes sda and old becomes sdb, while you still have references in your /etc/fstab to /dev/sdaX. Fix /etc/fstab to reflect reality or use mount by LABEL or by UUID.
Thanks, my /etc/fstab file is already using UUID for most of my drives.
 
Old 07-05-2017, 12:44 AM   #9
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 553

Rep: Reputation: 277Reputation: 277Reputation: 277
Quote:
Originally Posted by Garrett85 View Post
When did I point the installation of the bootloader to /dev/sda1?
In your first post, you said:

Quote:
Originally Posted by Garrett85 View Post
...
I think I have blown up my MBR or GRUB. I have validated that my boot drive is /dev/sda1.
...
I think you can repair this using the information under "Fixing a broken system" in https://help.ubuntu.com/community/Grub2/Installing
 
Old 07-05-2017, 06:23 PM   #10
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010
Grub uses the disk UUID to determine the root file system. If you changed the disk, you must reinstall grub. You can do that with the installation DVD/CD. Boot into rescue mode. Open a chroot shell to your Linux / partition, and run
Code:
$ grub-install
 
Old 07-07-2017, 02:15 PM   #11
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by Garrett85 View Post
Today I just put a new SSD in my desktop. I did have a little trouble booting up the OS because I had plugged the DVI into the wrong port, when I couldn't see the monitor I did end up turning off the computer several times before I finally found the problem. I don't know if the problem occured when I was physicaly in the box or during boot when I turned it back off several times but now my system will not boot. The grub screen does display but after selecting the Linux Mint option it goes to a screen that says ->

`Welcome to emergency mode! After loggin in, type "journalct1 -xb" to view system logs, "systemct1 reboot" to reboot, "systemct1 default" or ^D to try agin to boot into default mode. Give root password for maintenance (or press Control-D to continue):`

I think I have blown up my MBR or GRUB. I have validated that my boot drive is /dev/sda1.
Any ideas on how I can go about fixing this issue. I do have a live USB that I can boot into and make repairs. Thanks.

you can put it back easily with the command 'dd'.

You can take another mbr with same version of grub, and put it back onto another disk with 'dd'. Doing so you must take care not to blow up your disk completely, if you miss the count number.

This method is only for experienced persons.
 
  


Reply

Tags
grub, linux, mbr, mint


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
12.4 new install grub 2 boot problem with grub put on it's own partition not on MBR james2b Ubuntu 14 12-07-2012 09:34 AM
Which program can boot a copy of the MBR (fake MBR) using mbr.bin Xeratul Linux - Software 6 12-03-2010 11:40 PM
I think I blew away my grub (old redhat 4) pellicle Linux - Newbie 3 12-15-2008 07:14 AM
Grub on MBR vivekian SUSE / openSUSE 13 02-20-2005 09:49 PM
GRUB MBR overwritten by WIN98 MBR TOuseef Linux - General 7 11-14-2004 04:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration