[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rescue grub -- help!

cbergmann@acm.org wrote:
Hi David,

I am a little bit curious why you have chosen to clone the drive with dd? I have always used a different route for cloning a system (see also "Duping a Drive Under Linux", http://linuxgazette.net/issue64/tag/12.html):
Looks good, and better suited to my purpose. What I did basically didn't work out. I could have played it safer and done a single massive dd, but I needed a bit more flexibility.

1. Partition the new drive as necessary;
2. Mount the partitions in the right order under your existing system (for instance in /mnt);
3. Copy the complete system with cp -ax;
4. Use grub to install it to the MBR of the new drive;
5. Transfer the drive to your new system.

This route has an additional advantage: you can change the size of any partition if necessary, and even use a totally different partition layout! I never encountered any problems on this route.

Regards, Clemens

On Friday 24 March 2006 05:00, David Liontooth wrote:
I cloned a drive, starting with the MBR:

  dd if=/dev/hda of=/dev/hdc  bs=446 count=1

However, after installing the cloned drive in the new machine, all I get
is a scrolling GRUB filling the screen. I downloaded an amd64 netboot
CD, mounted / and /boot in /target, and issued

    chroot /target

Everything in there works fine -- the applications run. (I'm sitting at
another computer at this point with remote access to the installer). But
what I was counting on working, namely

    grub-install  /dev/hda

which used to work on i386, maybe a year or two ago, now gives me
"/dev/hda: Not found or not a block device." If I do df, chroot sees
only this:

    Filesystem           1K-blocks      Used Available Use% Mounted on
sysfs                  7740384   3197252   4149944  44% /sys
df: `/dev/pts': No such file or directory
tmpfs                  7740384   3197252   4149944  44% /dev

In the installer shell, I get

~ # df
Filesystem           1k-blocks      Used Available Use% Mounted on
tmpfs                   102400     30248     72152  30% /
/dev/cdroms/cdrom0       86390     86390         0 100% /cdrom
/dev/ide/host0/bus0/target0/lun0/part2  7740384   3197252   4149944  44%
/dev/ide/host0/bus0/target0/lun0/part1    97826      9736     82871  11%

So it's using devfs, which I thought was deprecated? What do I tell

When I chrooted to /target, it rewrote /etc/fstab (why?), like this:

# /etc/fstab: static file system information.
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1 /dev/hda1 /boot ext3 defaults 0 2
/dev/hda5       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto  0       0

In dmesg, I get

NFORCE3-250: 0000:00:08.0 (rev a2) UDMA133 controller
    ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:DMA
klogd[245]: segfault at 000000000000003e rip 0000002a9568b94e rsp
0000007fbfffe2a0 error 6
hda: WDC WD800BB-75CAA0, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

Obviously /dev/hda is seen, since the chroot is running on it.

What can I do? All I want is to rewrite the MBR, the installation itself
is fine.


Reply to: