Intelligent standby for Server- and NAS-Systems

177px IEC5009 Standby Symbol.svg  Intelligent standby for Server  and NAS Systems

I have developed a concept which reduces the power consumption and uptime of my network attached storage.

The system is therefore intelligent because it is recognizing that its needed or not on its own and sets to standby.There are many methods out there how to do that but none of them worked for me quiet well because the system turned off when i was coping files what was not really meant to be. For doing it my way i am using simple bash scripts which i would like to share with you and explain. Continue reading

Hard Drive Benchmark using Linux

If you want to know how performing you hard drive is you have to install bonnie++ first.

Using Debian and it derivatives its just:

# apt-get install bonnie++

After the installation create an empty folder on the drive you want to test. Bonnie++ will create temporary random content there while the benchmark is running.

Because i am having just one drive in my notebook the decision wasn’t really hard. The Partition / is nearly full so i used /home.

# mkdir /home/tmp

Now we can let bonnie++ attack the directory icon smile Hard Drive Benchmark using Linux . For having the needed permissions i had to run bonnie++ as root.

# bonnie++ -u root -d /home/tmp/

Now this will take a bit time but you will get a lot of information. (much more then a Windows application can process). When the process is done you should get some output like that:

(Please do not rate my benchmark. It was done under load)

bonnie++ -u root -d /home/tmp/
Using uid:0, gid:0.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
srv-rs-dk 4G 620 98 67046 11 36145 7 2149 93 87481 9 187.5 5
Latency 13896us 621ms 1733ms 61811us 160ms 5080ms
Version 1.96 ------Sequential Create------ --------Random Create--------
srv-rs-dk -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
Latency 14986us 677us 1194us 729us 4487us 746us

Well this might disturb you but: Don’t Panic!

  • Per Char 4G has been written with 620 K/sec and an CPU-Usage of 98%
  • Per Block 4G has been written with 67046 K/sec and an CPU-Usage of 11%
  • Per Rewrite 4G has been written with 36145 K/sec and an CPU-Usage of 7%
  • Sequentiell Input done with 2149 K/sec and an CPU-Usage of 9%
  • Random done with 187,5 K/sec and an CPU-Usage of 5%

Systembackup using rsync

Deutsche Version

Why does nobody a backup if everybody is talking about it? Using a unix-system with rsync it is that easy!:

First you should know some things about rsync: its an network protocol for synchronizing files. The interesting thing about rsync is that it is able to compare parts of a file and if it is needed sync only that parts. For example if there was changed one line of a config-file it will only transfer the information of that line through the network. Thats why rsync is really lightweight and fast. I am backing up my Linux-systems using rsync. I want to show how i created a backup script and how it is working.

  • -a is short for following commands:
    • -r copies the subfolders too
    • -l copies symbolic links
    • -p preserve permissions of the source file
    • -t preserve timestamps of the source file
    • -g preserve group permissions of the source file
    • -o preserve user rights of the source file (root only)
    • -D preserve device files (nur root)
  • -z Use compression (if you are storing your backup to a network attached storage)
  • -c skip based on checksum, not mod-time & size (take more time but is saver)
  • ‘-e ssh’ defines the remote shell
  • –delete delete extraneous files from dest dirs
  • –stats Exports some stats
  • ‘–exclude=foobar’ excludes the mask ‘foobar’

In the target path there is “$(hostname)” included. That is needed if you want to back up more then on system in the same path because it creates a folder named by the hostname. (for example “claw-desktop”)

Logs are exported to /var/log/ with the date year-month-day: “backup$(date +%Y%m%d)”


I am running this script as cronjob (crontab) as root and for target i use a samba mountpoint.

If you have any question or suggestions feel free to contact me.

rsync -aovpzc -e ssh –delete –stats /etc /media/ftp/RAID5_0/.backup/$(hostname) >>/var/log/backup$(date +%Y%m%d)
rsync -aovpzc -e ssh –delete –stats /etc /media/ftp/RAID5_0/.backup/$(hostname) >>/var/log/backup$(date +%Y%m%d)