Qnap Data Disappearing – Symlink deleted

I had 3 cases of disappearing Data on Qnap. Not exactly Disappearing techincally, but the user couldn’t see the shared folders in File Mananger.

Your Data Actually is in /share/MD0_DATA ( for older systems) /share/ CACHEDEV2_DATA ( on newer systems). 

As long as your MD0_DATA or CACHEDEV2_DATA directories have the data, you are safe.

Data you see in File Manager is a symlink- A Windows Shortcut

Qnap also creates a softlink in your /share directory that points to a directory inside MD0_DATA or CACHEDEV2_DATA. Think of a symlink/softlink as a windows shortcut you create on your desktop for quickly accessing your file.

Deleting Symlink Doesn’t delete the Data . Just that you can’t find Symlink. 

This is where the problem is. Symlinks sometimes are deleted automatially ( I don’t know how but I have seen 3 cases where the symlinks were getting deleted). In one case the Firmware got corrupted while update and the link was broken, in other 2 cases I don’t know what caused it.

Now your Data is intact, its in MD0 or Cachedev directory. However you can’t see it in File Manager.

Recreat Symlink and you have your Data Back. 

Quick Books Scheduled Reports are useless with Multiusers

Quickbooks Added the Auto Scheduled Report feature 2017, which sounds great the first time. However there are so many rules for this to work. Though most of the conditions are ok, there is one which is a deal breaker – Your compnay file must be in single user mode.

So , if you want an automated report emailed to you, you must force all the users to close their quickbooks and turn the single user mode on before the report is scheduled to run . Some Automation that is !!!

Its easier to run the reports you need manually.  its impossible to get the comapny to single user mode each time.

If you don’t have the Quickbooks in Single user, you will get this dialogue box telling you ” Reports Didn’t Send We can’t send report from company file becuase two quickbooks Windows are open. To send your scheduled reports : close both Quickbooks windows, then click continue. ”

Screen Shot 01-14-17 at 07.06 AM

This condition makes it useless to use scheduled reports in a multi user environment.  Hope that in the next version ( if they do release a desktop version next year) they fix this.

Periodic Email from Qnap with Sendmail and Crond

Qnap offers Auto Email notification , but they are limited to ‘Errors and Warnings’. So you can’t do for instance – A Disk health check every Saturday and email you the result.  You only get the notification on teh Errors and Warnings with the GUI front.

In our case, I wanted to have the listing of files in a particular Directory each day emailed to me , just to ensure that the backup is working as expected.

Emailing from Qnap can be very easily acheived, offcourse you will need

  1. Putty on Windows, or a way to SSH into your Qnap
  2. Your Qnaps admin username and password
  3. basic knowledge of working with VI, VIM or nano editor.
  4. the format of crontab file .

Step 1. Configure the SMTP server 

Go to System settings > notifications>emails and enter your SMTP server details. Don’t use gmail accounts as Gmail uses Oauth protocol that works with the front end, but fails with Sendmail.

Enter your SMTP server details and test it.
Enter your SMTP server details and test it.

Step 2.  Test your Script with sendmail

My Script simply lists the contents of a directory and dumps it to a mail file, which will later be sent using sendmail.

> email.txt
echo To: myemail@myserver.com > email.txt
echo From: myemail@myserver.com >> email.txt
echo Subject: Quickbooks Backup Status >> email.txt
echo "===============Body of the Email===============" >> email.txt
ls /share/DR/QBBACKUP/ >> email.txt
cat email.txt | sendmail -v -t

First it clears the content of email.txt, then creates the header of the email message with To, from and Subject . Use the same from email address which you have specified in step 1 in SMTP server, to ensure that it doesn’t end in spam.

Finally it Dumps the output of  list command to the file.  you will have your command here from which you need the output.

The last line dumps the content of email.txt to sendmail, which scans it for recipient address ( -t option) and shows you what’s happening ( -v option).

make the file executable and run it to see if it works.

Step 3 : Edit Crontab to schedule it

Don’t use the crontab -e to edit the crontab. Instead edit your crontab file directly which resides on /etc/config/crontab. After edit, tell crontab to read the config file again, and then restart the cron deamon.

crontab /etc/config/crontab
/etc/init.d/crond.sh restart

If everything goes well, you will start getting the emails as per the schedule you have setup in crontab

GLG- Gems Learning Gateway ( Now Gems My Learning)

KGS uses Gems My Learning which was called GLG ( Gems Learning Gateway) earlier, as an online Education portal. It’s not a fully blown LMS, so students can’t take quizzes/tests, submit assignments or interact.   My learning serves 3 Major Purposes

  1. You can download files uploaded by teachers like holiday homework, resource files and curriculum ( Through My Learning > Learning Spaces)
  2. You can view the circulars and notices ( Through My learning > School Areas)
  3. You can Pay the school fees, view the Grade Cards ( Through My Learning > Pay Fees)

KGS uses other portals as well like mindspark ( for mathematics), mobymax ( for English) and Mcgraw hill connect-ED ( for Science). On these portals, students can view interactive lessons, test their understanding of a topic and also submit the assignments. They have been testing and experimenting a lot of portals and in 2016 I noticed them trying 4-5 more portals, but finally they seem to be staying with these 3.

Checking for files uploaded by teachers, Holiday Homework, other Resources

  1. Go to www.gems.ae
  2. Click on the Second Tile titled ” My Learning”
  3. Login with the username and password provided to you
  4. Click On Learning Space.
Step 1 : Go to www.gems.ae and click on My learning to access resources , or Oasis to access report cards
Step2 : Click on Learning Spaces to Access Resources, School areas to access Circulars and Pay Fees to Access Grade card and pay fees
You will see the Class your ward belongs to. Click here
Step 3 : You will see the Class your ward belongs to. Click here
Here are the resources
Step 4 : Here are the resources

Here you will see all the files that are uploaded. You will have to view all the files one by one ( you can’t open them in a new window/tab, can’t download til you have opened the file and there is no way to check which files are unseen or are new)

Checking for School Circulars.

  1. Instead of Clicking on My Learning , click on School Areas.
  2. Click on Circulars
  3. Here you can see all the circulars
Click on the School Areas to Check for Circulars
Here are all the Circulars.
Step2 : Here are all the Circulars.

Offcourse Circulars are generally Emailed and also Sent with the Students to you, so you don’t need to check them very often.

Paying School Fees and Checking Grade Cards

  1. Click on the pay fees link.
  2. You are taken to the Fees payment page. You can pay fees with your credit card through either of 2 gateways
  3. Click on Profile to Access the grade cards/report cards
Step1 : Click on Pay Fees
Step1 : Click on Pay Fees
Step 2 : You are presented with the Screen where you can see the outstanding fees and pay it.
Step 2 : You are presented with the Screen where you can see the outstanding fees and pay it.
Click on the Profile tab and you see the links to Report cards
Click on the Profile tab and you see the links to Report cards

Data Protection on Qnap

Qnap is an extremely versatile NAS box that offers many layers of Protection for your Data. Lets have a quick look at all the options you have

Name Protection against Remarks
RAID Protection Offers Protection against Hard drive failure ( On site Data) Only Hardware protection. If file is deleted, or changed, RAID can’t help you restore it to a previous state
Volume Snapshot Offers Protection against file changes ( On site Data) Most Effective against Ransomware attacks.
Remote Replication Offers Extra Layer of protection by keeping a copy of the data offsite on a server owned by you. ( Offsite Data) Compression and Encryption are supported while copying the data offsite
Public Cloud Offers Extra Layer of protection by keeping a copy of data on public cloud ( Offsite Data) Major Public Clouds are supported
RDX Tape Backup/ External Hard drive Backup Offers Extra layer of protection by copying data on a Removable tape/ removable hard drive that can be stored offsite Needs Purchase of an RDX Dock and the tape, or an external hard drive

Lets look at all these one by one.


Raid offers protection from Hard drive failure only. If you are running on Raid 5 for example , you have the tolerance to 1 hard drive failure. If you are running on RAID 6, then your have 2 hard drive failure tolerance.  In case of a hard drive failure on a system protected by RAID , you don’t lose any data.  Simply replace the failed hard drive, and the NAS rebuilds the RAID for you ( in the background) so you get the failure tolerance back.
RAID however protects you ONLY against hard drive failure. What about accidental deletion of file , or if a file is overwritten and you want to get the previous version back ?  That’s where the Volume Snapshot comes in.

Volume Snapshot

Much like windows system restore,  Snapshots works by recording the state of the system at any time. The storage overhead of the snapshot is the difference between the current state and the previous state. snapshot happens at the block level, so the blocks that have changed are not marked for deletion, but linked to a previous state of the file.
Snapshots can be scheduled, so they are taken at regular intervals and you can define how many days snapshots to be kept , after which the systems starts to delete the older snapshots.
Volume Snapshots are the best way to Protect yourself against the Ransomware attacks, as you can restore your data to a previous state after the attack.

Remote Replication

Remote replication let you copy your data to a remote server. There are a few options to do it.
  • RTRR – Works if the other NAS also is Qnap. You can set a one way sync between the 2 Qnaps.
  • Rsync – Rsync is a remote data replication protocol found on Unix like systems. If your other NAS runs on Linux, or you have a Linux server, you can use Rsync to push data from Qnap to your server
  • NAS to NAS – Again this works if the other NAS is also Qnap.
  • FTP and Samba/CIFS Share are also supported in the new hybrid Backup Sync

Public Cloud Integration

Qnap provides apps to connect to popular public clouds like Amazon, Azure, Elephantdirve and dropbox. You can keep a copy of your critical data on the public cloud to offer an additional layer of protection.  All the Major Public Clouds are supported and there are apps for many more in Appstore for download.

Connect an RDX or External Hard drive to USB

Qnap has a USB port , through which you can connect an external storage. Once you do so, the external storage is mounted automatically and you can copy data to and from the USB device. RDX Docks and RDX tapes make reliable and robust offsite data solutions where you can copy your essential data on a removable RDX cartridge that looks like a tape. This tape can be stored offsite .

Image Backup Needs a Third party software

Qnap offers a file based backup utility called NetBak Replicator for free. However this utility can only take file backup and doesn’t support System Image backup. For System Image backup you would need to buy any third part application.
Qnap has also announced a Hybrid backup sync application on the NAS that offers a single interface for Backup, Restore and Sync. It provides an interface to the applications which otherwise had to be accessed individually. Now there is a single screen on which you can create an RTRR Job, or a copy to Azure job, or a sync to Dropbox.

Ideal Backup is Multi Layer

So, the best strategy to protecting data comes to be a mix of all above . The 3 layers of protection that you MUST HAVE are
  1. RAID is a must.
    Go with Raid 6 for 4-8 bays and Raid 5/RAID 1 for Less than 4 bays. Hard drives are prone to failure and RAID protects you against such failures.
  2. Schedule Snapshot
    Snapshot is the only way to protect yourself against Accidental File Deletions, file changes and ransomware.
  3. Replicate offsite : 
    One copy must be replicated offsite. You can do it either on another Server you own, or on a public cloud, or on an RDX Tape. Offsite backup protects you against any disaster that wipes the data on the site.