LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 05-16-2010, 02:34 AM   #16
brucehinrichs
Member
 
Registered: Mar 2008
Location: US
Distribution: Debian Sid; Sabayon, UbuntuStudio, Slackware-multilib 13.1, Peppermint Ice, CentOS
Posts: 575

Rep: Reputation: 67

That's good news.
Quote:
I think they must have changed the convention)
Correct, so make sure all instances of set root need to refer to (hd0,3), e.g. set root='(hd0,3)'. Then apply zuzoa's amended suggestion:
Quote:
So, /dev/sda3 = (hd0,3), and zuzoa's (good) suggestion amended:
Quote:
Sometimes it helps to add the partition, (hd0,3), before the paths like /boot/vmlinuz and /boot/initrd, so they become "(hd0,3)/boot/vmlinuz-2.6.32-trunk-686 root=UUID=c2612767-032d-43a2-b414-aac0a0f7d5f5 ro quiet"
If that doesn't work, then we'll have to regroup.
 
Old 05-16-2010, 03:08 AM   #17
Fred Caro
Member
 
Registered: May 2007
Posts: 723

Rep: Reputation: 62
plato

I doubt if 'socrates' used words such as 'smart'.

Fred.
 
0 members found this post helpful.
Old 05-16-2010, 03:44 AM   #18
gandrusz
LQ Newbie
 
Registered: Apr 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Maybe someone know how to run update-grub script but point it to a different root? I can't see any options in the man page...
 
Old 05-16-2010, 05:42 AM   #19
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
gandrusz,

When you moved the partition you did so by file-copying. The boot loader, residing in the boot sector, is not part of the filing system so it cannot be copied although the necessary Grub files will be available in the new location.

It sounds you have Grub2 which uses /boot/gryb/grub.cfg as the configuration file instead of /boot/grub.menu.lst used by Grub1. Although both Grub use the same command "grub-install" there is a slight difference. I assume you are using Grub2 as it is more difficult to restore.

You need to boot up the PC with the same Live CD as the moved Linux as it guarantee the same commands available and the device detection, showed in /dev, matching your installation.

Basically you invoke the grub-install available in the Live CD, mount the partition , ask Grub2 to use it as the roor directory and then specify a destination, which can be /dev/sda3 if Grub2 is to be inside sda2 and /dev/sda if it is to take over the MBR. The former allows the distro "chainloadable and you can have both of them restored. A chainloadable distro can be booted by every PC boot loader, including Grub1 and Grub2.

Much what you want to know is inside the Live CD by just typing
"man grub-install".

The exact command you need in a root terminal should be
Code:
mkdir /mnt/sda3
mount /dev/sda3 /mnt/sda3
grub-install --root-directory=/mnt/sda3 /dev/sda
The above commands are (1) create a mounting point in /mnt of the boot up Linux and call it /mnt/sda3 (2) Mount the device /dev/sda3 on /mnt/sda3 and (3) Ask Grub to install itself using the system files inside /mnt/sda3 and link them to the MBR of device sda.

There are a few good Grub2 guides knocking around a decent one can be found in Kubuntu forum. If you uses Grub1 check out the information in my "just booting tips" of my signature.

You you still have a problem you can fire up the distro manually. Let us know your progress. I have just moved 4 MS Windows and about 40 Linux from a 1TB disk to a 1.5TB disk myself.

You can move any number of distros by a simple script, say you need to move sdb5 to sdb30 to sda5 and sda30
Code:
for ((i=5;i<=30;i++)); do mkfs.ext3 /dev/sda$i; mkdir /mnt/sda$i; mount /dev/sda$i /mnt/sda$i; mkdir /mnt/sdb$i; mount /dev/sdb$i /mnt/sdb$i; cd /mnt/sdb$i; tar cf - . | ( cd /mnt/sda$i; tar xf -); done
You have to restore all the boot loaders but Grub1 is a lot easier as you can do them with a Grub prompt in one go.

Last edited by saikee; 05-16-2010 at 05:59 AM.
 
Old 05-16-2010, 06:23 AM   #20
gandrusz
LQ Newbie
 
Registered: Apr 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by saikee View Post
gandrusz,
....

You have to restore all the boot loaders but Grub1 is a lot easier as you can do them with a Grub prompt in one go.
Hi Saikee,

Thanks for your detailed instructions. I followed the same approach to move the files over, and now I managed to get grub (version 2 indeed) to boot into my partition. However, the kernel fails immediately with Kernel Panic:
Code:
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /sys on /root/sys failed: No such file or directory
mount: mounting /proc on /root/proc failed: No such file or directory
/init: line 253: can't open /root/dev/console: no such file
... Kernel Panic....
and I don't know how to fix this one
 
Old 05-16-2010, 07:54 AM   #21
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
The information suggests that you might have not copied the files correectly resulting the subdirectories /dev, /sys, /proc etc missing after the migration.

In such a case and unless you have a back up copy it looks like a re-installation to me. Just salvage your personal data from the /home directory if there is any.

The script I gave in my earlier post can ensure the entire partition is migrated.
 
1 members found this post helpful.
Old 05-16-2010, 01:22 PM   #22
gandrusz
LQ Newbie
 
Registered: Apr 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by saikee View Post
The information suggests that you might have not copied the files correectly resulting the subdirectories /dev, /sys, /proc etc missing after the migration.
Thanks very much, that was it! It was enough to create these 3 empty directories and it works fine!
 
  


Reply

Tags
grub


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
moving /home /root & /var to new partition CrashedAgain Linux - General 8 11-24-2005 11:44 AM
Moving grub.conf to another partition oO0agentcow0Oo Linux - Newbie 5 07-27-2005 03:05 PM
moving root / partition on Slack 10.0 mrhide Slackware 3 04-06-2005 12:21 PM
How to fix grub after removing linux partition cantonboy Linux - Newbie 3 11-19-2004 06:09 PM
Moving grub to another partition salinger Linux - Software 3 03-15-2003 08:26 AM


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