LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-29-2016, 04:46 PM   #16
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15

Quote:
Originally Posted by rknichols View Post
Excellent! The filesystem looks good. I'm no expert on GRUB 2, but a Google search for "grub 2" and "reinstall" yields How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD.
Here's the instruction for retiring GRUB from live CD
How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD or USB
Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD

Terminal Commands
Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.

sudo mount /dev/sdXY /mnt
Now bind the directories that grub needs access to to detect other operating systems, like so.

Now we jump into that using chroot.

Now install, check, and update grub.

This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.

grub-install /dev/sdX
grub-install --recheck /dev/sdX



As you can see from my picture, sdb5 is my lost Linux partition so I mounted. Its partition type of Linux Not ext.
when I do sudo mount --bind /dev /mnt/dev && the prompt becomes >> is that OK??
the next command I need to do is sudo mount --bind /dev/pts /mnt/dev/pts && . Can I continue with that at the >> prompt?

After mounting, because my partition is /dev/sdb5 so I need to do grub-install /dev/sdb5? but the instruction says grub-install /dev/sda though.
Attached Thumbnails
Click image for larger version

Name:	mount.png
Views:	8
Size:	107.4 KB
ID:	21302  

Last edited by lilzz; 03-29-2016 at 04:47 PM.
 
Old 03-29-2016, 05:53 PM   #17
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,591

Rep: Reputation: 2114Reputation: 2114Reputation: 2114Reputation: 2114Reputation: 2114Reputation: 2114Reputation: 2114Reputation: 2114Reputation: 2114Reputation: 2114Reputation: 2114
Your Windows repair will have replaced the GRUB primary boot loader in the MBR of /dev/sdb with its own. That is what you need to fix, so you do want "grub-install /dev/sdb".

The "&&" is a conditional AND. You use it when you want the next command to run only if the previous command succeeds, and that's most commonly done when you are combining several commands on a single line or in scripts. Using it when manually entering commands on separate lines is unusual. Effectively, all those commands are being combined on one long line, and nothing happens until a command without that trailing "&&" ends that "line". The ">> " prompt indicates that the current command line is not yet complete.

Last edited by rknichols; 03-29-2016 at 06:05 PM. Reason: Explain "&&" and ">>"
 
1 members found this post helpful.
  


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
accidentally deleted: libqtcore4 how do i recover SIQKO Linux - Software 11 10-15-2012 10:57 AM
Oops, I accidentally deleted my NTFS partition!!! How to recover? WindowBreaker Linux - Newbie 1 07-03-2009 08:28 PM
I have deleted a folder accidentally? How do I recover it? srikanth_dhondi Linux - Software 2 02-19-2008 07:38 PM
Main Panel Volume Icon deleted accidentally kelforn Debian 4 07-31-2007 03:17 AM
How to recover libc.so.6 file if it's deleted accidentally? tebet11@yahoo.com Linux - Distributions 4 12-25-2006 09:13 PM

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

All times are GMT -5. The time now is 06:36 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