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 02-21-2009, 10:40 PM   #1
ladyrico
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Rep: Reputation: 0
Question Help: Making Cloned Partition Bootable


Hello all,

I followed the tutorial here to clone my linux partition to another hard drive.

Problem is after running the copy (cp -a *) successfully, I'm unable to make to partition bootable.

Some info first

Clone : /dev/sdb7 -> /dev/sda6

sudo blkid

/dev/sda1: UUID="DCA0652EA0651076" LABEL="Windows 7" TYPE="ntfs"
/dev/sda5: UUID="cf335fa5-136b-48e3-b56d-3ed6039506f8" TYPE="swap"
/dev/sda6: UUID="95978c58-699c-4e87-9253-edd02f2cc32c" TYPE="ext3"
/dev/sda7: UUID="FE940D8E940D4B1B" LABEL="NewData" TYPE="ntfs"
/dev/loop0: TYPE="squashfs"



Here's what I've tried and the result

ubuntu@ubuntu:~$ sudo chroot /tmp/sda6
root@ubuntu:/# grub-install hd0
/dev/sdb7: Not found or not a block device.

ubuntu@ubuntu:~$ sudo grub-install --root-directory=/tmp/sda6 hd0
The file /tmp/sda6/boot/grub/stage1 not read correctly.

ubuntu@ubuntu:~$ sudo grub --boot-drive=/dev/sda6
grub> find /boot/grub/stage1
Error 15: File not found

and when I try to boot from the drive the Grub loader returns "Error 21"


Tried modifying the menu.lst and /etc/fstab as well

For menu.lst I changed the root value from (hd0,6) to (hd0,5) as below. And in the kernel value I set 'root=/dev/sda6', before it had UUID value for /dev/sdb7 (original/source partition)

=============menu.lst=============

#title Ubuntu 8.04.1, kernel 2.6.24-22-generic
title Hardy Heron
root (hd0,5)
kernel /boot/vmlinuz-2.6.24-22-generic root=/dev/sda6 ro quiet splash
initrd /boot/initrd.img-2.6.24-22-generic
quiet

title Windows 7
root (hd0,0)savedefault
makeactive
chainloader +1
-----------------


For fstab all I changed were the UUIDs from the source values to the new destination values.

=============/etc/fstab=============

# /dev/sda6
UUID=95978c58-699c-4e87-9253-edd02f2cc32c / ext3 relatime,errors=remount-ro 0 1

# /dev/sda5
UUID=cf335fa5-136b-48e3-b56d-3ed6039506f8 none swap sw 0 0

/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0

# /dev/sda7
UUID=FE940D8E940D4B1B /media/NewData ntfs users,defaults,umask=000 0 0
-------------------



Please help. I am familiar with ubuntu but I'm still a bit noobish, so kindly save me from myself

Thank you
 
Old 02-23-2009, 07:08 AM   #2
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 50
I just cloned my debian setup from a 20gb to a 40gb drive, I used This howto. I should note when you use the live-cd make sure both the drives are umounted before you use the dd command.
 
Old 02-23-2009, 08:29 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,035

Rep: Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912
Nope, "dd" is just a *bad* option - the "cp -a ..." is much preferable.
But grub-install is too inflexible - it's just a wrapper after all. Try this (as root/sudo) after the chroot
Code:
grub
root (hd0,5)
setup (hd0)
quit
(presumes /boot is under the root, not a separate partition).
 
Old 02-23-2009, 09:49 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,601
Blog Entries: 25

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Hi,
Quote:
Originally Posted by syg00 View Post
Nope, "dd" is just a *bad* option - the "cp -a ..." is much preferable.
But grub-install is too inflexible - it's just a wrapper after all. Try this (as root/sudo) after the chroot
Code:
grub
root (hd0,5)
setup (hd0)
quit
(presumes /boot is under the root, not a separate partition).
Why is the 'dd' a bad option?
 
Old 02-23-2009, 07:24 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,035

Rep: Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912
Because if there is an error on the source, it will (quietly) stop. There are options to specify what you want done on error - none of them good from a filesystem point of view.
"cp" is filesystem aware - when you get an error, you will know about it. Much more preferable.
 
Old 02-24-2009, 12:57 AM   #6
ladyrico
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs up

Thank you guys for your willingness to help


Quote:
Originally Posted by syg00 View Post
Nope, "dd" is just a *bad* option - the "cp -a ..." is much preferable.
But grub-install is too inflexible - it's just a wrapper after all. Try this (as root/sudo) after the chroot
Code:
grub
root (hd0,5)
setup (hd0)
quit
(presumes /boot is under the root, not a separate partition).
I had tried that as well, I think it gave an error after the setup(hd0) command but don't remember the exact error. I think something about it not being mountable.

Actually after waiting for a helpful response on ubuntuforums and getting none, I opted to just backup my data and reinstall. I couldn't wait much longer, had school and needed the lappy.

Thank you all though. It is appreciated.

Last edited by ladyrico; 02-24-2009 at 12:58 AM.
 
  


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
Making cloned disk bootable ogoy Linux - Newbie 6 05-19-2008 08:14 PM
How to make a cloned partition boot? Q.. Linux - General 4 12-25-2007 09:41 PM
Making a Bootable CD-R dwhitney67 Linux - General 9 07-31-2007 04:52 PM
making a non bootable patrion bootable jason2 Linux - General 6 08-01-2004 11:25 AM
making a partition bootable wenberg Linux - General 1 01-22-2004 10:57 AM


All times are GMT -5. The time now is 11:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration