[HOW-TO] Recover data on a dead NAS (or almost) / Inside AS5002T

Share your awesome tips and tricks here.

Moderator: Lillian.W@AST

Post Reply
User avatar
father.mande
Posts: 1808
youtube meble na wymiar Warszawa
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

[HOW-TO] Recover data on a dead NAS (or almost) / Inside AS5002T

Post by father.mande »

Hi,

For some unknown reason my NAS : AS5002T seem to don't start anymore
I have search HOW recover some data (APKG development folder ... some are not synchronized with an external server (an error))
Why try this :
... to understand How Asustor NAS is booting (not easily visible on a running NAS) ... in case I can solve it
... understand if a copy of booting files (bzimage, initramfs, etc.) exist
... AS5002T is relatively simple for storage (Raid 1) ... ext4 (when I restart I will use BTRFS) ... so can be recovered ... even with one disk

Requests :
... know how-to enter in BIOS ... "ESC" is the key ... (attention on AS5002T Bios is very complete ... so don't change things if you don't know exactly what you do)
... ... the only interesting menu is the Boot Manager ... to select an alternative boot device
... create an Ubuntu 18.04 USB boot device (Live USB) WITH UEFI boot mode (or double boot mode) ... add mdadm tools (not provide directly) or you can do it later (when it run) YOU CAN choice another Linux but be sure to have all the driver requested by your NAS model
... have a screen (HDMI) and a mouse and keyboard (mine are Logitech using Unify wireless module in front) (after you can use a ssh connection if it's more easy for you)

BOOT from the live USB Linux
... NAS is off ... plug Ubuntu USB live in an USB2 plug
... Power ON ... then press "esc" up to Bios (UEFI) menu
... use "Boot Manager" and boot using UEFI xxxxx (the name of USB key you use)
... Wait to get the screen
... OPTIONAL ... change the keyboard layout if you don't use a Qwerty keyboard
AT THIS POINT you can see :
Network ... available 1Gb ... use DHCP is better ...
3 disks : sda : HDD ; sdb : Live-USB ; sdc DOM (Disk On Module)
USB_Live (generally at /dev/sdb and view as a CDROM with ONE partition)
HDD ... but not mounted
DOM (internal USB disk use by Asustor as boot device) ... the "special" for DOM is that a part is not defined 8192 Blocks ... don't correct G.P.T. table (Not sure of the result)
... Part 2, 3 and 4 are mounted in /media (ext4)
... ... partition 2 and 3 are same with bzimage, initramfs and builtin.tgz
... ... partition 4 with apkg.tgz
... Part 1 is an UEFI (not mounted ... but you can mount it) containing grub and boot (including UEFI driver)

NAS HDD (in this case Raid1 ext4 on AS5002T) is partitioned with partition 4 as the data partition (volume1)
... if mdadm is not installed ... install it : apt-get install mdadm
reassemble the Raid ... only on partition 4
mdadm --assemble --run /dev/md0 /dev/sda4
... Now mount he Raid :
mount /dev/md0 /mnt (for ex.)

AT THIS POINT your DATA are available all shared resources / AppCentral (in .@plugins folder mount to /usr/local in NAS) / etc. are available
... now select the best way to save it
... ... add another USB disk and copy or archive (tar, etc.)
... ... use FTP, SFTP, rsync, etc. to do a save on network

You can also (for study) do a dd of the sdc disk (DOM) to analyse the Asustor Boot method)

I don't enter anymore in detail ... because it's a dangerous approach ... so if you have the skills ... you can do it easily ... if not ... better to call the support.

This is only for studying the Asustor software approach ... not for any other reason (except perhaps to install a real Ubuntu or Debian system on an (relatively) old NAS that you don't want to continue to used with A.D.M. software.

Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
Mr.Crowley
Posts: 20
Joined: Sun Apr 09, 2017 2:45 pm

Re: [HOW-TO] Recover data on a dead NAS (or almost) / Inside AS5002T

Post by Mr.Crowley »

This is also working for RAID 5 or higher?
User avatar
father.mande
Posts: 1808
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: [HOW-TO] Recover data on a dead NAS (or almost) / Inside AS5002T

Post by father.mande »

Hi,
Mr.Crowley wrote:This is also working for RAID 5 or higher?
Absolutely the Raid is software ... BUT this require some more skills depends of :
... on the NAS itself ... no problem ... just adapt the mdadm assemble
... on another PC running Linux
... ... the problem is to identify clearly each SATA or USB/SATA you will used ... identify the NAS disk order (to mount it in order)
... ... after if you know /dev/sdX order ... you can assemble the Raid (I have done myself this with 4 disks in Raid5 with 2 internal and 2 USB 3.1 plugs)

In all case you must know :
... how to use command line and tools available (require) for manipulating Disks, Raid and file system
... how rebuild Raid5 if crash generate problems
... how to use other file system (ext. btrfs new with A.D.M. 3.3) and associated rules like snapshot

I can suggest only some basic recommendation :
... do backup (Raid add security it's not a backup)
... have a list of clear identification for each of your disk ... use Linux tools to get detail on disks (hdparam for ex.)
... when you extract disk of the NAS ... put on a sticker the position on it
... be patient and do things step by step and adapt the procedure

Philippe.
N.B. NEVER think that a procedure provide in a forum is enough ... prepare yourself and study Linux logical Raid and recovery mechanism (search the Web)
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
Mr.Crowley
Posts: 20
Joined: Sun Apr 09, 2017 2:45 pm

Re: [HOW-TO] Recover data on a dead NAS (or almost) / Inside AS5002T

Post by Mr.Crowley »

Alright, thank you for sharing this!

I saved the page if I ever need this one day.

Also, what's your thought on btrfs compare to ext4?
User avatar
father.mande
Posts: 1808
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: [HOW-TO] Recover data on a dead NAS (or almost) / Inside AS5002T

Post by father.mande »

Hi,
Mr.Crowley wrote:Alright, thank you for sharing this!
I saved the page if I ever need this one day.
Also, what's your thought on btrfs compare to ext4?
I don't have the expertise of Asustor guys ...
ext4 is stable from long time BUT lost some place for journalisation
... so it's stable, know and lot of documentation exist
... ext4 can be put on Raid volumes (as in Asustor)
... extend (the ext4 capability to access large disk) is (relatively) slow and can generate errors
... ext4 search file and folder based on a sequential (inode) read
btrfs is (relatively) new and I am not sure that ALL btrfs are available (or accessible) in Asustor (ask support)
... is build for large disk so quickest than ext4 (no extend) for accessing large file and data on large disk
... access to folder is based on indexing so can get a file / folder more quickly for a lower CPU usage (B-tree)
... is lower in CPU than ext4
... support SNAPSHOT (like L.V.M.)
... support of transparency data compression (don't know if available on Asustor)
... support of increase or decrease size of volume without unmounting it (don't know if available on Asustor)
... support of hot defragmentation (exist in A.D.M. 3.3 Storage menu)
... support mirror mode (like Raid1) but on volume ... so with potential quick rebuild (don't know if available on Asustor)
ALSO announced but perhaps not or never implemented ... but we speak about comparaison ...
... a Block mode mirror similar to Raid5 or Raid6 but supporting MORE default disks
... hot file system check
... deduplicate files
etc. etc.

So BTRFS is clearly a door open to the future, the immediate gain is using snapshot (but L.V.M. was also a solution) and better performance for large disks
recover BTRFS is possible but the tool (btrfs-restore) don't seem to be provide on Asustor NAS ??? (T.B.V.)
convert tools is provide ... but no how-to on NAS ... certainly possible because ONLY the partition 4 (or Raid of partition 4) need to be convert from ext4 to Btrfs ... so if a sort of boot without mounting file system on the Raid of sdX4 partitions ... it seem possible to run conversion ... or perhaps an option in A.D.M. in the future ... I don't see it for now ...

I suppose when A.D.M. 3.3 (with BTRFS support) will be out ... we can get more detail and information on what Asustor implement with BTRFS support.

Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
Post Reply

Return to “Tips & Tricks”