LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-12-2016, 11:32 PM   #1
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Rep: Reputation: 49
Installed new debian OS now cannot access old OS


I installed a new debian OS via USB onto a prepared partition (sdb3).
However, the launcher seemed to be insisting on installing grub and I couldn't find a way of de-selecting grub installation.
To avoid any problems, I loaded grub onto the same partition I was installing in (sdb3). I think this means the new install has overwritten the MBR.

Before the installation, sda1 (i.e. a different hard disk) was the original OS which placed grub in the MBR.
Now when I boot, grub can see sda1, but it won't boot up. I booted sda2 (an OS on the same disk) and did a 'grub-update' but this hasn't worked.
How can I boot into the OS on sda1 again?

I was wondering if it's possible to do this without a live USB as I currently have a debian OS written to it!
 
Old 02-12-2016, 11:42 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 14,280
Blog Entries: 24

Rep: Reputation: 3896Reputation: 3896Reputation: 3896Reputation: 3896Reputation: 3896Reputation: 3896Reputation: 3896Reputation: 3896Reputation: 3896Reputation: 3896Reputation: 3896
You could try running update-grub instead of grub-update.
 
Old 02-13-2016, 12:31 AM   #3
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by frankbell View Post
You could try running update-grub instead of grub-update.
Ah yes, that's a good one.
What I meant was I used
Code:
update-grub
on sda2 and it didn't sort out the problem. Of course, 'grub-update' is nonsense and simply brings up an error message.
 
Old 02-13-2016, 08:08 AM   #4
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
I've opened the boot directory in sdb3 which is the new install and which has GRUB2 booting from the MBR. The boot directory has the following files:
Code:
config-3.16.0-4-amd64 initrd.img-3.16.0-4-amd64  
vmlinuz-3.16.0-4-amd64 grub System.map-3.16.0-4-amd64
So I'm guessing that's how the boot directory should look after a successful new install.

I looked at the boot file of an OS which GRUB2 will open (sda2):
Code:
config-3.16.0-4-amd64 initrd.img-3.16.0-4-amd64 
vmlinuz-3.16.0-4-amd64 grub System.map-3.16.0-4-amd64 

config-3.2.0-4-amd64 initrd.img-3.2.0-4-amd64 
vmlinuz-3.2.0-4-amd64 System.map-3.2.0-4-amd64
It appears it has its boot files from its original install and new boot files written to it from the new install (sda3).
I'm wondering if I should delete the old boot files?

I then opened the boot directory in the problem OS (sda1) which GRUB2 sees but won't boot up. The files in there are as follows:
Code:
config-3.16.0-4-amd64 initrd.img-3.16.0-4-amd64  
vmlinuz-3.16.0-4-amd64 grub System.map-3.16.0-4-amd64

config-3.2.0-4-amd64 initrd.img-3.2.0-4-amd64 
vmlinuz-3.2.0-4-amd64 System.map-3.2.0-4-amd64  

extlinux memtest86+.bin memtest86+_multiboot.bin
So it has its original files and new files written to it from the new install.
But it also has extlinux, memtest and multiboot files.

So I'm wondering if I deleted the extra files so the boot directory looked like the one in sda2, then perhaps GRUB2 will boot sda1?
 
Old 02-13-2016, 10:30 AM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 7,397

Rep: Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491
Code:
grub-install /dev/hdx then update-grub
install grub on the HDD / (MBR) that you want grub on then update it to get back both of your systems.

providing that you are actually booting into at least one of them, remembering that the one you used to install grub has the control over grubx

and YES you can just over write them (the old grub files) - I've done this many times...

Last edited by BW-userx; 02-13-2016 at 10:38 AM.
 
Old 02-13-2016, 11:07 AM   #6
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by BW-userx View Post
grub-install /dev/hdx then update-grub
install grub on the HDD / (MBR) that you want grub on then update it to get back both of your systems.
I installed grub onto sdb3 when installing jessie onto the same partition. The launcher did its own 'update-grub'.
So what you've said has already happened while using debian-launcher-installer.
The problem is the grub menu shows sda1 but locks up when I try to boot it.

If I use the terminal on the sb3 install and do the following:
Code:
grub-install /dev/sda
update-grub
then will this allow me to boot sda1?

Quote:
and YES you can just over write them (the old grub files) - I've done this many times...
Yes, but what about the extlinux, memtest and multiboot files in /boot on sda1? Can I delete those too?
I'm wondering if those files are unnecessary (because they're not in sda2) and whether they were generated from the conflict created by installing grub to the mbr on the new install?
 
Old 02-13-2016, 11:20 AM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 7,397

Rep: Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491
Quote:
Originally Posted by Higgsboson View Post
I installed grub onto sdb3 when installing jessie onto the same partition. The launcher did its own 'update-grub'.
So what you've said has already happened while using debian-launcher-installer.
The problem is the grub menu shows sda1 but locks up when I try to boot it.

If I use the terminal on the sb3 install and do the following:
Code:
grub-install /dev/sda
update-grub
then will this allow me to boot sda1?


Yes, but what about the extlinux, memtest and multiboot files in /boot on sda1? Can I delete those too?
I'm wondering if those files are unnecessary (because they're not in sda2) and whether they were generated from the conflict created by installing grub to the mbr on the new install?
take off the 3 /dev/sda no numbers
numbers are your partitions, not the hdd mbr section.

that is where your files are at but grub I put on MBR and when you update it it finds what it needs to know where to look on boot up of your system(s).

fyi
you can install grub
/dev/sda
/dev/sdb
/dev/sdc

not

/dev/sda1
/dev/sdb1
/dev/sdc1

just logially guessing, the ones on sda1 are for the system on sda1 and the others are for the other system on that other partiton.

so just back up the files in question, doing it like this renames them , and "removing" them at the same time. Because they are no longer the same name that the system looks for.

mv -v filename filename.bk

this way if it messes you up then all you have to do is reverse the proccess to put the files back.

mv -v filename.bk filename

if no problems arise then I'd say it is ok to delete them afterwards..

better safe then sorry.

Last edited by BW-userx; 02-13-2016 at 11:31 AM.
 
Old 02-13-2016, 01:08 PM   #8
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by BW-userx View Post
take off the 3 /dev/sda no numbers
numbers are your partitions, not the hdd mbr section.

that is where your files are at but grub I put on MBR and when you update it it finds what it needs to know where to look on boot up of your system(s).

fyi
you can install grub
/dev/sda
/dev/sdb
/dev/sdc

not

/dev/sda1
/dev/sdb1
/dev/sdc1

just logially guessing, the ones on sda1 are for the system on sda1 and the others are for the other system on that other partiton.

so just back up the files in question, doing it like this renames them , and "removing" them at the same time. Because they are no longer the same name that the system looks for.

mv -v filename filename.bk

this way if it messes you up then all you have to do is reverse the proccess to put the files back.

mv -v filename.bk filename

if no problems arise then I'd say it is ok to delete them afterwards..

better safe then sorry.
It hasn't worked. I still can't boot the OS in sda1.
I initially renamed the 'extra files' in /boot of sda1 and ran:
Code:
grub-install /dev/sda 
update-grub
After that, I still couldn't get into sda1.
So I restored the correct names of the extra files and tried to boot the OS from grub again, but nothing happened.

Usually, if there's a problem with grub, then it can't see the partition. But in this instance it can see it but it won't boot the OS.
I haven't made any changes to sda1 except for the fact I made a new install where a new grub bootloader was installed which changed the location of the mbr.
 
Old 02-13-2016, 01:41 PM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 10,212
Blog Entries: 7

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
ok, you are doing this the hard way.

sometimes i get confronted with an unbootable system, and for situations like this i have my rescatux cd (now usb) handy.
"restore grub" => done.
 
Old 02-13-2016, 01:51 PM   #10
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 7,397

Rep: Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491
NO NO NO
Code:
After that, I still couldn't get into sda1.
this
Code:
blkid
should show you a /dev/sda1 now install it on
Code:
 
/dev/sda ONLY
then update it

Wizard – Restore Grub with Super Grub2 Disk

Last edited by BW-userx; 02-13-2016 at 02:02 PM.
 
Old 02-13-2016, 02:05 PM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 7,397

Rep: Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491Reputation: 1491
Quote:
Originally Posted by ondoho View Post
ok, you are doing this the hard way.

sometimes i get confronted with an unbootable system, and for situations like this i have my rescatux cd (now usb) handy.
"restore grub" => done.
as far as I know he has grub, he just did not install it properly to pick up his other OS prior to install. now grub is confused.

just reinstall /dev/sda then update grub ,, it picks up the other sys's and adds them to the list, done.

.. whatever works, as long as it works...

Last edited by BW-userx; 02-13-2016 at 02:06 PM.
 
Old 02-13-2016, 02:22 PM   #12
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by ondoho View Post
ok, you are doing this the hard way.

sometimes i get confronted with an unbootable system, and for situations like this i have my rescatux cd (now usb) handy.
"restore grub" => done.
Yes, I've read an old article on grub where a live cd is recommended.
However, there is also a 'Boot Repair' program which can also be used from a terminal.
I'm going to try this option first before having to create a live usb. But I'll this tomorrow.
 
Old 02-13-2016, 02:23 PM   #13
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, puppy, ubuntu
Posts: 2,511

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
The problem is the grub menu shows sda1 but locks up when I try to boot it.
what do you mean by lock up? what kind of error message or that the last line before the lock up.
 
Old 02-13-2016, 02:28 PM   #14
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by BW-userx View Post
NO NO NO
Code:
After that, I still couldn't get into sda1.
this
Code:
blkid
should show you a /dev/sda1 now install it on
Code:
 
/dev/sda ONLY
then update it

Wizard Restore Grub with Super Grub2 Disk
Yes - I did install grub to the hdd and not the partition. Then I updated grub. But for some reason it didn't work.
I'm going to look into this a little more, but like you say, it does look like I'll need a separate repair pgm to sort it out.
 
Old 02-13-2016, 02:34 PM   #15
Higgsboson
Member
 
Registered: Dec 2014
Location: UK
Distribution: Debian 8 Cinnamon/Xfce/gnome classic Debian live usb
Posts: 508

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by BW-userx View Post
as far as I know he has grub, he just did not install it properly to pick up his other OS prior to install. now grub is confused.

just reinstall /dev/sda then update grub ,, it picks up the other sys's and adds them to the list, done.

.. whatever works, as long as it works...
I think you've said before you've employed this method and it works.
For some reason though, there must be some other issue in my case, as its not quite working.
I'll look into 'Boot Repair', give that a try and if that fails I'll create a live usb as I currently have jessie dvd.iso installed on the usb.
 
  


Reply


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
Installed Debian from DVD, now I can't access the drive/boot the OS? BoggyB Linux - Newbie 8 08-22-2012 08:30 AM
[SOLVED] Newly installed debian sid & saved debian wheezy home would like to transfer files EDDY1 Linux - Newbie 11 01-20-2012 08:43 PM
Installed Debian, now only a user, can't install, mount or access. Eric Elliott Debian 7 07-17-2008 01:24 AM
I installed Wine and configure this at Debian 4.0 r1.I installed windows software hassancemk Linux - Software 2 04-02-2008 12:28 AM
Dual boot Debian Etch and XP with GRUB - Debian installed First - one HDD bence8810 Debian 11 01-07-2007 11:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:27 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration