Jump to content
Sign in to follow this  

Getting data back onto the array from a failed disk swap

6 posts in this topic Last Reply

Recommended Posts

Hey everyone,


So I created a bit of a mess, and life has just been too busy to deal with it. I finally got a chance to try to address it, but I realized I better ask for some advice before I make things worse.


I am not exactly sure what happened, but here is the story. I had a drive fail and so I replaced it back in December (I think it was Dec). I do not know what I did wrong, but when I swapped in the new drive - the array did not rebuild the contents onto the new drive using parity. I put it in the slot of the old failed drive (disk 2 in my case), but I ended up with an empty disk 2 and parity must have been rebuilt at some point. At first, I didnt even realize what had happened. Then once I realized, I couldn't get the old drive to mount using the unassigned devices plugin and I did not have time to address it. Fast forward about a month and a half and the good news is after reseating the sata cable I can now mount up the old drive using unassigned devices. The files are there. But, meanwhile, my new disk 2 also has files on it. A few of my dockers (nextcloud and paperless) have files that they think are there in the db, but are missing on the actual filesystem. And outside of those apps there are files on the old disk that are no longer on the user shares.


So, how do I best get the missing files back onto the array? My first thought was to use rsync with  the '-ur' flags with the source of the old disk and the destination of the new disk. But then I realized that would probably create parity issues? So perhaps I should using rsync -ur with a source of the old disk and a destination of '/mnt/user/' ? The goal would be to copy any files or folders that are on the old disk, but not on the array. However, if there is a file that already exists on the array - don't overwrite it (since I have been running for about a month). Does that seem like the right approach? If so, any other rsync options I should use or is there something better I should do rather than rsync running in a tmux window?


Thank for any advice. Not sure how I fubar'ed the simple disk swap, but i will just admit my stupidity and ask for help to rectify the situation now.

Share this post

Link to post
21 minutes ago, daemian said:

Not sure how I fubar'ed the simple disk swap, but i will just admit my stupidity and ask for help to rectify the situation now.

This typically seems to result from people seeing an 'unmountable' disk and promptly formatting it (not realising this is also updating parity to say the disk is empty) and then rebuilding the (now empty) disk.   The latest Unraid releases have added a more prominent warning about the consequences of doing a format but I am sure there will still be those who ignore it :(

Share this post

Link to post

OK cool. Thanks to both of you. Does -ur seem like the appropriate rsync flags given the desired operations?

Share this post

Link to post

Use -a (archive) instead of -r, it includes -r and a lot of other good options, -u seems appropriate if there are newer files with the same name you want to keep on dest, also like to use -v, so -auv, you can run a dry run by adding -n (-nauv) first to make sure it's going to do what you want.

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this