Get some base Linux info in QNAP TS-210 using console

QNAPs runs on (sometimes heavily modified) Debian distributions. But, what about kernel version etc.?

There several ways of getting this information from console. Out of them following works on TS-210:

  • uname -a
  • cat /etc/issue
  • cat /proc/version

If you ever need more information on this then… LMGIFY.

In this article I’ll show you the very basic commands that can be used on QNAP TS-210 (modified Debian Linux) to obtain system release, version, hardware info etc.

Read More “Get some base Linux info in QNAP TS-210 using console”

QNAP TS-210: Support, reset and configuration

One of my disk in two-disk stripping array of my ol’ good QNAP TS-210 has failed. I had to do some reasearch to update my knowledge and decided to share it here, to have it handy and hopefully help others.

Here you’ll find some quick details on resetting and configuring your QNAP TS-210 (may also apply to some other models?) and on getting some support, if all else fails.

Read More “QNAP TS-210: Support, reset and configuration”

Install Optware (IPKG) on QNAP TS-210 with QTS 4.x

With introduction of QTS 4.x:

  • there are a lot of changes in QNAP’s Control Panel, including the fact that “Application Servers” component is gone,
  • neither Optware nor IPKG or QPKG elements are available for download in the “App Center”.

This causes my “Installing Optware (IPKG) on QNAP TS-210” (6,5 year old!) article to be completely outdated.

Currently then only way to install Optware is to go through Manual instalation as described in QNAP Wiki.

Since I went through this guide and can confirm that it is working, I will be enough nasty to copy-paste that article here (removing stuff not related to QNAP TS-210 and fixing some bugs).

To go through these steps you need a shell access to your QNAP. Using the PuTTY is the most obvious answer.

But wait! There’s a much better way. QNAP introduced a gem called “shellinabox“, available in App Center (or here or here). I strongly recommend to use it, because with it, you need a web browser!

Read More “Install Optware (IPKG) on QNAP TS-210 with QTS 4.x”

chown: Recursively change owner of all files and folders

Sometimes QNAP changes file owner to admin:administ (actually to admin:administratorsadmin user in administrators group) which may cause some troubles on certain FTP operations when you’re logged in to QNAP’s FTP server with user different than admin (using this user to operate on FTP is a quite great mistake and you should always use other, less privileged user for this).

Using chown command you can easily fix this.

Read More “chown: Recursively change owner of all files and folders”

Bringing Unison to QNAP TS-210

My six years old QNAP TS-210 was key solution for my most important data backup back in 2012. That’s the moment, when I first time heard about Unison (webpage, Wikipedia). Its idea (a free, self-hosted alternative to Dropbox, limited in size only by free space on your device) caught my heart and I immediately felt in love with it.

Unfortunately, after struggling with it for over a few months I finally failed getting it back to QNAP and turned into some alternative solutions (Bittorrent Sync, Dropbox, OneDrive). However, someone did finally find a solution and answered my four years old post. This obligates me to share this knowledge. Have a good reading.

Fix problems with sudoers or sudoers.so file on QNAP

Root / power-user configuration on QNAP devices is a little bit different (quite weird) than this, what you can find on most Unix/ Linux systems. And sometimes you may be hit with error messages like “admin is not in the sudoers file. This incident will be reported“, “sudoers.so must be owned by uid 0” etc. Here are some tips on what to do in this case.

For second error, claiming that sudoers.so file uid isn’t 0, first go to folder containing this file (/opt/libexec/ on QNAP TS-210) and ls -ls to check, who is current user of it. It should be admin:administ (actually admin:administrators, but ls -ls chops names to 8 characters).

If it isn’t, change ownership of this file and /opt/etc/sudoers folder, by executing:

chown admin:administrators /opt/libexec/sudoers.so
chown admin:administrators /opt/etc/sudoers

As for first error, saying, that admin is not in the sudoers file, you may try to execute sudo usermod -aG sudo,adm admin, but this will most likely fail on QNAP.

If it does, then fix this manually as described in here:

  1. Execute visudo command to edit /opt/etc/sudoers.tmp file.
  2. Scroll down contents of this file, until you reach root ALL=(ALL) ALL.
  3. Hit Enter to add a new line below and write admin ALL=(ALL) ALL.
  4. Hit Esc, enter wq and hit Enter to save file and exit forsakend vi editor.

This is the only solution, that I found working on my QNAP TS-210.

All others, that required using GRUP, were impossible, as you don’t have access to GRUP during QNAP boot.

Bringing Git to QNAP TS-210

There are two (quite obvious) ways, how you can use Git on your QNAP TS-210 (or any other QNAP).

If you only want to be able to update local repositories (i.e. use QNAP as Git client) then this article is for you and all you need to do is to install Git on QNAP and generate proper SSH keys.

If, on the other hand, you would like to store on QNAP repositories, that other uses (i.e. use QNAP as Git server), then you need to search the Internet for some alternative solution, sorry.

Read More “Bringing Git to QNAP TS-210”

Resolving strange FTP-related issues on your QNAP

Not being able to delete or rename a file on QNAP via FTP? First thing you have to check, is:

  • who is the file owner (it should be your user name) and
  • what is file group (it should be everyone).

On various occasions QNAP can set it to admin:administ, which is wrong, in this case.

The same problem will most likely appear, if you access your QNAP via FTP and try to rename or delete a file while using different credentials that were used when uploading that file. If another FTP user uploads a file then only that user can delete or rename or move that file.

If you wish to do this yourself, you have two options:

  • use that other user’s credentials (if possible) or
  • change owner and a group of that file to you.

The second solution is discussed in this article.

Read More “Resolving strange FTP-related issues on your QNAP”

Change prompt and enable command auto-completion [updated]

I really like some simple extensions and changes to command line in Linux. An ability to enable command auto-complete, commands history navigation and changing prompts look in particular.

However, not every console is suited with these changes, so I wrote this simple article to keep all my how-tos around Linux command line in one place.

Read More “Change prompt and enable command auto-completion [updated]”

Get WebSVN to QNAP

This guide assumes, that you have svn already installed on your QNAP, fully configured and working like a charm, and you just want to enhance it with web client (WebSVN). You can use this guide also on any other server, than QNAP, but keep in mind, that it contains some QNAP-specific problems.

Keep in mind: WebSVN (as good as all other alternatives mentioned in the end of this text) are read-only web SVN clients! You can do a lot of useful stuff on your repos, but forget about committing or anything similar that requires write access or changing repository structure.

Read More “Get WebSVN to QNAP”

Copy large folders using command-line with progress indication

By many sources cp is mentioned as the fastest way to copy large filesets. And the only fault of it, is that it does not provide an easy way to see progress of copy process. This post discusses various ways of fixing this problem. Keep in mind, that this post is (again) QNAP-optimized, meaning that it mostly focuses on solutions available on my old, lame QNAP TS-210 NAS system. It only points out other methods, that are not available on this very limited edition of Linux.

Read More “Copy large folders using command-line with progress indication”

screen: Force program to continue after logging-off from the console

So, there I was… needing to have any solution, that will allows me to write my very own port listener. Since the only language, in which I am handy is PHP, I was forced to be able to run PHP script without interruption, 24 hours a day, 7 days a week. That was a bit of challenge for me, given my quite very limited Linux knowledge, but — as they say — the only thing not possible in IT is to open an umbrella in your ass! :>

Read More “screen: Force program to continue after logging-off from the console”

Installing SVN on QNAP using IPKG (Optware)

This article is based on information provided by QPKG package created for SVN by noski and on QNAP Wiki article about SVN and of course a piece of my experience. But since SVN is relatively easily to install by-hand (so you don’t actually need QPKG package) and since Wiki article about SVN is outdated / contains some garbage (directory /share does note belong to /dev/ram!), I decided to write my own guide.

Read More “Installing SVN on QNAP using IPKG (Optware)”

Installing Optware (IPKG) on QNAP TS-210

Outdated article! Read the updated version instead.

This article deals with installing Optware (IPKG) on QNAP TS-210 NAS machine. Optware is a must-have, if you want to do anything with your NAS that goes beyond using as simple network storage. I.e., if you want to access it via SSH and play a little around Linux on-board. In other words, in installs many core utils, that are simply gone from default distribution of Linux on-board QNAP.

Read More “Installing Optware (IPKG) on QNAP TS-210”

Fix for problem with mixing USB shares on QNAP

Most QNAPs randomly mounts USB disk shares. I.e. you can have disk attached to left USB port as USBDisk1, second as USBDisk2 and after reset — changed together. This causes many problems, where being unable to write some script accessing particular disks could be named at first. There isn’t an easy way to work around it. The only solution I found out was to write an script that resides in flash memory (therefore is called upon each restart of QNAP) and that mounts disks under shares similar to their disk labels.

Read More “Fix for problem with mixing USB shares on QNAP”

Remove non-empty directory on QNAP or Linux

You may try to use rm -rf [directory] to delete given directory along with all its content (including all subdirectiories and all files). Use this with caution, to not end up deleting all files on your root! :>

Note, that on QNAP (but not on regular Linux) you have to start your session as admin user, as you cannot use su command to become root. If you try this, you’ll end up with error su: user root does not exist.

Introduction to bash scripts

While playing with some extra features on my newly purchased QNAP TS-210 at some point I was forced to finally write some bash script to be able to control things, that are uncontrollable via administration panel. For this reason I had to learn myself at least basics of bash, that is installed on my QNAP. I used floppix page and linuxconfig.org Wiki as a base for my learning process (and source for this article), however I had to write down my own memo-list to be able to quickly find, what I’m looking for.

Read More “Introduction to bash scripts”

No Samba access after password change

Let us understand it. Windows is stupid and idiotic system. Suppose, you store (remember) your NAS’s Samba username and password, so you don’t have to provide it, each time you access your local network share. If you thenchange your user password, Windows either won’t detect the fact that password has changed or, even if it detect it, it won’t show you login/password dialog box to provide new one. Instead, it continue to provide NAS with wrong (outdated) password.

Read More “No Samba access after password change”