1

I need a little help from a GRUB expert.

I just cloned a 1 TB Seagate drive onto a brand new 2 TB Hitachi, and before swapping them out, I decided to boot-test it. It's tied to my computer through a SATA 2 to USB adapter. The 25-hour cloning operation seems to have worked fine; I used dd piped through pv.

However, when I boot, I now get a message from GRUB2 saying that the partition is not found; then get dumped to the grub rescue prompt.

ls gives me a one-partition drive on hd0 (not sure what this is, possibly a thumb drive), a sequence of partitions on hd1, and a single-partition on hd2 (again, no idea what this is). (hd1,msdos10) seems to be a non-bootable partition that I keep around; most of the others (those on an ext file system) are recognized. I find my Ubuntu Trusty Tahr root on (hd1,msdos5). However, even after "set root=(hd1,msdos5)", all attempts at insmod ("insmod normal") and ("insmod linux") return "Partition not found".

I'm guessing that the MBR of my new drive is not relevant to the partitions cloned onto it. What I'm not sure of is how to fix that. Again, the target drive is mounted externally (even though it's ultimately an internal drive); and I can boot to a LiveUSB or hda, but not it. It has a Windows 7 partition, Ubuntu 14.04, and a sequence of additional partitions inclusive of Windows Recovery/Repair/Whatever-They're-Calling-It, my extra partition at the end, my home partition, swap, and probably one or two other guys like temp.

In the worst case, I suppose I could reinstall all of Ubuntu 14.04, but that would require a lot of further time prying through the repos to get all my old stuff back. I'm sure this is simple, but the MBR is not the kind of thing I screw around with unless absolutely necessary, especially when I don't know what I'm doing and it's a potential 25-hour fix!

Quoted terminal output from GRUB:

 ls

 > (hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos11) (hd1,msdos10) (hd1,msdos9) (hd1,msdos8) (hd1,msdos7) (hd1,msdos6) (hd1,msdos5) (hd1,msdos3) (hd1,msdos2) (hd1,msdos1) (hd2) (hd2,msdos1)
ls (hd0,1)
 > Filesystem is unknown
ls (hd0,msdos1)
 > Filesystem is unknown
set root=(hd1,msdos5)
insmod normal
> Partition not found
...
  • Update. I used boot-repair to restore the MBR for sdb. I no longer get the grub rescue prompt—I get a boring blank screen, followed by a boring blinking cursor. I don't think it's doing anything else, as I've left it alone for perhaps ten minutes without change. Progress, babe—at least it's doing something. Advice is appreciated on what might be going on. – Michael Eric Oberlin Jan 22 '15 at 19:22
1

It sounds as though the new drive doesn't have the correct partitioning - if you're only seeing one. Did you pass the dd command '/dev/sdn' or '/dev'sdn1' to write to?I think your first task now is to remove the new drive, and see if you need to undo the MBR 'fix' - if so, there are several questions about that here with answers such as this.

Once you have a working system, you get to 'how to do this right':

Backup is good - you probably don't need reminding just now :)

I would start this from a live CD boot, for starters, as a live system may well change whilst being written - in fact almost certainly will.

First, check where your old drive (source) is, then plug the new drive in, check where it went as the drive designation can vary - dmesg | tail or mount will do (but mount, only if the filesystem recognises it - I doubt yours will right now), or fdisk -l but care is needed to get them right. This is a crucial point!

Once you know which is which, you can do the copy; dd if=/dev/sdx of=/dev/sdy - note you do NOT use the partition numbers.

You can use pv but IMHO this complicates things if you're having trouble, you already know it takes ages. It will go a LOT faster if you plug the drives in directly.

You should end up with 2 drives the same, one having 50% unallocated space. Disconnect the new one, reboot to ensure all is well. This is not technically necessary, but I would..

Turn off, plug in the new drive - direct or do the USB thing again if you prefer. Reboot. If it won't boot, your PC is allocating /dev/sda to the new drive, so using USB may be a good plan now.

At this stage you can use gparted to enlarge existing partitions, or fdisk to add a new one. Once done, you can swap drives and try a boot; you may need to go back to the top of this & try the link I gave to fix booting, depending what you changed.

|improve this answer|||||
  • Do you think it would be possible to boot to the drive while both are plugged in? I did most of this initially; but GRUB threw a fit when I tried to boot from the 2 TB. – Michael Eric Oberlin Jan 23 '15 at 19:30
  • Yes, but it's not the simplest way. I would get the single drive working, then ads the old one back in. You need to be sure which connects as /dev/sda at this stage, and you want to be sure it's working. I presume you want to reuse the 1tb later, you can add it back in. – Mark Williams Jan 24 '15 at 0:53
  • That may be the problem, and this may be my solution; I'm going to wait until my electric jeweller screwdriver gets here and I can swap the two out before verifying it, though. Thank you very much for you detailed help! – Michael Eric Oberlin Jan 24 '15 at 1:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.