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
We've moved! Head over to Synology Community (community.synology.com) to meet up with our team and other Synology enthusiasts!
Gondy
Trainee
Trainee
Posts: 19
Joined: Wed May 02, 2012 8:44 pm

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

Unread post by Gondy » Wed May 15, 2013 9:33 am

Your data are on the other ext partition on the disk. What you see here is only Synology DSM system files partition. Data files are on RAID parition. Recovering them is not so trivial. You can follow my guide to recover them. Good luck.

MrTurtle
Trainee
Trainee
Posts: 19
Joined: Wed Sep 07, 2011 2:36 pm

Upgrading a Hard drive - data not available via external usb

Unread post by MrTurtle » Thu May 30, 2013 1:39 pm

Hi,

I have a DS411j and I have upgraded a hard drive; from 1.5TB to 3TB. The drive had a single volume called music.

My plan was to install the new drives and then use an external usb dock to copy the data from the old drives but I cannot find the music folder.

There are 3 partitions on the drive (shown using external devices => Get Info. It seems that only partition 1 is being shown.There are various system folders and 4 empty volume folders; volume1 - volume4 but no music folder.

How do I get the music folder to show.


I understand that the music folder is one of the system default folders. Are there any issues I should be aware of when removing a drive that has one of the default folders?

JeffreyH
I'm New!
I'm New!
Posts: 1
Joined: Sat Jun 01, 2013 8:30 am

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

Unread post by JeffreyH » Sat Jun 01, 2013 8:33 am

Hello,

I have followed your guide completetly and it worked the first time. However, copying files was taking a unusual long time and it's because the other disk was NTFS. So I reformatted it to ext4, and tried again. But this time, Ubuntu will not mount the block disk no matter what I try. It only says it found one volume but it won't mount it. I tried vgscan, lgscan but it keeps saying no logical volume found.

I am doing it in a virtual machine but since it worked the first time I don't know what to do.

EDIT: I also tried running it on a normal computer with the disk connected through sata. Again, it finds the volume, but it won't mount it.

Diverge
Novice
Novice
Posts: 54
Joined: Thu Apr 22, 2010 6:56 pm

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

Unread post by Diverge » Tue Jun 11, 2013 8:54 pm

Can anyone give a detailed reply on how to fix the following problems when attempting this procedure?

Code: Select all

Run sudo mdadm --assemble --scan
receive : mdadm: No arrays found in config file or automatically.
From the NAS I can SSH into it, I see the vg1000 file in /etc/lvm/backup/. It's got info pertaining to my old volume.

I can also mdadm --examine /dev/sda[123] for all my disks a b c, and see all that info with UUID's ect.

Can anyone point me in the direction of restoring my volume w/o resorting to copying the data off it on another host? Ideally I'd like to learn how synology support would go about doing it. They have for me in the past, but I've since sold that NAS and running my current setup virtualized.

Diverge
Novice
Novice
Posts: 54
Joined: Thu Apr 22, 2010 6:56 pm

Lost volume when attempting to expand volume

Unread post by Diverge » Wed Jun 12, 2013 1:24 am

My array consisted of 3 disks, and it was running great for a while now so I decided to copy the rest of the data over and add the 4th disk. When attempting to expand the volume it gave me some kind of network error and didn't expand it. So I figured I'd reboot the NAS and try again, only it hung up.. so I let it go for a bit before powering it off. When it booted it back up my volume was gone.

I know my data is still there and I'd like to fix this myself, to learn how it's done, and because I can't use synology support.

I've SSH'd into the box and am able to see all my disk info.

fdisk -l

Code: Select all

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1               1         311     2490240  fd Linux raid autodetect
Partition 1 does not end on cylinder boundary
/dev/sda2             311         572     2097152  fd Linux raid autodetect
Partition 2 does not end on cylinder boundary
/dev/sda3             588      243201  1948788912   f Win95 Ext'd (LBA)

Disk /dev/sdb: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sdb1               1         311     2490240  fd Linux raid autodetect
Partition 1 does not end on cylinder boundary
/dev/sdb2             311         572     2097152  fd Linux raid autodetect
Partition 2 does not end on cylinder boundary

Disk /dev/sdc: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sdc1               1         311     2490240  fd Linux raid autodetect
Partition 1 does not end on cylinder boundary
/dev/sdc2             311         572     2097152  fd Linux raid autodetect
Partition 2 does not end on cylinder boundary
I've also located the backup of the config of my volume at /etc/lvm/backup/vg1000

Code: Select all

# Generated by LVM2 version 2.02.38 (2008-06-11): Sun May 19 15:10:55 2013

contents = "Text Format Volume Group"
version = 1

description = "Created *after* executing '/sbin/lvcreate /dev/vg1000 -n lv -l100
%FREE'"

creation_host = "DiskStation"   # Linux DiskStation 3.2.30 #12 SMP Mon Mar 11 20
:52:49 EET 2013 x86_64
creation_time = 1369001455      # Sun May 19 15:10:55 2013

vg1000 {
        id = "unique_string_1"
        seqno = 2
        status = ["RESIZEABLE", "READ", "WRITE"]
        extent_size = 8192              # 4 Megabytes
        max_lv = 0
        max_pv = 0

        physical_volumes {

                pv0 {
                        id = "unique_string_2"
                        device = "/dev/md2"     # Hint only

                        status = ["ALLOCATABLE"]
                        dev_size = 7795118592   # 3.62988 Terabytes
                        pe_start = 1152
                        pe_count = 951552       # 3.62988 Terabytes
                }
        }

        logical_volumes {

                lv {
                        id = "unique_string_3"
                        status = ["READ", "WRITE", "VISIBLE"]
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 951552   # 3.62988 Terabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv0", 0
                                ]
                        }
                }
        }
}
I'm also about to see all the info on my drives using mdadm --examine:

Code: Select all

DiskStation> mdadm --examine /dev/sda[123]
/dev/sda1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : unique_UUID_1 (local to host DiskStation)
  Creation Time : Fri Dec 31 19:00:03 1999
     Raid Level : raid1
  Used Dev Size : 2490176 (2.37 GiB 2.55 GB)
     Array Size : 2490176 (2.37 GiB 2.55 GB)
   Raid Devices : 12
  Total Devices : 3
Preferred Minor : 0

    Update Time : Tue Jun 11 19:19:38 2013
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 9
  Spare Devices : 0
       Checksum : 9d221d93 - correct
         Events : 856722


      Number   Major   Minor   RaidDevice State
this     0       8        1        0      active sync   /dev/sda1

   0     0       8        1        0      active sync   /dev/sda1
   1     1       8       17        1      active sync   /dev/sdb1
   2     2       8       33        2      active sync   /dev/hdc1
...
/dev/sda2:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : unique_UUID_2 (local to host DiskStation)
  Creation Time : Fri Dec 31 19:00:06 1999
     Raid Level : raid1
  Used Dev Size : 2097088 (2048.28 MiB 2147.42 MB)
     Array Size : 2097088 (2048.28 MiB 2147.42 MB)
   Raid Devices : 12
  Total Devices : 3
Preferred Minor : 1

    Update Time : Tue Jun 11 11:57:39 2013
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 9
  Spare Devices : 0
       Checksum : 764ec5ad - correct
         Events : 97


      Number   Major   Minor   RaidDevice State
this     0       8        2        0      active sync   /dev/sda2

   0     0       8        2        0      active sync   /dev/sda2
   1     1       8       18        1      active sync   /dev/sdb2
   2     2       8       34        2      active sync   /dev/hdc2
...
mdadm: No md superblock detected on /dev/sda3.

Code: Select all

DiskStation> mdadm --examine /dev/sdb[123]
/dev/sdb1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : unique_UUID_3 (local to host DiskStation)
  Creation Time : Fri Dec 31 19:00:03 1999
     Raid Level : raid1
  Used Dev Size : 2490176 (2.37 GiB 2.55 GB)
     Array Size : 2490176 (2.37 GiB 2.55 GB)
   Raid Devices : 12
  Total Devices : 3
Preferred Minor : 0

    Update Time : Tue Jun 11 19:20:26 2013
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 9
  Spare Devices : 0
       Checksum : 9d221e01 - correct
         Events : 856744


      Number   Major   Minor   RaidDevice State
this     1       8       17        1      active sync   /dev/sdb1

   0     0       8        1        0      active sync   /dev/sda1
   1     1       8       17        1      active sync   /dev/sdb1
   2     2       8       33        2      active sync   /dev/hdc1
...
/dev/sdb2:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : unique_UUID_4 (local to host DiskStation)
  Creation Time : Fri Dec 31 19:00:06 1999
     Raid Level : raid1
  Used Dev Size : 2097088 (2048.28 MiB 2147.42 MB)
     Array Size : 2097088 (2048.28 MiB 2147.42 MB)
   Raid Devices : 12
  Total Devices : 3
Preferred Minor : 1

    Update Time : Tue Jun 11 11:57:39 2013
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 9
  Spare Devices : 0
       Checksum : 764ec5bf - correct
         Events : 97


      Number   Major   Minor   RaidDevice State
this     1       8       18        1      active sync   /dev/sdb2

   0     0       8        2        0      active sync   /dev/sda2
   1     1       8       18        1      active sync   /dev/sdb2
   2     2       8       34        2      active sync   /dev/hdc2
...
mdadm: cannot open /dev/sdb3: No such device or address

Code: Select all

DiskStation> mdadm --examine /dev/sdc[123]
/dev/sdc1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : unique_UUID_5 (local to host DiskStation)
  Creation Time : Fri Dec 31 19:00:03 1999
     Raid Level : raid1
  Used Dev Size : 2490176 (2.37 GiB 2.55 GB)
     Array Size : 2490176 (2.37 GiB 2.55 GB)
   Raid Devices : 12
  Total Devices : 3
Preferred Minor : 0

    Update Time : Tue Jun 11 19:20:48 2013
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 9
  Spare Devices : 0
       Checksum : 9d221e41 - correct
         Events : 856756


      Number   Major   Minor   RaidDevice State
this     2       8       33        2      active sync   /dev/hdc1

   0     0       8        1        0      active sync   /dev/sda1
   1     1       8       17        1      active sync   /dev/sdb1
   2     2       8       33        2      active sync   /dev/hdc1
...
/dev/sdc2:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : unique_UUID_6 (local to host DiskStation)
  Creation Time : Fri Dec 31 19:00:06 1999
     Raid Level : raid1
  Used Dev Size : 2097088 (2048.28 MiB 2147.42 MB)
     Array Size : 2097088 (2048.28 MiB 2147.42 MB)
   Raid Devices : 12
  Total Devices : 3
Preferred Minor : 1

    Update Time : Tue Jun 11 11:57:39 2013
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 9
  Spare Devices : 0
       Checksum : 764ec5d1 - correct
         Events : 97


      Number   Major   Minor   RaidDevice State
this     2       8       34        2      active sync   /dev/hdc2

   0     0       8        2        0      active sync   /dev/sda2
   1     1       8       18        1      active sync   /dev/sdb2
   2     2       8       34        2      active sync   /dev/hdc2
…
mdadm: cannot open /dev/sdc3: No such device or address
Ignore the failed devices, it only uses 3 of possible 12 drives.

Can anyone tell me how to go about restoring my volume info? Pretty please :)

Diverge
Novice
Novice
Posts: 54
Joined: Thu Apr 22, 2010 6:56 pm

Re: Lost volume when attempting to expand volume

Unread post by Diverge » Wed Jun 12, 2013 4:33 am

If I do : mdadm –Asf && vgchange -ay

as per http://www.synology.com/support/faq_sho ... u&q_id=579 will it restore my array back to normal, or will this just let me access my files via SSH?

Trying my best to resist trying stuff until I know what I should do. Don't want to do something that can't be undone :(

r3k0
I'm New!
I'm New!
Posts: 6
Joined: Sat Feb 25, 2012 4:31 pm

Reading RAW partition from DS212j in Win7?

Unread post by r3k0 » Tue Jun 25, 2013 11:16 am

Hi

I recently bought a bigger hdd for my 212j, so i backed everything up overnight to 3 usb drives.
i then removed one of the drives from my nas and replaced with the new bigger one and started to replace all my files.
now one of the usb back up drives has failed...

I was thinking is it possible to see if any of the data that i lost is on the hdd that i removed from the nas ? the big partition on this shows as RAW ? can this be read on a windows pc ?

Tia


r3k0
I'm New!
I'm New!
Posts: 6
Joined: Sat Feb 25, 2012 4:31 pm

Re: Reading RAW partition from DS212j in Win7?

Unread post by r3k0 » Thu Jun 27, 2013 12:14 pm

Thanks for that, will try it tonight.

r3k0
I'm New!
I'm New!
Posts: 6
Joined: Sat Feb 25, 2012 4:31 pm

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

Unread post by r3k0 » Fri Jun 28, 2013 2:15 am

After sudo mdadm --assemble --scan i keep getting "not enough to start the array" ?

It was a while ago when i setup the nas but im pretty sure it was RAID 0.
I can post a screeny tomorrow if needed.

Tia

r3k0
I'm New!
I'm New!
Posts: 6
Joined: Sat Feb 25, 2012 4:31 pm

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

Unread post by r3k0 » Fri Jun 28, 2013 4:43 pm

sorry im a complete raid and linux noob but do i need both the hard drives from my nas to see files that are on 1 disk ? is this why i cant start the array ?

User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
Posts: 19674
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

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

Unread post by HarryPotter » Sat Jun 29, 2013 6:45 pm

Sorry but If it was a RAID0, I would say forget it.
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS718+ / DSM 6.2-23511 / ST4000VN000-2AH166 / SA400S37120G SSD cache /16 GB RAM
DS415+ / DSM 6.2-23511

LMS 7.9.1-166, 2 Squeezebox 3 + Boom

APC Smart UPS SUA750i

NorthernEnd
I'm New!
I'm New!
Posts: 6
Joined: Fri Jun 28, 2013 11:22 pm

How do I backup this server HDD? - SOLVED!!

Unread post by NorthernEnd » Mon Jul 01, 2013 6:25 pm

Hey guys,

I have a server (Synology Diskstation DS112J - an NAS) that I absolutely cannot access via my network, and I'm wondering if there's any way I can back up the data on the HDD before I do a reset. When I plug the HDD into a computer, it isn't recognized because it has the server OS/firmware installed. Is there any other way I can access the data and/or back it up from the HDD?

Thanks.
Last edited by NorthernEnd on Tue Jul 02, 2013 5:04 pm, edited 1 time in total.

User avatar
maxxfi
Compiler
Compiler
Posts: 6794
Joined: Sun Dec 27, 2009 12:13 pm
Location: Espoo, Finland

Re: How do I backup this server HDD?

Unread post by maxxfi » Tue Jul 02, 2013 6:38 am

No longer using Synology NAS, moved to more open source solutions.
DS-106j > DS-210j > DS-411

NorthernEnd
I'm New!
I'm New!
Posts: 6
Joined: Fri Jun 28, 2013 11:22 pm

Re: How do I backup this server HDD?

Unread post by NorthernEnd » Tue Jul 02, 2013 4:42 pm

For anyone with a similar problem, or anyone who needs to recover files from an inaccessible NAS hard drive, this is the solution and utility that I used:
Ext2read
http://ext2read.blogspot.dk/2010/04/ext ... 2-and.html

This utility makes it possible for your regular Windows PC to read an NAS hard drive (can't read it normally because the files are stored within a file type recognized by Linux but not Windows)

- Connect the NAS hard drive directly to the PC, as you would with any hard drive.
- Download Ext2read and run the application as administrator
- The NAS hard drive should be visible within Ext2read, so open it and all files will be visible
- click on the files you want and go down to "save"
- You are given the choice of where you want to save these files, so you can simply copy them onto your main PC hard drive, and voila! Everything is backed up and you don't have to worry about the HDD being formatted when you do a server reset.

Best of luck!

Locked

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