Login to QNAP with SSH
ssh-keygen -R 10.42.0.12 -f /home/amigo/.ssh/known_hosts
Remove RSA key for 10.42.0.12 if necessary. Please use your NAS IP to replace 10.42.0.12, and user home directory for /home/amigo.
Login to 10.42.0.12 as admin which is the same as your web admin account and password.
Fill Null to Disk
List of free disk of mounted device to identify the device name of your hard drive in NAS.
dd if=/dev/zero of=/dev/sda bs=10M count=10
/dev/zero is a special file with null characters only. Used as source as a character stream for initializing data storage.
bs=10M means read and write up to 10M bytes at a time.
count=10 means repeat for 10 input blocks.
It will write 10M * 10 data to the beginning of /dev/sda which shall destroy QTS.
Then reboot with reboot command. Now, it shall reinstall QTS firmware automatically.
If you are using RAID 1, you need to use above command on /dev/sda and /dev/sdb before reboot. If you remove just one of them, it will automatically recover from another disk. That’s how RAID 1 works.
Remove QTS Partition and Keep Data
There is an alternative and better solution to keep your data which stores in another partition. Instead of dd, use fdisk to work on partition directly.
First to check what is available in disk. Here is a sample executing fdisk -p /dev/sda from my QNAP TS-112.
[/sbin] # fdisk -p /dev/sda
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 66 530125 83 Linux
/dev/sda2 67 132 530142 83 Linux
/dev/sda3 133 243138 1951945693 83 Linux
/dev/sda4 243139 243200 498012 83 Linux
-p to display partition in a disk.
/dev/sda is the disk name.
Then delete QTS partition by executing fdisk -d 1 /dev/sda.
[/sbin] # fdisk -d 1 /dev/sda
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
-d 1 to delete the first partition.
/dev/sda is the disk name.
Then reboot with reboot command. After reboot, it will prompt to install QTS firmware. Choose [Manual Setup], and click on [Configure disks later] in [Disk] step. It will automaticall to apply settings and reboot.
After reboot, login to QNAP device, re-enable [Microsoft Networking]. Now, you may see your data in the same folder before re-install QTS.
1 – Power Off Nas and Plug out all HDDs,
2 – Start Qnap witout HDD’s
3 – A few minutes later, Qnapfinder should find your NAS. Start the setup.
4 – When Qnap ask you to Plug HDD, use only 1 HDD and complete setup.
5 – After 15 minutes, Qnap should format & Installation should complete. Now login device and go to RAID Managments screen. Plug all HDD’s, and start “Format” Process for all HDDs.
6 – If all HDD scan result is Good, Start building RAID at the same menu. This should take around 12 Hours to complete synronization.
Login Qnap and go to Administration Page -> Reset to Factory Defaults. This will Reset, Format and Install RAID system.