LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 03-08-2010, 02:01 PM   #16
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69

MBR is the master boot record.

Look, there is a simple answer to all of this and it was touched upon by the first answer, the dd command.

However, it requires a different set of options. The MBR sits at the head of the disk, it contains Device strings, the partition table and other bits and pieces. Really you'd just want to dd from the old disk to the new disk, skipping the first n bytes (I forget the size of the MBR); not skipping it means the new drive kinda thinks it is the same as the old, right down to versions, makes and so on

You can't reboot because the MBR has gone at this point in what your instructions want you to do, forget the MBR at the moment, all the important stuff is in memory/ known to the kernel, its only on boot that you need it there.

By the way; google is your friend.

http://www.faqs.org/docs/Linux-mini/...k-Upgrade.html
 
1 members found this post helpful.
Old 03-08-2010, 02:47 PM   #17
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
I always use cp -vax because this allows me to use partitions that are not the same size as the original one(s). You may need to reinstall grub from the livecd; sometimes chrooting is required, too.
 
Old 03-09-2010, 07:30 AM   #18
tallship
Member
 
Registered: Jul 2003
Location: On the Beaches of Super Sunny Southern San Clemente, California USA
Distribution: Slackware - duh!
Posts: 528
Blog Entries: 3

Rep: Reputation: 116Reputation: 116
Lightbulb This is how I used to do it...

http://tldp.org/HOWTO/Hard-Disk-Upgrade/install.html

Although I saw quite a few other great ideas here.

The nice thing is, whichever method you use, until you get it right you've still got the original (failing) hard drive (until it goes kaput).

 
Old 03-09-2010, 08:41 AM   #19
tallship
Member
 
Registered: Jul 2003
Location: On the Beaches of Super Sunny Southern San Clemente, California USA
Distribution: Slackware - duh!
Posts: 528
Blog Entries: 3

Rep: Reputation: 116Reputation: 116
Thumbs up

Quote:
Originally Posted by jamescondron View Post
MBR is the master boot record.

Look, there is a simple answer to all of this and it was touched upon by the first answer, the dd command.

However, it requires a different set of options. The MBR sits at the head of the disk, it contains Device strings, the partition table and other bits and pieces. Really you'd just want to dd from the old disk to the new disk, skipping the first n bytes (I forget the size of the MBR)...
I believe it's 446 bytes
 
Old 03-09-2010, 09:55 AM   #20
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Rep: Reputation: 38
you quoted a piece of text out of what seems to be some kind of tutorial, but it is not enough info. what i make up if i put two and two together is that this some program that does what you want (possibly clonezilla does this too, but i never used it). i did not know gparted did disk to disk copies, perhaps you can place the link to the rest of the text here so we can see the whole (con)text.

the MBR should be cloned along in the Disk to disk process, system will not boot without it. the other thing i make up is that you should shut down your system when it is all done and then configure the new drive as the master (and only) drive in the system before next boot... but i am only guessing.


edit:
did not realise there were this many replies already..

Last edited by wabbalee; 03-09-2010 at 09:59 AM.
 
Old 03-09-2010, 10:52 AM   #21
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by wabbalee View Post
you quoted a piece of text out of what seems to be some kind of tutorial, but it is not enough info. what i make up if i put two and two together is that this some program that does what you want (possibly clonezilla does this too, but i never used it). i did not know gparted did disk to disk copies, perhaps you can place the link to the rest of the text here so we can see the whole (con)text.
here's the link:GPARTED DOCUMENTATION - COPYING
 
1 members found this post helpful.
Old 03-09-2010, 05:20 PM   #22
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Rep: Reputation: 38
you learn something new every day! gparted copies partitions, i should have known it could do that as i often resized and moved partitions on a single drive, so why not to another..

but anyway, i dont quite understand that last bit at the bottom; they way i see what will happen is that the system will boot of the original master if you dont touch it and it will just see the slave as a 'new' drive in windows. why? because this drive has only been read, not modified! why the author of the tut says 'there is no MBR for the moment' is a riddle to me, after all did it not just make an exact copy of a drive? just try it and see what happens, or does it need MBR separately done?
i know if you have windows on a drive without and MBR or a GRUB that doesn't work, you can boot of a win98 start up floppy and give it the command

fdisk /mbr

and it will make an MBR. but you should not need to do that i think and it has been a while since i have had to do this, that goes back a few years now.
 
Old 03-09-2010, 07:20 PM   #23
tallship
Member
 
Registered: Jul 2003
Location: On the Beaches of Super Sunny Southern San Clemente, California USA
Distribution: Slackware - duh!
Posts: 528
Blog Entries: 3

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by wabbalee View Post
you quoted a piece of text out of what seems to be some kind of tutorial...
There's no mention of the size of the MBR in that Mini-Howto. Lilo takes care of that.

I got the size of the MBR from some notes I have laying around from when I had played around with some third party apps, but I prefer to mount the new disk under, for example /mnt/nd/ and except for some modifications to the cp command, copy everything over.

Using Lilo or Grub is just simpler and more straight-forward IMO.

There's another tutorial HERE on that method, which skips a couple of presumably obvious things like choosing your filesystem, that shows the method for using Grub instead.

YMMV
 
2 members found this post helpful.
Old 03-10-2010, 05:42 PM   #24
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Rep: Reputation: 38
that's what is so likable about linux: many ways to go to achieve the same thing..
 
Old 03-10-2010, 09:50 PM   #25
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,658

Rep: Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257Reputation: 2257
Wow, sure a long way to go.

I never like to cross adapters on a clone. It may work but you never know. Every once in a while some small issue comes up. Might be a small as cluster size issue or an oddity with packages or who knows. I tend to only clone like hardware. I think it is a good rule.

I'd suggest you install the new drive and put a fresh install on it. That would ensure that you have a known good starting point.

Last edited by jefro; 03-10-2010 at 09:51 PM.
 
Old 03-10-2010, 11:00 PM   #26
Smartpatrol
Member
 
Registered: Sep 2009
Posts: 196

Rep: Reputation: 38
...

Last edited by Smartpatrol; 03-11-2010 at 11:11 PM.
 
Old 03-13-2010, 12:26 PM   #27
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
I successfully completed the cloning procedure using gparted and installed the GRUB/MBR.

However, a new problem I'm facing is, that when I boot from the new drive, I am given a GRUB options screen asking me to choose whether I want to startup in normal mode or recovery mode or memtest (snapshot attached) Click image for larger version

Name:	Grub.jpg
Views:	8
Size:	24.7 KB
ID:	3005 and when I choose any one of the first two, I'm given the error:
Quote:
error: no such device: d361a7de-2cd4-45bb-b8db-9e65d4133c3b

Press any key to continue...
 
Old 03-13-2010, 06:04 PM   #28
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Rep: Reputation: 38
what i am suspecting is the uuid (universally unique identifier) (d361a7de-2cd4-45bb-b8db-9e65d4133c3b) that gets assigned by the OS during initial install, will only work for the drive it originally was given to.

have a look at your grub file and find this uuid code and replace it with whatever drive notation the system has given this number to

example of mine:

Quote:
title Ubuntu 9.04, kernel 2.6.28-18-generic
uuid 267438d3-812e-4f81-adfb-f1abd139d6dc
kernel /boot/vmlinuz-2.6.28-18-generic root=UUID=16bbaa72-376b-43aa-bf84-029d7f5548b2 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-18-generic
quiet
and then in say /etc/fstab you can find the drive notation:

Quote:
# / was on /dev/sda1 during installation
UUID=16bbaa72-376b-43aa-bf84-029d7f5548b2 / ext2 relatime,errors=remount-ro 0 1
you now know that (in my case) the /dev/sda1 partition was given that UUID code
so a modified version of my grub menu.lst stanza would be:

Quote:
title Ubuntu 9.04, kernel 2.6.28-18-generic
uuid 267438d3-812e-4f81-adfb-f1abd139d6dc
kernel /boot/vmlinuz-2.6.28-18-generic root=/dev/sda1 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-18-generic
quiet
change the drive notations for what corresponds with your / partition and try again. hopefully i have the syntax right as i cant really test it so do make a back up of menu.lst first.
 
Old 03-13-2010, 07:32 PM   #29
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
Originally Posted by tallship View Post
i believe it's 446 bytes
512
 
Old 03-18-2010, 11:55 AM   #30
fkasmani
Member
 
Registered: Dec 2007
Posts: 178

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by wabbalee View Post
have a look at your grub file
where is the "grub file" located?

I went to /boot/grub but do not see the menu.lst there.

I removed the old drive and booted the pc with the Super Grub LiveCD and from there it successfully booted the Linux installation from the new drive. I then shut down the PC and removed the LiveCD and tried booting again, but again was unsuccessful in booting the PC from the Linux installation in the new drive. I just keep getting the follwoing message:
Code:
error: no such device: d361a7de-2cd4-45bb-b8db-9e65d4133c3b
error: no such device: d361a7de-2cd4-45bb-b8db-9e65d4133c3b
error: no such device: d361a7de-2cd4-45bb-b8db-9e65d4133c3b

Failed to boot default entries.

Press any key to continue...
and it keeps repeting when I "press any key"
This time the GRUB selection screen did not come.

I can use the PC with the new drive if I boot with the help of Super Grub LiveCD and infact am posting this from the new drive.

I can even access the files in the drive which seemed encrypted when accessing them from the old drive, so I guess from here I may be able to make changes to the boot files, which was not possible when I was booting from the old drive and mounting the new drive.

One thing I can't understand is, that the SuperGrub wiki says we SG even has the ability to Fix the Boot of Linux (http://www.supergrubdisk.org/wiki/FixBootOfLinuxOption) but I don't know how to reach there - when I boot off the SuperBrub LiveCD, I get no such screens or options for fixing things.

Also, the fstab in /etc is "read only" - how can one make changes to it?

Last edited by fkasmani; 03-18-2010 at 01:25 PM.
 
  


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
Moving files from a Linux hard drive to a Windows Vista Premium hard drive WolfMan51 Linux - Hardware 5 07-12-2011 10:19 AM
Moving linux partition from original hard drive to another, howto??? Fear58 Linux - General 22 02-15-2008 05:26 PM
Moving linux to second hard drive rjayaram Linux - General 10 09-11-2003 06:23 PM
Moving linux hard drive to primary slave flyboy320 Linux - General 4 01-23-2002 12:30 PM


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