On Fri, 26 Mar 2004 09:12, Gareth Williams wrote: > On Fri, 26 Mar 2004 08:43, Christopher Sawtell wrote: > > On Fri, 26 Mar 2004 07:37, Paul William wrote: > > > Hi all, > > > > > > Is a simple dd: > > > dd if=/dev/hdc of=/dev/hdx > > > capable of 'cloning' hdc into hdx? > > > > if the two devices are identical, unconditionally, yes. > > if hdx is smaller than hdc, then effectively no. > > if hdx is larger than hdc, then yes, and you then have the opportunity to > > adjust the partitions after copying. imho, it's a better idea to > > partition the destination disk appropriately and do file copies of each > > partition using the cp utility in recursive mode. While this method will > > take longer it has the side benefit that any fragmented files will the > > made contiguous. > > Aha, excellent. I never thought of that benefit (getting rid of > fragmentation) of using cp. Of course to do that you then need to create > partitions again / create filesystems, copy files (ensuring you keep > ownership / permissions intact etc), reinstall your bootloader... it can > be a pain. Imaging the disk with dd is faster and simpler. I think I'll > still go with that unless it's severely fragmented. > > Thanks for this Christopher, you answered my question too (which I think > was pretty much the same question, doh. Need more coffee...). I now think > I'll just extend the last partition to fill up the disk, instead of > creating a new one. If I delete the entry for the last partition on the > disk, using fdisk, and then create a new one that starts at the same place > but ends at the end of the disk, all should be good I think :-) fingers > crossed (hey, if it breaks anything I can always just 'dd' the image back > again, hehe). I'd be very interested to know how this works out for you. I tried doing it that way once and made a mess. It might be better to use the 'parted' utility to change the size of the partition on the destination disk. There is a 'parted' boot diskette available too. http://www.gnu.org/software/parted/parted.html http://ftp.gnu.org/gnu/parted/
One other point that I forgot about earlier is that if your source disk is about to die, it could well have errors. Therefore it might be a very good idea to do a fsck on it, or on the mirrored file-system after you have copied it over using dd. I suppose it's a matter for debate when you do the check. -- Sincerely etc. Christopher Sawtell NB. This PC runs Linux. If you find a virus apparently from me, it has forged the e-mail headers on someone else's machine. Please do not notify me when this occurs. Thanks.
