August 22, 201213 yr I was attempting to swap out another disk without losing parity yesterday when I made a mistake entering a command: dd if=/dev/zero bs=2048k of=/dev/md2 I had meant to fill zero's on /dev/md4 but typed in /dev/md2 instead. Disk 2 now shows it's unformatted even though there is data on it. How can I fix this or at least recover my data? Thanks in advance. syslog-2012-08-22.txt
August 22, 201213 yr I was attempting to swap out another disk without losing parity yesterday when I made a mistake entering a command: dd if=/dev/zero bs=2048k of=/dev/md2 I had meant to fill zero's on /dev/md4 but typed in /dev/md2 instead. Disk 2 now shows it's unformatted even though there is data on it. How can I fix this or at least recover my data? Thanks in advance. How long did you let it run? (if for any length of time at all, there is no recovery. You overwrote everything with zeros, and parity is in sync, so the only thing you could re-construct are exactly the same zeros you have now.) The operation you attempted is VERY HIGH RISK... and you lost. You would have been better off just setting a new disk configuration. All you can do now is format the disk. Once formatted you could possibly try a reiserfsck --rebuild-tree --scan-whole-partition /dev/md2 Depending on how much you zeroed, you might be able to recover a file or two.
August 22, 201213 yr Author Thanks Joe for responding. I let it run for a minute before I realized my error...I ran to shut down the server immediately (seemed like the sane thing to do at the time).
August 22, 201213 yr Well, you can try reiserfsck --check /dev/md2 and see what it instructs you to do. If only zeroed for a few minutes, you MIGHT be able to get it to repair the file-system. If it does ask you to rebuild the superblock, be aware,the default answers to its prompts are NOT the correct choices. (You'll have to search in older posts for the correct values...)
August 22, 201213 yr Author Well I got this: --------------------------------------------------------------------------------- root@unRAID:~# reiserfsck --check /dev/md2 reiserfsck 3.6.21 (2009 www.namesys.com) ************************************************************* ** If you are using the latest reiserfsprogs and it fails ** ** please email bug reports to [email protected], ** ** providing as much information as possible -- your ** ** hardware, kernel, patches, settings, all reiserfsck ** ** messages (including version), the reiserfsck logfile, ** ** check the syslog file for any related information. ** ** If you would like advice on using this program, support ** ** is available for $25 at www.namesys.com/support.html. ** ************************************************************* Will read-only check consistency of the filesystem on /dev/md2 Will put log info to 'stdout' Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes reiserfs_open: the reiserfs superblock cannot be found on /dev/md2. Failed to open the filesystem. If the partition table has not been changed, and the partition is valid and it really contains a reiserfs partition, then the superblock is corrupted and you need to run this utility with --rebuild-sb. root@unRAID:~# --------------------------------------------------------------------------------
August 23, 201213 yr Author Before I go ahead with the rebuild-sb option, is there anyway to get a little extra "insurance" in case this rebuld superblock thing doesn't work. What if I "replace" the unformatted disk with a warm spare and let it rebuild, what would be the outcome then? Would it come out unformatted as well and I then can try the rebuild-sb on that rebuilt drive while keeping the original drive for other recovery options? Thanks in advance.
August 23, 201213 yr Stop the array. Then work on /dev/sdx1. If needed, you can rebuild a copy from parity.
August 23, 201213 yr Stop the array. Then work on /dev/sdx1. If needed, you can rebuild a copy from parity. bad advice. (in my opinion)
August 23, 201213 yr Before I go ahead with the rebuild-sb option, is there anyway to get a little extra "insurance" in case this rebuld superblock thing doesn't work. What if I "replace" the unformatted disk with a warm spare and let it rebuild, what would be the outcome then? Would it come out unformatted as well and I then can try the rebuild-sb on that rebuilt drive while keeping the original drive for other recovery options? Thanks in advance. Yes, that approach would work.
August 23, 201213 yr Author Thank you both for your help. I will go ahead and rebuild the drive using the warm spare and parity for the extra "insurance". I will need a bit of hand holding with rebuilding the superblock later on since I'm not exactly linux savvy. Thanks again.
Archived
This topic is now archived and is closed to further replies.