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

Re: Cloning hda to new internal disk (was Re: [debian-user] How to copy a laptop HD?)



On Tue, May 20, 2008 at 9:04 PM, Ron Johnson <ron.l.johnson@cox.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Gmail *sucks*, because it screws up reply nesting.  I have to
> manually fix it so that people (including me) how use sane MUAs can
> read it properly.
>
> On 05/20/08 21:50, Raj Kiran Grandhi wrote:
>> Ron Johnson wrote:
>>> On 05/20/08 15:55, Lee Glidewell wrote:
>>>> Have a look at partimage. Specifically you might be interested in the
>>>> CloneZilla live distro. It's built specifically for the purpose of
>>>> porting installations between hard disks.
>>
>>> In a similar vein to OP's question, I am going to buy a new boot
>>> disk, because my hda is old enough -- and drives are cheap enough --
>>> that I'd rather replace it before it fails.
>>>
>>> So I checked out CloneZilla, but it seems to be aimed at
>>> institutional use.  Even partimage seems to need an intermediary step.
>>
>>> Is there any way to directly clone /dev/hda to /dev/sdX, so that I
>>> can then boot off of /dev/sdX?
>>
>> If you can boot some live system, you can just partition your new disk,
>> mount them all, copy all your files over, fix /etc/fstab and
>
> I've tried doing what you suggest, but cp leaves absolute symlinks
> still pointing to the original files on the source device.

If you use "cp -a" you overcome this problem...  See:

http://tronprog.blogspot.com/2007/05/clone-partition-with-cp.html

Only problem is /proc, which can't be copied, the directory needs just
to be created and left alone...  My only problem with this approach is
that I couldn't make grub to boot.  I tried both grub-install
approaches, 1st using /dev/sda as the device) and
--root-directory=/mnt/sda6, and then using the chroot after doing all
necessary bindings...  None of them worked for me...  There's one left
which is unmounting hda6 (my old HD boot partition) from /boot and
mounting sda6 (my new HD boot partition) on it, using still /dev/sda,
to see if that works, this is the only one thing I haven't tried with
the "cp -a" approach...

>> /boot/grub/menu.lst, mount the new boot partition at /boot and run
>> grub-install /dev/sda. With this approach, you are free to change your
>> partitioning scheme.
>>
>> Alternatively, if your new partitions have the same layout but larger,
>> then you can use dd to clone each partition individualy, do a resize2fs
>> on each of them, then fix fstab and menu.lst before running a grub-install.
>
> - --
> Ron Johnson, Jr.
> Jefferson LA  USA

-- 
Javier


Reply to: