LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 12-25-2011, 06:45 AM   #1
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Fix lfs grub


Hi
I have to fix my LFS system. I done dd copy of sdb1 which was lfs then put back on a new hard drive which was partition the same, The new drive was set as sdb1. then dd back the img to the same partition on new drive. When I try to boot all I get is the word "GRUB-" and flashing cursor.

The original HD was 40gig new drive is 80gig But sdb1 was formatted as ext4 and partition 16gig the same as original
 
Old 12-25-2011, 07:12 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Is/was GRUB installed to the mbr? And if so: Are you sure this is still the case for your "new" HD?

You might need to run grub-install /dev/sdX (8.4.3. Setting Up the Configuration).

Hope this helps.
 
Old 12-25-2011, 07:17 AM   #3
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi
Grub was installed on the sdb drive only.
So your advice would be boot a live cd mount sdb1 then
Code:
grub-install /dev/sdb1
I presume that is as root
 
Old 12-25-2011, 07:29 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by spiky0011 View Post
Hi
Grub was installed on the sdb drive only.
So your advice would be boot a live cd mount sdb1 then
Code:
grub-install /dev/sdb1
No! This will place grub on sdb1, not the mbr.

I don't know what you have previously done, this being sdb. Did you originally put grub on the mbr of sdb or sda? Put it there where you have put it before. If this is sdb then:
Code:
grub-install /dev/sdb
Quote:
I presume that is as root
Yep.

BTW: Is grub used that came with LFS or are you using grub that's part of another distro (the one on sda?) If another distro's grub is used: DO NOT use the above command, it will overwrite the one used by the other distro.

Hope this helps.
 
Old 12-25-2011, 07:33 AM   #5
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
I used grub from lfs and yes it was put on sdb So as to only boot that drive, It is completely seperate from the other drives
 
Old 12-25-2011, 07:37 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by spiky0011 View Post
I used grub from lfs and yes it was put on sdb So as to only boot that drive, It is completely seperate from the other drives
In that case you can safely use the grub-install /dev/sdb command.

Hope this helps.
 
Old 12-25-2011, 08:10 AM   #7
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
ok I have loaded Ubuntu live cd mounted lfs sdb1. I ran the command sudo grub-install /dev/sdb I get an error.
Code:
grub-probe: error: cannot find a device for /boot/grub.

No path or device is specified.
Try ``grub-probe --help'' for more information.
Auto-detection of a filesystem module failed.
Please specify the module with the option `--modules' explicitly.
ubuntu@ubuntu:/media/lfs/boot$ cd grub
ubuntu@ubuntu:/media/lfs/boot/grub$ sudo grub-install /dev/sdb
grub-probe: error: cannot find a device for /boot/grub.

No path or device is specified.
Try ``grub-probe --help'' for more information.
Auto-detection of a filesystem module failed.
Please specify the module with the option `--modules' explicitly.
Any thoughts
 
Old 12-25-2011, 08:50 AM   #8
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

Ok have fixed problem here's how

load live cd mount lfs system then run

Code:
sudo grub-install --recheck --root-directory=/media/lfs /dev/sdb
 
Old 12-25-2011, 08:52 AM   #9
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
fix grub when transfering to new drive

Hi

Ok have fixed problem here's how

load live cd mount lfs system then run

Code:
sudo grub-install --recheck --root-directory=/media/lfs /dev/sdb
 
Old 12-25-2011, 08:55 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Glad to see you got this solved.

BTW: Did you chroot into LFS or use Ubuntu's grub-install?

And can you put up the [SOLVED] tag.
 
Old 12-25-2011, 09:29 AM   #11
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
I ran sudo command from ubuntu live cd not chroot.
So the other option would be to chroot into lfs here.
I take it you have not tried copying to a new drive before?
 
Old 12-25-2011, 09:52 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by spiky0011 View Post
I ran sudo command from ubuntu live cd not chroot.
So the other option would be to chroot into lfs here.
Yes, but you first need to run these (6.2.2. and 6.2.3.):
Code:
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
Quote:
Originally Posted by spiky0011 View Post
I take it you have not tried copying to a new drive before?
Yes I have done this before, but unlike you I dd-ed the entire drive (sda) and not a partition (sdaX). All ran fine afterwards (removed the old disk and started using the clone).
 
Old 12-25-2011, 09:58 AM   #13
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Well I hope this helps other ppl in the future (good excercise)
 
  


Reply



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
[SOLVED] grub 1.99 in LFS???? devilboy09 Linux From Scratch 18 11-11-2011 07:41 PM
[SOLVED] Fix Grub!!! dino123 Linux - Newbie 5 07-13-2011 12:19 AM
[SOLVED] fix grub royearl Linux - Software 1 05-28-2010 10:36 AM
grub fix help please gow1 Linux - Software 12 03-19-2010 11:06 AM
grub drops to grub prompt on boot, but can use commands to find menu... fix? greenmuzz Linux - Software 7 06-07-2009 03:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:53 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
Open Source Consulting | Domain Registration