LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
 
LinkBack Search this Thread
Old 12-25-2011, 06:45 AM   #1
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
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: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Original Poster
Rep: Reputation: 226Reputation: 226Reputation: 226
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: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Original Poster
Rep: Reputation: 226Reputation: 226Reputation: 226
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: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Original Poster
Rep: Reputation: 226Reputation: 226Reputation: 226
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: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Original Poster
Rep: Reputation: 226Reputation: 226Reputation: 226
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: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Original Poster
Rep: Reputation: 226Reputation: 226Reputation: 226
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: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Original Poster
Rep: Reputation: 226Reputation: 226Reputation: 226
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: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
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: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

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


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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


All times are GMT -5. The time now is 11:37 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration