Re: how to clone a Linux hard disk?
From: Leon. (noemail_at_noemail.noemail.com)
Date: 12/30/03
- Next message: learner: "Re: Serious flaw in LFS (Linux From Scratch) system build?"
- Previous message: Milt Epstein: "Re: Linux and A7N8X Deluxe: audio problems"
- In reply to: Larry Gagnon: "how to clone a Linux hard disk?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Dec 2003 09:46:38 +1100
> I am a newbie to the Linux world (2 months). From my reading "dd" may work
> for this task as the next batch of computers we will work on all have the
> same model and size of hard disks. However, I understand 'dd' will not
work
> if either disk is mounted?
well, almost correct. if they are mounted read/write, they are liable to
have new data written and the data written would then be corrupt...
However if the read drive is mounted "read only", then that doesnt cause a
problem...
>
> Ideally what I would like is easy to use software that clones one HD at a
> time from a master, mounted HD using the MASTER-SLAVE EIDE cable
> arrangement (including MBR, lilo, etc.) without:
>
> 1) having to partition and format each new HD
> 2) unmounting the master HD
> 3) a long rigamaroule of CLI commands (except for perhaps an easy bash
> script)....
Well to do it just like that ...
-------------------------------------------
telinit 1
mount -o remount,ro / (and repeat for other partitions)
sync
dd if=/dev/hda of=/dev/hdb
sync
mount -o remount,rw /
------------------------------------------
Its only a few lines of CLI, and nothing wrong with a script.
just put the lines in a file called 'clonedrive' in /root/utils
and run '. /root/utils/clonedrive'.
Ah the new partitions wont be visible until you reboot...
OR you write a 'new' partition table to the drive.
So you check the partitions with '/sbin/fdisk /dev/hdb'
and then if its happy use 'wq' to write and quit from fdisk.
then the partitions on hdb would be accessable.
You could add 'shutdown -h now' to the script when you have decided that
the process works smoothly.
If you cant get the same hard drive model, you need to get a larger drive !
Be careful when you buy the hard drives , because drives of different
models that are sold as '60 gigabytes' are actually all sorts of sizes ..
between 55 and 65 gigabytes. You need to compare the actual size.
If you do get a larger drive that contains significant extra space (or you
just want to perfect this process) ,you can then reclaim the wasted space by
adding it to the last partition on the drive..
Run fdisk /dev/hdb , delete the last partition , and add it back to take up
the entire space. as the start of the partition is at the same place there
is no damage done to the partition...
Run the resize utility for the filesystem (eg e2resize of e2fs,e3fs ... )
you just have to read the manual page to see how to tell it to grow .. by
default it should grow to fill the available space...
> I have looked at "mondo" as a solution, but have not yet tried it. Does
> anyone have a good, easy suggestion to help us with our task? Will mondo
do
> this job?
there's a few others available free.
eg ranish partition manager.
it can clone drives .. but cant fix the larger hard drive problem.
>
> Larry Gagnon
> --
> ********************************
> to send direct email remove "fake"
- Next message: learner: "Re: Serious flaw in LFS (Linux From Scratch) system build?"
- Previous message: Milt Epstein: "Re: Linux and A7N8X Deluxe: audio problems"
- In reply to: Larry Gagnon: "how to clone a Linux hard disk?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|