Brent Saner on 20 Oct 2007 10:57:51 -0000


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

Re: [PLUG] How best to replace old drive with new drive

  • From: "Brent Saner" <brent.saner@gmail.com>
  • To: linux@jondz.net, "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
  • Subject: Re: [PLUG] How best to replace old drive with new drive
  • Date: Sat, 20 Oct 2007 06:57:43 -0400
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=F4GpRilXKHDzfFbF/asEmScX39P9OSZe9JjgyvhdwSo=; b=pQDUE8NpvoRmIT9ELbGDmyVy0ERkcxlb/LdohbJHAM2Xhfs0AxfIKmb8R9oFFgR1bmNnCxqpkqojRPtarM2NG2NjfEVQGj0Jsju+MmvEy4z/Zfc/3FLQ/9m4vx48iZKQgx+8Oy/H1+JjtzniGeeJim/rD0/E8rsPtMZNepcjJnk=
  • Reply-to: Philadelphia Linux User's Group Discussion List <plug@lists.phillylinux.org>
  • Sender: plug-bounces@lists.phillylinux.org

forgive me, as i usually do chrooting in gentoo. but have you tried:

chroot /mnt/hda1 /bin/bash

or

source /etc/profile

? might be worth a shot

On 10/20/07, jondz <linux@jondz.net> wrote:

On Fri, 2007-10-19 at 23:18 -0400, Mike Leone wrote:
> JP Vossen wrote:
> >> Date: Fri, 19 Oct 2007 12:36:34 -0400
> >> From: Mike Leone <turgon@mike-leone.com >
> >> Subject: [PLUG] How best to replace old drive with new drive
> >>
> >> So I've got a mail server that has an old HD. And I wanna replace it
> >> with a
> >> larger one, which I happen to have lying about. I know there's any
> >> number of
> >> ways to clone the HD (me, I like Ghost, but I also have DriveImageXML,
> >> and I
> >> suppose I could even do a dd). Anyways, if I were to Ghost to the new
> >> drive,
> >> what would I need to do to make grub run on it? I seem to remember doing
> >> this before, and getting a new drive with larger partitions, but grub
> >> wouldn't run.
> >>
> >> A pointer or clue, anyone? Something about booting a Knoppix LiveCD, and
> >> running "grub-install", I believe?
> >
> > "Simple" answer:
> > ----------------
> > 1) Install the new hard drive in the old machine
> > 2) Boot a LiveCD or into recovery or single user mode
> > 3) partition and format the new drive, then mount it +
> > 4) rsync the data over *
> > 5) chroot into the new drive's root
>
> I can't seem to chroot. I actually Ghosted the drive; made it the sole
> HD in the system; booted with Knoppix; did a "mount /dev/hda1
> /mnt/hda1"; then tried "chroot /mnt/hda1".
>
> It told me it couldn't find /bin/sh. And so I couldn't go forward from
> there.
>
> So what am I missing, that I can't install grub?


(I'm asuming you partitioned your original disk into many filesystems)

maybe /dev/hda1 is not root? maybe it was originally /boot ?

what does ls -l /mnt/hda1/ say?  ls -l /mnt/hda1/bin/sh ?

if /mnt/hda1 shows a bunch of grub files try /mnt/hda2 next, then other
partitions (a lot of installs used to allocate the first partition
as /boot).

doesnt hurt to mkdir /mnt/hdaX ; mount -o ro /dev/hdaX /mnt/hdaX to
check.

since the original disk is not there you can try out the partitions one
at a time and "guess" the contents.   try to locate the root first.  get
a list with fdisk -l /dev/hdX.  if you locate the root then you'll have
a list of the original paritions in /mnt/hdaX/etc/fstab.   if youve
splitted the original /boot you may have to do
mount /dev/hda1 /mnt/hda1/boot or something to make the new  / look like
the original one (so when you chroot it will look similar to the old
one).

hth,
jondz

>
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --         http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --         http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug



--
Brent Saner
215.264.0112 (cell)
215.362.7696(residence)

http://www.thenotebookarmy.org
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug