Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to fix unformatted disk

Featured Replies

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

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.

 

  • 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).

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...)

  • 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:~#

 

--------------------------------------------------------------------------------

  • 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.

Stop the array. Then work on /dev/sdx1. If needed, you can rebuild a copy from parity.

You realize that dd stands for data destroyer.

Stop the array. Then work on /dev/sdx1. If needed, you can rebuild a copy from parity.

bad advice. (in my opinion)

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. 

 

 

  • 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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.