Page 1 of 1

[SOLVED] Need to recover /home after hard drive failure

PostPosted: Jan 3rd, '18, 20:01
by mark9117
Last night I lost the data drive on my desktop. I was unable to access a directory on it and the machine locked up. I rebooted and when it came back on it booted to rescue mode (or whatever the condition is called). I could login as root and check logs, but nothing on that drive could mount. Including /home.

I figured out which of the 3 drives in the box was at fault and dragged out a spare 3 TB replacement. It was bedtime and I packed it in for the night. I'll be trying to put this back together tonight, but as I think through the process, I'm unsure as to how I can get the disc partitioned and get enough /home restored from backups via BackupPC to get everything back in action.

I know I can access man files on fdisk (or whatever tool it will take) but I may be able to run drakdisk over ssh from my file server or a laptop. Trouble wit that is my user ssh credentials are in my /home directory and that's gone. I could be overthinking the whole thing.

Does anybody have any experience or tips on how to minimize the time and heartache involved in all this?

I do appreciate it.

Re: Need to recover /home after hard drive failure

PostPosted: Jan 3rd, '18, 21:09
by jiml8
Did you try fsck on the drive that has the problem? What you describe sounds to me like file system corruption, not a bad drive. Fsck will recover it if that is the case.

Re: Need to recover /home after hard drive failure

PostPosted: Jan 3rd, '18, 23:13
by mark9117
I did not think of that. Gracias for bringing it to my attention. I will whip fsck on it tonight.

I'll let you know.

Re: Need to recover /home after hard drive failure

PostPosted: Jan 4th, '18, 04:54
by jiml8
I keep multiple backups of everything...and you should too, if you value your data.

I also keep backups of the master boot records on all my hard drives. I do this differently for MBR and UEFI drives but I do it for both.

On encrypted partitions (which is every partition in my system except / ) I backup the encryption key section of the partition.

I have copies of these boot records and encryption records scattered...well...everyplace. There is an up to date copy of this info on my android phone. I am making sure that under any circumstances that information will be available to me so I don't lose data.

So, when I find myself with a bad drive, or a corrupted MBR, or a corrupted encryption table, I can recover without any particular trouble.

Just a comment...

Re: Need to recover /home after hard drive failure

PostPosted: Jan 4th, '18, 08:52
by mark9117
Spent about 45 minutes running fsck on /dev/sdb1 and it did the trick. My desktop is back! Again, I appreciate the assist.

Re: Need to recover /home after hard drive failure

PostPosted: Jan 4th, '18, 12:43
by isadora
Marking [SOLVED] Mark? :)