LinuxQuestions.org
Register a domain and help support LQ
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 11-20-2012, 05:55 PM   #1
Thambry
LQ Newbie
 
Registered: Nov 2012
Posts: 7

Rep: Reputation: Disabled
cloned harddrive doesnt boot up / misconfigured bootloader? How to fix?


I got a severe problem that is probably just a mis-configured/missing bootloader, but i cannot figure it out myself (I only have basic knowledge about linux myself). I need to make a copy of the bootdrive of a XUbunto 12.10 system. The current bootdrive gets more and more problems and i want to clone it all on a SDD. But when I try to boot from the SDD probably accesses it and instantly reboots again. I read about this in the internet and its the bootloader. Even in this forum is a topic about that (http://www.linuxquestions.org/questi...k-help-629356/) but i tried to adapt it to my configuration/layout but it doesnt work. So you are my last hope to successfully get my cloned SDD to boot. Here is what I tried:
Then I booted with the XUbuntu 12.10 installation CD (from a USB DVD drive) as a live CD. The SDD shows up on the desktop, so i doubleclick it to get it mounted. I do "sudo su" to get admin rights. "fdisk -l" gives me the following layout:

Disk /dev/sda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7370ad28

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 3905535 1951744 82 Linux swap / Solaris
/dev/sda2 3905536 117231407 56662936 5 Extended
/dev/sda5 3907584 117229567 56660992 83 Linux

Here is what I tried to install GRUB by grub-install:

root@xubuntu:/mnt# mount -t ext4 /dev/sda5 /mnt
root@xubuntu:/mnt# ls /mnt
bin etc initrd.img.old media proc sbin sys var webmin-setup.out
boot home lib mnt root selinux tmp vmlinuz
dev initrd.img lost+found opt run srv usr vmlinuz.old
root@xubuntu:/mnt# chroot /mnt
root@xubuntu:/# ls
bin etc initrd.img.old media proc sbin sys var webmin-setup.out
boot home lib mnt root selinux tmp vmlinuz
dev initrd.img lost+found opt run srv usr vmlinuz.old
root@xubuntu:/# grub-install /dev/sda
/usr/sbin/grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).

Then I tried it through grub:
root@xubuntu:/ grub

then: root (hd0,0)
then: setup (hd0)
Then i get "Error 17: Cannot mount selected partition" (no matter if i have mounted sda5 before or not).

I have tried all that was suggested in above-mentioned thread and am really lost now. Can anybody of you help me to get this SDD booted up again? Thanks alot in advance.
 
Old 11-20-2012, 06:21 PM   #2
tekhead2
Member
 
Registered: Apr 2004
Distribution: slackware/FreeBSD/Vector
Posts: 291

Rep: Reputation: 52
You mentioned that you cloned the drive, how exactly did you clone it? What process did you take when you cloned it? Do you still have the original disk and is it working? Does the GRUB menu come up when you boot without the old hard drive?
 
Old 11-20-2012, 06:36 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
In order to successfully install Grub from within a chroot you have to make some directories available inside the chroot that are only populated in a running system. Try it this way:
Code:
mount /dev/sda5 /mnt
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
chroot /mnt
Then proceed with installing Grub.
 
Old 11-21-2012, 01:10 PM   #4
Thambry
LQ Newbie
 
Registered: Nov 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by tekhead2 View Post
You mentioned that you cloned the drive, how exactly did you clone it? What process did you take when you cloned it? Do you still have the original disk and is it working? Does the GRUB menu come up when you boot without the old hard drive?
I used Acronis True Image 2012. Cloning windows installation works like charm but whenever I clone linux partition/installations, I run in the abovementioned problem. So I decided to finally have it solved.
Of course I still have the original boot HDD and its still running. I dont get a GRUB menu when I boot from it. So I am not sure if it is called upon ever reboot and just boots to the default partition or if it is not installed at all. But for the cloned SDD, something is missing for sure.
 
Old 11-21-2012, 01:17 PM   #5
Thambry
LQ Newbie
 
Registered: Nov 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
In order to successfully install Grub from within a chroot you have to make some directories available inside the chroot that are only populated in a running system. Try it this way:
Code:
mount /dev/sda5 /mnt
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
chroot /mnt
Then proceed with installing Grub.
Thanks alot, this already brought me a step forward - i was able to install GRUB and when booting from the cloned SDD, the computer doesnt reset instantly. But unfortunately i get an error message (presumably from GRUB):
"error: no such device: de468f7b-736d-4e6c-bb9-983fce91d0ad"
I suspect that this is the ID of the cloned SDD - but why he cannot find it is unknown to me...do you have any clue?
 
Old 11-21-2012, 04:18 PM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
After installing Grub you should also rebuilt the configuration file (while chrooted to the installation like before):
Code:
sudo update-grub
 
1 members found this post helpful.
Old 11-22-2012, 01:29 PM   #7
Thambry
LQ Newbie
 
Registered: Nov 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
After installing Grub you should also rebuilt the configuration file (while chrooted to the installation like before):
Code:
sudo update-grub
You're a genius! With updating GRUB, I can finally boot from the cloned SDD. But the swap didnt work anymore - but this could be rectified by putting the correct UUID in fstab.

Thanks alot for your help again - this problem with cloning harddrives running linux pestered me for some time now but how I know how to reinstall and update GRUB
 
Old 11-22-2012, 01:32 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Nice that it is working for you. Please mark this thread as solved using the thread tools at the top of the thread.
 
  


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
Sata Harddrive / Bootloader (fedora4) neorion Linux - Software 1 09-28-2006 06:00 PM
Which SATA harddrive Do i install the Bootloader to/? mr_coffee Linux - Hardware 6 01-08-2006 03:29 PM
How can I fix the bootloader? madrat Linux - Software 5 06-01-2005 04:43 PM
Installing linux on 2nd harddrive(dual boot) windows on seperate harddrive lysol Linux - Software 25 08-03-2004 10:33 AM
Cant boot. My boot.local is misconfigured Boom Linux - Newbie 6 03-06-2003 09:30 PM


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