Best way to factory reset AND keep the data intact

Moderator: Lillian.W@AST

Post Reply
jfgratton
Posts: 24
youtube meble na wymiar Warszawa
Joined: Sun Jun 13, 2021 3:44 am

Best way to factory reset AND keep the data intact

Post by jfgratton »

Hi,

I've an Asustor AS6604T (Lockerstor4) unit with only 2 of the 4 bays with disks (2x 6TB drives on RAID1).

For many reasons, I'd wish to factory reset the NAS while ensuring that I keep my files intact (I do not mind reinstalling the apps).

I thought of this scenario, I'd like to see if it's doable before committing myself.

So as I said, I have disk0 and disk1, mounted as RAID1 in bay0 and bay1. Bay2 and bay3 are empty (no disk). I also have a nvm-e 500GB ssd cache drive

1. Disable the SSD cache.
2. Poweroff the NAS. Remove disk1. Restart the NAS in degraded mode
3. Factory reset the NAS. disk0 will now be near-empty
4. Insert disk1 in bay2 or bay3 as a separate volume, do not join it to disk0 as a RAID1 volume
5. Copy its contents onto disk0 (provided you've recreated the directory structure, etc, on disk0)
6. Join the disk to the disk0 volume as RAID1

My only questioning is if disk1 keeps some internal markings identifying it as a member of a RAID1 volume, will it willingly work as a standalone disk once the NAS factory reseted ?
User avatar
father.mande
Posts: 1808
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: Best way to factory reset AND keep the data intact

Post by father.mande »

Hi,

Perhaps ... but
... when you enter the second disk (formatted and with data) the "normal" way for NAS is to format it immediately, not sure what it do if disk is already formatted but I think it's also cleared.

My only test was done using this.
unmount and release one disk (1)
verify you can read it as an external volume (for ex. using USB dock or simple usb to Sata cable.)
... to read it, you must know the partition ... the part. number 4 for data
... reassemble a pseudo raid using mdadm
... mount /dev/mdX to verify that data are readable ...
... umount and remove external disk

Then you can re-init NAS (with one disk)
do the same things as external USB device and copy back your data to disk 0
then mount external disk internal and follow instruction to move it as Raid 1 member (even a rebuilt is done)

The other solution (generally the best for not linux confirmed user) is to use an external disk (network or usb) and do backup data on this disk
reinit with all disks, then copy back.
this only require an external disk with a size enough to get your files (or zipped version)

Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
jfgratton
Posts: 24
Joined: Sun Jun 13, 2021 3:44 am

Re: Best way to factory reset AND keep the data intact

Post by jfgratton »

Ho darned,

I did not think that the re-inserted drive would be re-initialised upon re-insertion.
Are disks always re-initialized when discovered ? If not, I'd try an alternative (below):

1. Break the RAID1 (remove disk1). Leave the NAS in degraded mode
2. Reinsert disk1 in bay2 or bay3, create a new volume outside of the raid.
3. Copy contents of disk0 to the reinserted disk
4. Factory reset activate disk0, and copy disk1's contents onto it
5. Rebuild a new RAID1 then.
jfgratton
Posts: 24
Joined: Sun Jun 13, 2021 3:44 am

Re: Best way to factory reset AND keep the data intact

Post by jfgratton »

father.mande wrote:Hi,

Perhaps ... but
... when you enter the second disk (formatted and with data) the "normal" way for NAS is to format it immediately, not sure what it do if disk is already formatted but I think it's also cleared.

My only test was done using this.
unmount and release one disk (1)
verify you can read it as an external volume (for ex. using USB dock or simple usb to Sata cable.)
... to read it, you must know the partition ... the part. number 4 for data
... reassemble a pseudo raid using mdadm
... mount /dev/mdX to verify that data are readable ...
... umount and remove external disk

Then you can re-init NAS (with one disk)
do the same things as external USB device and copy back your data to disk 0
then mount external disk internal and follow instruction to move it as Raid 1 member (even a rebuilt is done)

The other solution (generally the best for not linux confirmed user) is to use an external disk (network or usb) and do backup data on this disk
reinit with all disks, then copy back.
this only require an external disk with a size enough to get your files (or zipped version)

Philippe.
Hi !
How did you go about creating a pseudo raid ? I haven't used mdadm in about 7-8 years....

I've received my SATA USB dock this morning, I'd try it out today.

The partition (now /dev/sdc4 on my workstation) used to be /dev/md127 in the NAS. This is something new since the time I used to use mdadm: the configuration is written on the disk itself
charles.reily
Posts: 1
Joined: Wed Jan 17, 2024 4:30 pm

Re: Best way to factory reset AND keep the data intact

Post by charles.reily »

RAID configurations often include metadata on the disks to identify their roles within an array. When you remove a disk from a RAID1 array, this metadata might persist on the disk. If you insert it into a different slot or try to use it independently, the NAS might still recognize it as part of a previous RAID1 setup. When you perform a factory reset, it usually involves formatting the system partitions on the disks. This might result in crm data enrichment loss even if you're trying to preserve the user data. Be sure to have a backup before attempting any such operation. Different NAS models and manufacturers may have specific behaviors and configurations. It's essential to consult the official documentation or support resources for your specific NAS model (Asustor AS6604T in this case) to understand any intricacies related to disk handling, RAID, and factory reset procedures.
Post Reply

Return to “ADM general”