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

Re: What's the reasonable time to mirror a hard disk?



hi ya yuwen 

how full is /dev/hda ???
	- if some of your partitions is 75% full... i would NOT use dd...
	( faster to do it manually

assuming that /var and /usr not too full but / is 80% full etc


check the dma status of your disk
	root#  hdparm /dev/hda
	root#  hdparm /dev/hdb

    to see the write/read xfer speeds
	root#  hdparm -tT /dev/hda

    turn dma mode on if its not set
	root#  hdparm -d1 /dev/hda

fdisk your /dev/hdb the same way or different way than /dev/hda
	-- remember that dd keeps the same original size partition

now copy your directories in each parititons...
	dd if=/dev/hda1  /dev/hdb1  bs=32k  ( / )
	# or #
	( tar cf - /bin /sbin /lib /boot ) | ( cd /mnt/hdb1 ; tar xvfp - )

	mount /dev/hdbxxx /mnt/xxx

	( tar cf - /var ) | ( cd /mnt/hdb2 ; tar xvfp - )
	( tar cf - /usr ) | ( cd /mnt/hdb3 ; tar xvfp - )

	-- add/delete partions as needed per your disk
	-- add missing dirs ... /tmp /.automount /.autofs ...

	-- you should be done within 1hr.... on celeron-500....
	15-30 min on P3-800

	-- chroot and fix lilo if you wanna boot off of the new /dev/hdb 

c ya
alvin


i'd do the following

On Mon, 22 Oct 2001, Noah Meyerhans wrote:

> On Mon, Oct 22, 2001 at 03:44:28AM +0000, Yuwen Dai wrote:
> > I have two identical hard disk linked with one cable.  The capacity of each 
> > disk is 40G.  I want to have the second disk be the mirror of the first disk 
> > by using this command:
> > 
> >   dd if=/dev/hda of=/dev/hdb bs=32k
> > 
> > Nearly 2 hours passed, dd still hadn't finished.  I had to press 'Ctrl-C' to 
> > stop it.  Is this the right way to mirror a disk?  Or is there some better 
> > way to do this?  Thanks in advance.
> 
> First of all, you'd probably be better off using dump and restore rather
> than dd.  dd will copy a block even if it's completely unused by the
> filesystem.  So if the drive you're backing up is only 25% full, then dd
> will take 4 times longer than dump, simply because it's copying a bunch
> of unnecessary blocks.
> 
> Also, you're probably better off moving these drives to separate
> controllers.  I don't remember all the details of it, but IDE has
> traditionally had a limitation that allowed a controller to only queue
> commands for a single drive at a time.  Such a limitation would have a
> major impact on performance in a case like this.  Unfortunately I can't
> provide you with a reference for this, and I don't know if it's still
> the case with modern IDE controllers.
> 
> noah
> 
> -- 
>  _______________________________________________________
> | Web: http://web.morgul.net/~frodo/
> | PGP Public Key: http://web.morgul.net/~frodo/mail.html 
> 



Reply to: