[SATLUG] Restoring files from a corrupted drive

Bruce Dubbs bruce.dubbs at gmail.com
Tue Dec 15 22:57:10 CST 2015

Alan Lesmerises wrote:
> Some of you may recall that I asked for some assistance a few months ago
> when I needed to recover from having my laptop hard drive get corrupted.
> I had to set it aside for a while, but now I have the time to spend to try
> to fix it.
> Background:
> I was running CentOS 7, and had formatted my drive as xfs, and when I had
> to do a hard reboot, the journal file got hosed and nearly all of the
> files on the OS partition were screwed-up and unrecoverable.
> The first thing I did was remove the old hard drive (it was OK; I just
> wanted to preserve everything that remained) and put in a new hard drive.
> I took images of the partitions and tried the various recovery approaches
> recommended for an xfs partition (to rebuild the journal, etc.), but
> nothing worked.
> After that, I tried re-constructing the OS on the new hard drive with the
> thought that I might be able to copy-over the files from a complete backup
> I had done, but that didn't work.  There appears to be 2 main problems
> with this approach.  First, the UUIDs assigned for the new hard drive &
> partitions are different, so anywhere the UUIDs are used or referenced,
> they don't match anymore.  Second, since having this bad experience with
> xfs, I don't want to go through this headache again and switched my OS
> partition to ext3, which means that everywhere the various configuration
> files are expecting an xfs filesystem they're now not finding what they're
> looking for.
> The Question:
> Any suggestions as to how to proceed?  I've resisted doing anything with
> the old hard drive, but I do recognize that using it would solve the UUID
> problem.  However, how can I address changing the filesystem from xfs to
> ext3.  A grep search of files that includes the term "xfs" returned what
> appeared to be thousands of files, and only a fraction of those would need
> to be modified -- but which ones???  Would that even be feasible???
> If I changed the partition back to xfs and then restored the files to it,
> is it possible to switch a live filesystem from xfs to ext3?

I don't have any experience with xfs but I'd start with installing a new 
system on an ext4 partition.  Then add the 2nd drive and try to do any 
recovery or mounting from there.

The only places UUID is used that I know about would be in grub.cfg and 
fstab.  You can alwayws get around that by using /dev/sd?? in those 
configuration files.

   -- Bruce

More information about the SATLUG mailing list