Help Failing Disk Problem

Jon Hamilton hamilton at pobox.com
Mon Nov 5 19:03:58 PST 2007


James <jamesh at lanl.gov>, said on Mon Nov 05, 2007 [03:16:46 PM]:
} On Mon, 2007-11-05 at 14:04 -0700, Warren Block wrote:
} 
} > On Mon, 5 Nov 2007, James wrote:
} > 
} > > On Mon, 2007-11-05 at 11:53 -0800, Sean Murphy wrote:
} > >
} > >> I have a FreeBSD 6.2 Release box with a single ide that has user data
} > >> and the FreeBSD OS on a hard disk that is failing.  I need advice on the
} > >> best way to clone the entire disk (or at least the data) onto a larger
} > >> ide disk drive, then pull the failing disk and replace it with the
} > >> clone.  What is the best way in FreeBSD to do that?
} > >
} > > The best way is to do it regularly before the hard drive is failing.
} > >
} > > Given that you haven't done that, there're a few methods. I'm a big fan
} > > of rsync,  which is the nectar of the gods, but a lot of folks seem to
} > > prefer dd for this kind of thing.
} > 
} > rsync is too high-level, and may not do exactly the right thing with 
} > links or sparse files or who knows what. 
} 
} rsync -cav takes cares of symlinks and all that just right. It's a
} beautiful thing.
} 
} Checksumming, too. Ah, bliss.

Reading the man page, I believe that will make copies instead of hard links
for files with more than one link.  By my reading, you'd have to specify -H 
in addition.  As others have pointed out, if you're using ACLs or other 
extended attributes, those may be lost as well.  

This is why I think _in principle_ using a tool which has as its sole purpose
in life the backup and restore, unmolested, of filesystems, is the best 
general approach to this problem.  Other tools may work too, but you have
to put a lot of thought and care into getting 473 of their 1692 command line
options right (made up numbers, obviously) and that's never good when you're
in the heat of the moment and your data is at stake.

} dump has the problem that a lot of tools have, though, including rsync.
} It creates a file list to start from. 
} 
} If the file names on the drive change during the dump, corruption can
} occur. At least on linux. I remember Torvalds ranting about it on a
} mailing list. I imagine FreeBSD suffers the same issue, though, as it's
} a pretty generic problem.

Use dump (or anything else, for that matter) on a snapshot.

Of course, all bets are off since the disk is already failing.  The common
case is that the OP may get "most" of the files off in tact; probably not all.
Backups are important if you care about your data.

-- 

   Jon Hamilton 
   hamilton at pobox.com


More information about the freebsd-questions mailing list