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
1) 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://account.synology.com/support/su ... p?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
User avatar
bildungsroman
I'm New!
I'm New!
Posts: 8
Joined: Sun Dec 27, 2015 1:01 am

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

Unread post by bildungsroman » Wed Jan 03, 2018 12:58 am

maxxfi wrote:If it was a basic disk it should be easy to mount in Ubuntu. If it was a SHR volume (even if with a single volume), it's a bit more complicated to mount, but the instructions in this thread should be sufficient.
I have a failed SHR volume (it failed while changing out HDs for larger ones, and won't work with my ds215j anymore). I'm running Ubuntu on my Mac, but none of the instructions concerning mdadm in this thread have worked. mdadm always returns "No arrays found in config file or automatically" for mdadm --assemble --scan, and I can't mount the drive though it does show up in disk utility as a 3.0 TB Unknown volume.

Any help would be appreciated! This is happening with both disks in my 2-disk SHR (mirrored) array, so now the data I had meticulously backed up and mirrored is completely inaccessible.

User avatar
bildungsroman
I'm New!
I'm New!
Posts: 8
Joined: Sun Dec 27, 2015 1:01 am

Re: Saving out data from "Crashed/Read-only" drive

Unread post by bildungsroman » Wed Jan 03, 2018 1:17 am

tomas wrote:Hello.

I had a drive crashed and was put into read only mode. I have now new drive and fresh DSM installed.

I wanted to copy the files from the crashed drive using this http://www.synology.com/en-us/support/faq/579 with not much luck, the process ended after I typed "root@ubuntu:~$ mdadm –Asf && vgchange -ay" after which I got a message "No arrays found in config file or automatically"

It's true that I have been using only one drive, but as far as I remember when I was installing that drive, I kept the default option to use it as raid/shr. Drive appears in ubuntu, in the disk utility as having "unknown" file system. In Disk station it appears as "Not Initialized".

Using this software -> http://www.cgsecurity.org/wiki/PhotoRec I was able to "mount" the drive in Windows and PhotoRec can even copy all the files from the drive (and the extracted files work, images are open, music plays without problems). Problem is that folder structure, folder names and filenames are random letters and numbers which would make it extremely hard to actually sort the files and make them practically usable.

The fact that PhotoRec can extract working files from the drive lead me to believe that drive is more or less ok and I'm just doing something wrong under ubuntu. I really would like to be able to copy the files with their original names and folder structure.

I contacted Synology tech support but the seems like only solution is to give remote access to the DiskStation which is not feasible for me for different (network) technical reasons.

I was hoping that maybe someone may have an idea for what I could try to do.

Thanks
Did you ever find a solution? I'm in the exact same situation: my volume crashed after I tried installing new drives in my ds215j, the mirrored hard drives both show one "Unknown" volume in Ubuntu, and mdadm says "No arrays found in config file or automatically". PhotoRec does show that there are files but they're all disorganized and would take me years to re-organize. Any help would be greatly appreciated!

User avatar
bildungsroman
I'm New!
I'm New!
Posts: 8
Joined: Sun Dec 27, 2015 1:01 am

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

Unread post by bildungsroman » Wed Jan 03, 2018 3:48 am

Hi all! I've read all the way through this forum, tried everything, and I still can't read the data off my former Synology SHR drive.

My situation: I've used my ds215j for two years with no issues. It's set up as an SHR mirrored array with two Seagate NAS drives. A few months ago, I was running low on space on my 3TB drives and decided to upgrade to two 8TB Seagate NAS drives. I put the new drives in to make sure they were OK (they were ordered online, you never know), then took them out and put my old drives back in just as they had been to begin the transfer process. Lo and behold, my ds215j starts beeping at me: my previously-working volume is now crashed! The ds215j itself is fine, because I put the new disks in and initialized them and they're working well, but now I don't have my precious data, and when I contacted Synology support they asked to SSH into my old drives, which is impossible because I can no longer access DSM when those drives are in the ds215j - it just beeps at me until I shut it down manually.

I booted into Ubuntu from a USB stick on my MacBook, connected one of the old drives through an external USB3 enclosure, and followed this guide: https://www.synology.com/en-us/knowledg ... using_a_PC. At #11 I got stuck:

Code: Select all

root@ubuntu:~# mdadm -Asf && vgchange -ay
mdadm: No arrays found in config file or automatically
Then I found this forum, and despite the excellent guide from Gondy, mdadm --assemble --scan returns:

Code: Select all

mdadm: No arrays found in config file or automatically
Nothing else has worked, but I'll post my terminal readouts in hopes that someone can help me access my data (/dev/sdd is the drive). It's really sad that despite having mirrored backups in the event that one of the hard drives failed, I'm still stuck potentially losing all of my photos and music because the file system failed instead :(

Code: Select all

root@ubuntu:~# mdadm -Asf && vgchange -ay
mdadm: No arrays found in config file or automatically

root@ubuntu:~# mdadm --assemble --scan
mdadm: No arrays found in config file or automatically

]root@ubuntu:~# mdadm -C /dev/md3 -R -l1 -n1 -f /dev/sdd
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md3 started.
root@ubuntu:~# mount /dev/md3 /volume2
mount: mount point /volume2 does not exist

root@ubuntu:~# fsck.ext4 -v /dev/md3
e2fsck 1.42.13 (17-May-2015)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/md3

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

root@ubuntu:~# fdisk -lu
Disk /dev/loop0: 1.4 GiB, 1532116992 bytes, 2992416 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 2.7 TiB, 3000592982016 bytes, 5860533168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 233.8 GiB, 251000193024 bytes, 490234752 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: D5AFC947-2BA1-47B1-8DA8-E8054F1D1871

Device      Start       End   Sectors   Size Type
/dev/sda1      40    409639    409600   200M EFI System
/dev/sda2  409640 490234711 489825072 233.6G unknown


Disk /dev/sdc: 29.3 GiB, 31406948352 bytes, 61341696 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: EA5C98BD-AA0E-4A8A-A825-D7E62A991E9D

Device       Start      End  Sectors  Size Type
/dev/sdc1       40   409639   409600  200M EFI System
/dev/sdc2   409640  2558071  2148432    1G Apple HFS/HFS+
/dev/sdc3  2820216 61079511 58259296 27.8G Microsoft basic data


Disk /dev/sdd: 2.7 TiB, 3000592982016 bytes, 732566646 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33550336 bytes


Disk /dev/md3: 2.7 TiB, 3000458739712 bytes, 732533872 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33550336 bytes


root@ubuntu:~# mdadm --examine /dev/sdd
/dev/sdd:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : dfa00e88:a350187b:82bebfd6:9bf6314f
           Name : ubuntu:3  (local to host ubuntu)
  Creation Time : Tue Jan  2 17:49:11 2018
     Raid Level : raid1
   Raid Devices : 1

 Avail Dev Size : 5860271024 (2794.40 GiB 3000.46 GB)
     Array Size : 2930135488 (2794.40 GiB 3000.46 GB)
  Used Dev Size : 5860270976 (2794.40 GiB 3000.46 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
   Unused Space : before=262056 sectors, after=48 sectors
          State : clean
    Device UUID : 38eedabe:b1cf7aed:98302f28:aa7044d5

Internal Bitmap : 8 sectors from superblock
    Update Time : Tue Jan  2 17:55:28 2018
  Bad Block Log : 512 entries available at offset 72 sectors
       Checksum : 8cb9e32f - correct
         Events : 2


   Device Role : Active device 0
   Array State : A ('A' == active, '.' == missing, 'R' == replacing)

root@ubuntu:~# mdadm --detail /dev/md3
/dev/md3:
        Version : 1.2
  Creation Time : Tue Jan  2 17:49:11 2018
     Raid Level : raid1
     Array Size : 2930135488 (2794.40 GiB 3000.46 GB)
  Used Dev Size : 2930135488 (2794.40 GiB 3000.46 GB)
   Raid Devices : 1
  Total Devices : 1
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Tue Jan  2 17:55:28 2018
          State : clean 
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : ubuntu:3  (local to host ubuntu)
           UUID : dfa00e88:a350187b:82bebfd6:9bf6314f
         Events : 2

    Number   Major   Minor   RaidDevice State
       0       8       48        0      active sync   /dev/sdd
Any help would be greatly appreciated!!

tydell
I'm New!
I'm New!
Posts: 1
Joined: Thu Jan 11, 2018 3:56 pm

DS216J hard disk crashed

Unread post by tydell » Thu Jan 11, 2018 4:10 pm

My hard drive (WD caviar red 3TB WDG30EFRX) just crashed in my synology DS216J. The drive was about 1 year old.
I dont have any raid or redundancy set up. Just the 3TB and another 500GB in the other bay.
At the time I dont have enough money to get another 3TB drive.

I'm not an expert, the NAS mainly used to store photos and videos.
So I need some help/guidance to help to restore my data if it is still possible.

Thanks in advance.

soulforged
I'm New!
I'm New!
Posts: 4
Joined: Mon Dec 04, 2017 11:32 pm

Re: Using the disk from one NAS in another

Unread post by soulforged » Tue Jan 16, 2018 4:46 pm

sincarne wrote:load linux on USB drive do not use windows application to try and load linux file system
Hello, hope you all had a great start to the new year...

Updates from my end on the effort to recover data from my disk -

I tried loading linux using USB but the mdadm utility did not find any raid volumes :(

A recap of my situation -
I had a DS212j with two disks in SHR
Now I only have one of the HDD (the one that was put in second into the NAS)
I do not have access to the NAS or the primary HDD
I wish to recover the data from the HDD but so far no success
I have tried the USB linux method recommended in the knowledgebase

As a last ditch effort, I have bought a used DS212j off ebay. It should be with me this week. Can I just plug in the HDD to it?

I have been going through the tutes and articles in the knowledge base but I'm not able to get a definitive answer to my situation. Maybe I am misreading or looking in the wrong place. I would be very grateful if someone could point me in the right direction.

Thanks!

suffolk_
I'm New!
I'm New!
Posts: 1
Joined: Wed Feb 21, 2018 11:24 am

Diskstation fused

Unread post by suffolk_ » Wed Feb 21, 2018 11:29 am

I turned on my synology DS212 and there was a bang and the all the lights went out

There's not much on the disks except my 80GB music library

I'd like to recover that, any ideas?

telos
Ace
Ace
Posts: 717
Joined: Mon Sep 23, 2013 6:12 pm

Re: Diskstation fused

Unread post by telos » Wed Feb 21, 2018 8:44 pm

suffolk_ wrote:I turned on my synology DS212 and there was a bang and the all the lights went out

There's not much on the disks except my 80GB music library

I'd like to recover that, any ideas?
You read post #1 in this thread?

Or checked the Knowledgebase?

Lars-Inge
I'm New!
I'm New!
Posts: 1
Joined: Thu Sep 07, 2017 3:18 pm

Recover shared folder

Unread post by Lars-Inge » Mon Mar 19, 2018 7:46 pm

Hi all

Synology DS416 Play
3 x WD 3Tb + 1 Samsung 2Tb
SHR Raid with ext4 (at least i beleive it's ext4)

I managed to delete the default shared folder that contains all my photos... :cry:

I have pulled out the drives and marked them with the slot they were in (1-4). They are now connected to a desktop running Ubuntu 16.04 LTS via USB to sATA adapters nad I hope it is possible to recover files using "photorec" or something similar.
I have actually tried and photorec does recover files...thousands and thousands of them...

The first attempt I tried was running Ubuntu from a USB and the logical volume appeared in photorec. However, due to failure on the desktop machine (PCI card) it had to be shut down and restarted and now I'm not able to see the logical volume anymore, not with Ubuntu running from USB or with Ubuntu installed.

I would attached some pictures of what I have, but I can't figure out how to do it... :oops:

One question I have is whether the order of the drives (sda, sdb, sdc and so on) has any impact?
The desktop I'm using has two internal drives (sda and sdb).

The four NAS-drives are attached and showing up as /dev/sdc, /dev/sdc, /dev/md126 and /dev/md127. The to latter ones are shown as RAID5 Arrays on the "Disk" utility on Ubuntu.

I have tried various stuff, but are afraid of braking something beyond repair.

Can someone please help me out here?

docgg
I'm New!
I'm New!
Posts: 1
Joined: Sat Jun 02, 2018 4:32 pm

Access to a disk using an USB connection ?

Unread post by docgg » Sat Jun 02, 2018 4:44 pm

Hello everybody,

I am from Belgium. I have a problem with my DS214+. I hope you can help me because i am not an expert in ubuntu.
So here is my problem.

The ethernet plugs on my DS214+ are broken due to an electrical problem. I took out both disks from the NAS. I tried to access to the disks using an usb connection to a laptop started with an ubuntu live Cd because i have not a desktop computer.
The procedure on the synology web site didn't work.

Could you give me some advices ?

Many thanks.

Xavier.

aeroxr1
Beginner
Beginner
Posts: 20
Joined: Fri Jan 01, 2016 10:24 pm

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

Unread post by aeroxr1 » Sat Jul 14, 2018 10:36 am

Hi !
I followed this tutorial : https://www.synology.com/en-us/knowledg ... using_a_PC

and the tutorial in the first post, but the result is not changing, i can't see the hard disk in file explorer.

( but i didn't used a live usb, but a real installation of Ubuntu :) )

Those are the command prompted and their results :

Code: Select all

sudo mdadm --assemble --scan
mdadm: Merging with already-assembled /dev/md/DiskStation:2
mdadm: No suitable drives found for /dev/md/DiskStation:2
mdadm: No arrays found in config file or automatically
and

Code: Select all

sudo vgscan --mknodes
Reading volume groups from cache.
But in file utility continue to not see the hard drive :

Image

Have you some suggestion ?

EDIT: with DiskInternals Linux Reader I can access to all data from windows ! I'm wondering why on ubuntu doesn't work....

Post Reply

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