Duane Clark wrote:
> 
> Peter wrote:
> > Duane Clark wrote:
> >
> > > Greg Wright wrote:
> > > > cp /dev/hdx /dev/hdx     where x is a different drive should copy
> > > > everything, cannot comment on flaws though...
> >
> > > You will notice that the copy command he was using specified raw devices
> > > rather than a filesystem. In that case, cp does in fact preserve
> > > everything. In fact, there is no need to partition the new disk, because
> > > cp will create and copy over all the partitions, including extended
> > > partitions. This includes Linux, boot, and swap partitions, and even
> > > Windoze partitions. I do this on a semi-regular basis. But again, it
> > > really only works well on identical disks.
> >
> > This sounds good. What about a target disk that has already partitions in it?
> > Will cp write over them?
> >
> > Just thinking about keeping a backup disk in the machine and writing
> > everything there once in a while... Does one have to fdisk it to empty before
> > copying?
> 
> No need to empty the disk before copying. This method will overwrite
> everything, including the old partitions. It is doing a bit for bit copy
> of the disk, without regard for what those bits represent. One
> disadvantage is that it is also copying unused space on the disk, so it
> is not especially fast. Make sure you enable DMA on IDE disks, or it
> will take a VERY long time on a 40 GB disk. My 20 GB disks take 35
> minutes to copy.
> 
> Duane

I should add one more thing if you contemplate doing this. There is no
sanity checking done, and the command will not come back and ask you if
you REALLY want to obliterate the contents of /dev/hdb! So I strongly
recommend the use of a short script. I use a script called "cpdisk",
which looks like this:

hdparm -c 1 -d 1 -k 1 /dev/hda
hdparm -c 1 -d 1 -k 1 /dev/hdb
date
cp /dev/hda /dev/hdb
date

Duane



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to