Page 1 of 17

How to recover files from Synology NAS HDD in Ubuntu

Posted: Sun May 13, 2012 2:33 pm
by Gondy
Recently my Synology DS210j crashed after update and no longer boot (just orange status LED blinking). So I need to find a way to recover my files, because I was afraid re-installing DSM software will erase my data. After a few desperate hours fighting with Linux I found a way how to recover files for free using Ubuntu Linux.

So I wrote steps manual what to do if you want to recover files from your NAS hard drive.

I dismounted hard drive from Synology NAS device. I recall that file system on disk is not corrupted and HDD is not broken. Just Synology software crashed after update. You need to connect HDD to computer, you can insert and connect it directly into desktop computer via SATA cables or use e-Sata connector (my case).
  1. Create Ubuntu bootable USB flash stick.
    We will start Ubuntu from USB stick, so no OS installation is needed and no changes will be made. Download Ubuntu desktop ISO file and USB installer from url's below:
    http://www.ubuntu.com/download/desktop
    http://www.pendrivelinux.com/universal- ... -as-1-2-3/
    Set some persistent file size for storing changes (at least 400 MB). edit: eik's post
  2. Boot Ubuntu from USB stick.
    Connect NAS HDD and USB stick to computer, then turn it on. Select boot from USB stick (press Esc or F12, depends on computer, for boot menu and select your USB device. In first menu, select first option 'Run Ubuntu from this USB'.
  3. Check HDD drive.
    When desktop boots, press Windows key (it's funny, I know, but it works) and type Disk. You should see Disk Utility icon. Double click it. You should see an Extended Partition and RAID component.
    Image
  4. Install RAID drivers.
    Now we need to install Linux RAID driver. Press Win key, search for Terminal and run it. Type this and press enter: It will require Postfix installation, install it and select 'No configuration' in installation menu.

    Code: Select all

    sudo apt-get install mdadm
    Now we will search and assemble RAID arrays.

    Code: Select all

    sudo mdadm --assemble --scan
    Open Disk Utility again and you should see RAID array components. See picture:
    Image
  5. Install LVM2 driver.

    Code: Select all

    sudo apt-get install lvm2
    sudo vgscan --mknodes
    
    Now run Disk Utility, select "vg1" in "Multi-disk Devices" option. Select "Start Volume Group". Now you should be able to see new device in list - "1.41.3-1167" for me.
    Image
    Here are all your files.
Now you can copy and backup your files.

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Sun May 13, 2012 3:07 pm
by myCloud
Thank you for this contribution to the forum!

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Thu May 24, 2012 1:59 am
by plastic1
Just made use of this now! A real asset to the Linux noobs such as myself! 8) Thanks!

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Thu May 24, 2012 12:22 pm
by pimseb
I just made that in order to copy files from my ubuntu computer into my NAS. I put the synolgy-formated drive into my desktop computer, followed your tutorial, copied files from the computer to harddrive and then put the harddrive in the nas again.
The problem is that the files I've copied aren't shown into DSM filemanager. Any idea why ?

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Fri May 25, 2012 9:29 am
by Steph
Thanks for the contribution! Highly appreciated!

Now what are the possibilities if your Synology NAS uses RAID ... :-/ ?

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Mon May 28, 2012 7:36 am
by eik
Thanks Gondy.
I too had a crash where the system partition failed (NAS was still running, single drive). When the NAS restarted it consequently lost the configuration.

I used Ubuntu 12 Desktop. Initially I tried with 100MB of persistent space but that failed. In the end it worked with 400MB. All still fits on a 2GB memory stick.

After installing the lvm drivers it stil could not identify a volume group. So after hovering with my mouse over the "start volume group"in the screen shot you showed I decided to click it. Surprise (to me :P )it all worked. I could mount the volume and copy off all the data.

I couldn't figure out where the configuration was sitting so I reconfigured the Synology on a new disk. The old disk I will add to the system as redundancy later.

Thanks again for the effort of documenting it. Great contribution!

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Mon Jun 04, 2012 11:55 pm
by Gondy
pimseb wrote:I just made that in order to copy files from my ubuntu computer into my NAS. I put the synolgy-formated drive into my desktop computer, followed your tutorial, copied files from the computer to harddrive and then put the harddrive in the nas again.
The problem is that the files I've copied aren't shown into DSM filemanager. Any idea why ?
I don't know really, I haven't tried it opposite way. First of all, where you have copied your files? They must (I think) be in shared folder you created in Synology DSM. For example shared folders are 'music', 'video', 'photo' and your own ('storage' in my case). Second, maybe there is problem with file system permissions. You copied your files as 'ubuntu' user and synology cannot read files then. Maybe, I'm just guessing.

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Sat Jun 09, 2012 1:47 am
by delebre
mod note: added link to Synology Knowledgebase: How can I recover data from my DiskStation using a PC?

For Windows users, you can try/use Ext2Fsd. It's a free program as well.
http://www.ext2fsd.com/

I mounted it as read only. A personal note.. I couldn't get TeraCopy to work nice with it, but the Windows copy program worked flawlessly. Made a perfect backup.

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Sat Jun 09, 2012 8:34 am
by Gondy
Ext2Fsd didn't worked for me, because it does not support RAID array and LVM.

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Sat Jun 09, 2012 8:38 am
by delebre
I had a RAID1 (ext3) and got it working swimmingly.. Though I didn't use LVM.

Try this?
http://ext2read.blogspot.com/2010/04/ex ... 2-and.html

Re: How to recover files from Synology NAS HDD in Ubuntu

Posted: Tue Jun 19, 2012 1:03 am
by adgud
Brilliant topic, saved me lots of time, may thanks Gondy!

How? Mount, Find & Recover DATA in HDD out of Synology Box

Posted: Fri Jul 06, 2012 8:21 pm
by crashnburn
How? Mount, Find & Recover DATA in HDD out of Synology Box

Many times I've run into issues of Synology or Hard Drive corruption/ error in sectors etc. where I have had to pretty much remove the Drive which Synology refuses to read or work with.

In such scenarios I am hoping I could use a bunch of Hard Drive recovery tools that I have after attaching the Disk to a PC/Box or Laptop via USB enclosure.

The question is, assuming I am able to detect the Hard Drive and assuming that hardware is still kind of functional, what way can I LOAD/ MOUNT the Drive (under Windows or Linux OS etc) on a PC/Laptop? (What tools/ software should I used to do that?)

I've used several Partition Management tools and I can see 4 partitions inside the Disk as created by Synology.

But, I cant seem to figure out a way to LOAD/ MOUNT the Data Volume where Synology stores my data.

Once that volume/partition is loaded (assuming there is some software/tool that can do that), how do I FIND where my DATA files and folders are stored, so that I can copy them off the Disk.

If it was a DIY Server using an OS & Partition type I had insights on it would be easy to figure out where the DATA is and attempt to recover it.

How can I do that for drives that get "messed up" inside the Synology Box?

Re: How? Mount, Find & Recover DATA in HDD out of Synology B

Posted: Wed Jul 11, 2012 1:46 pm
by rpark
No answer for you, I've got the exact same problem. I've tried various ext4 reading windows programs, all of which can see the drive & partitions, but none of which have been able to recover data (geeksnerds, stellar phoenix, linux reader, explore2fs, ext2explore, none of which allowed me to copy, recover or even see data files).

Surprisingly, the drives do not auto mount in Ubuntu 12.04 either. Good luck.

Re: How? Mount, Find & Recover DATA in HDD out of Synology B

Posted: Wed Jul 11, 2012 6:19 pm
by crashnburn
I have even made several support tickets with Synology but have not had any success or clear insight s from them how to recover data when Synology starts messing up.

Re: How? Mount, Find & Recover DATA in HDD out of Synology B

Posted: Thu Jul 12, 2012 9:15 pm
by crashnburn
rpark wrote:No answer for you, I've got the exact same problem. I've tried various ext4 reading windows programs, all of which can see the drive & partitions, but none of which have been able to recover data (geeksnerds, stellar phoenix, linux reader, explore2fs, ext2explore, none of which allowed me to copy, recover or even see data files).

Surprisingly, the drives do not auto mount in Ubuntu 12.04 either. Good luck.
Makes me want to not go for a proprietary solution like Synology in the future.