How to recover files from Synology NAS HDD in Ubuntu

Discuss backup and restore functions of the DiskStation with respect other DiskStations, USB/eSATA, network backup, or other rsync clients.
Forum rules
This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:
https://myds.synology.com/support/suppo ... p?lang=enu
Gondy
Trainee
Trainee
Posts: 19
Joined: Wed May 02, 2012 8:44 pm

How to recover files from Synology NAS HDD in Ubuntu

Postby Gondy » Sun May 13, 2012 2:33 pm

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-usb-installer-easy-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.
Last edited by Gondy on Mon Jun 04, 2012 11:57 pm, edited 1 time in total.
User avatar
myCloud
Skilled
Skilled
Posts: 648
Joined: Fri Mar 23, 2012 11:28 am

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

Postby myCloud » Sun May 13, 2012 3:07 pm

Thank you for this contribution to the forum!
DS 1512+ w/3GB, 5 x 3TB Seagate ST3000DM001 8.2TB RAID 6, half files/half Time Machine.
Icy Dock MB559U3S-1SB enclosure w/4TB Hitachi UltraStar via USB 3 for files backup
UVERSE to AirPort Extreme + 2 AirPort Express w/speakers. TRENDnet TV-IP312WN camera
CyberPower CP1500PFCLCD Sine Wave UPS
DSM 4.1-2661 w/SSH + SFTP, VPN Server, Syslog Server, Media Server, Mail Server, Mail Station,
Audio Station, Surveillance Station, Photo Station, Web Station - DS Apps on iPad & iPod Touch.
plastic1
I'm New!
I'm New!
Posts: 2
Joined: Wed Nov 30, 2011 7:11 pm

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

Postby plastic1 » Thu May 24, 2012 1:59 am

Just made use of this now! A real asset to the Linux noobs such as myself! 8) Thanks!
pimseb
Trainee
Trainee
Posts: 13
Joined: Thu May 24, 2012 12:02 pm

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

Postby pimseb » Thu May 24, 2012 12:22 pm

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 ?
Steph
Enlightened
Enlightened
Posts: 403
Joined: Wed Nov 22, 2006 12:26 pm

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

Postby Steph » Fri May 25, 2012 9:29 am

Thanks for the contribution! Highly appreciated!

Now what are the possibilities if your Synology NAS uses RAID ... :-/ ?
eik
I'm New!
I'm New!
Posts: 2
Joined: Mon May 28, 2012 7:26 am

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

Postby eik » Mon May 28, 2012 7:36 am

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!
Gondy
Trainee
Trainee
Posts: 19
Joined: Wed May 02, 2012 8:44 pm

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

Postby Gondy » Mon Jun 04, 2012 11:55 pm

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.
User avatar
delebre
Student
Student
Posts: 64
Joined: Wed Jun 06, 2012 6:51 pm

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

Postby delebre » Sat Jun 09, 2012 1:47 am

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.
Gondy
Trainee
Trainee
Posts: 19
Joined: Wed May 02, 2012 8:44 pm

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

Postby Gondy » Sat Jun 09, 2012 8:34 am

Ext2Fsd didn't worked for me, because it does not support RAID array and LVM.
User avatar
delebre
Student
Student
Posts: 64
Joined: Wed Jun 06, 2012 6:51 pm

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

Postby delebre » Sat Jun 09, 2012 8:38 am

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
adgud
Novice
Novice
Posts: 57
Joined: Thu Sep 09, 2010 9:24 pm

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

Postby adgud » Tue Jun 19, 2012 1:03 am

Brilliant topic, saved me lots of time, may thanks Gondy!
http://forum.synology.com/enu/viewtopic.php?f=10&t=38457 - Syno Download Redirector - extension for Opera browser
crashnburn
Experienced
Experienced
Posts: 102
Joined: Thu Aug 07, 2008 7:38 pm

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

Postby crashnburn » Fri Jul 06, 2012 8:21 pm

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?
rpark
I'm New!
I'm New!
Posts: 3
Joined: Thu Jul 07, 2011 11:01 pm

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

Postby rpark » Wed Jul 11, 2012 1:46 pm

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.
crashnburn
Experienced
Experienced
Posts: 102
Joined: Thu Aug 07, 2008 7:38 pm

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

Postby crashnburn » Wed Jul 11, 2012 6:19 pm

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.
crashnburn
Experienced
Experienced
Posts: 102
Joined: Thu Aug 07, 2008 7:38 pm

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

Postby crashnburn » Thu Jul 12, 2012 9:15 pm

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.

Return to “Backup/Restore for DiskStation to DiskStation/USB/eSATA/Off-site backups”

Who is online

Users browsing this forum: No registered users and 2 guests