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

Re: dd if=/dev/hda



It'd be a real good idea to drop to single user mode, turn off any swap
partitions on the drive, and remount all the filesystems on that drive
as readonly first ("mount -o remount,ro /") before doing such a thing.
There's that whole thing with files being a series of blocks that point
to each other and directories being a pointer to all of the files inside.

It'd sure be not-so-good to, say, have a file (file1) whose first block
was physically located at the beginning of the disk with some space before
the next block.  The run of dd would copy the first block, then maybe
a program would recreate file1 by deleting and reopening it, and say maybe
another program was increasing the size of a seperate file (file2).  The
second program happens to get the free space where file1 used to be before
program1 recreates file1.  Now, dd has already copied file1's old first
block to the backup, but when it gets to where file1's second block should
be (and where backup fielsystem's file1's first block points to for file1's
second block), there's actually part of file2 in that space.  Oh, look, 
both files are screwed up.  Doh. :)

So, remount readonly before doing block-by-block backups.

--Danny, who would suggest using a RAID1 to begin with if the drives are
supposed to just be mirrors of each other...

On Mon, Apr 01, 2002 at 08:18:21PM -0600, Damacus wrote:
> 
> I used to do that to duplicate hard drives when I was helping one of my
> teachers set up a school computer lab at Springfield High School.
> 
> It worked just fine, as we made sure nothing else was running on the system...
> killing a couple processes first to prevent freak accidents.
> 
> One thing that would always happen, when we stuck the drive with data copied
> to it into another system, FSCK would run saying that the system hadn't been
> unmounted cleanly (ie, mtab showed it mounted, as that was the status of the
> mtab on dd time).
> 
> All in all, it's just a quick hack.
> 
> On Mon, Apr 01, 2002 at 05:35:29PM -0600, Charles Menzes wrote:
> > when i was working at my last job, i saw a guy doing something of a 
> > nightly "backup" on his system by doing
> > 
> >   dd if=/dev/hda of=/dev/hdc		
> > 
> > or something along those lines. i am not certain if there were any other 
> > flags being used or not. regardless, i remember someone in the unix group 
> > freaking out that it was being done. 
> > what are the risks of such an action? the guy doing it claimed he was well 
> > safe since the two disks being "mirrored" were identical, same brand, same 
> > model, etc... the guy complaining, complained with facts that were frankly 
> > way past my understanding. can someone comment on the why's not to do 
> > this? or why its okay.
> > 
> > thanks -c
> > 
> > 
> > -
> > To unsubscribe, send email to majordomo@luci.org with
> > "unsubscribe luci-discuss" in the body.
> 
> -- 
> --Damacus Porteng: damacus@munich.com & damacus@bastion.yi.org
> --Webpage: http://bastion.yi.org/~damacus/ (PGP on site)
> --IRC: net=irc.galaxynet.org nick=damacus chan=#cronus
> --Me: PHP Web Developer, Student, Computer/Linux Geek.
> --Car: 1993 Emerald Green Ford Taurus SHO (5spd) (110K mi.)
> --========== Nook's SFCs, SHOShop Y-Pipe w/ HiFlow cats
> --========== SHOShop T304 catback, PPlus Reinf. Mtr Mnts
> 
> -
> To unsubscribe, send email to majordomo@luci.org with
> "unsubscribe luci-discuss" in the body.

-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.