Archive for April, 2014

How to pass ITIL preparation – Dumps, PC and Mobile Android software to prepare

Wednesday, April 30th, 2014

ITIL-service-design-serice-operations-service-transition
I'm just coming from my ITIL (Information Technology Infrastructure Library) Foundations Exam. ITIL Certification is mandatory for all HP employees and everybody in my team already passed it. Thanks God I passed the ITIL as well with 87.5%.

To prepare for the exam I used Dump files (files with questions and answers given to people on previous exams) and software that simulates testing Avanset Visual CertExam Manager on PC as well as VCE Exam Simulator for Mobile.

VCE Exam Simulator is a test engine designed specifically for certification exam preparation. It allows you to create, edit, and take practice tests in an environment very similar to an actual exam.

ITIL exam was held here in Sofia in Technologica EAD Study Center. ITIL exam is kindly paid by HP and costs $250. ITIL Foundation is first level of certification next one is ITIL intermediate.

In order to prepare for ITIL it took me about half a day reading the ITIL Dump files (you can download them here) and 2 days of actively simulating the exams mainly with VCE EXam Simulator on my Android based mobile.
For those who want to become ITIL professionals and are going to certify further in ITIL Intermediate I recommend check all the ITIL Books covering the ITIL v.3 exam (here).

If you have the time and you want to have in depth understanding on ITIL also download and watch this ITIL Exam preparation Videos.

Here are also ITIL Foundation v.3 Dumps for Visual Cert exam manager. By the way ITIL exam is nowadays is required for almost anyone employeed in middle or large sized IT companies so if you still don't know anything about it and you're working or you will be working in the IT field take a look at. Lastly when I was looking for job offers I've noticed there are already plenty of companies who either require the candidate to have an ITIL passed or count ITIL certified candidates advantageous.

Thomas Sunday – The day of Disbelievers

Monday, April 28th, 2014

Thomas-sunday-the-day-of-disbelieve-Thomas-reaching-to-Jesus-wounds

A week passed since we Christian celebrated Resurrection of Christ (Pascha). Each year on first Sunday after Easter in orthodox Church is celebrated the so called Thomas Sunday. So why is it called Thomas Sunday and why it is the day of disbelievers?
The root of this ancient Christian feast comes after commemoration of Christ desciple St. Thomas who disbelieved the testimony of ( 10 apostles ) and the Virgin Mary  that Jesus Christ is Risen from the Death.

The disbelieve of Thomas was logical and human cause even though Thomas was with the Apostles with Christ for 3 years, saw all Jesus miracles and shared the Secret Supper (Last Supper), and even knew in advance (heard by Jesus on Last supper) that Jesus will betrayed mocked, hanged on the Cross and Rise from the death on the third day, he disbelieved.

Thomas Sunday (Sundy of Thomas) is "the day of Disbelievers", because all are disbelievers in moments of their life not only those who believe God but all the humanity!  Even the most faithful Christian, be it a deacon, monk or priest has difficult moments in life where God's existence or providence for one's faith is seriously questioned.
The fallen nature of man is such that the initial belief in God given to man in Eden (Paradise garden) is broken, and only in Jesus's name through the Gift of Faith given by the Holy Spirit, believe in God is restored.

Thomas very much like unto everyone of us doubted the rumors of Christ resurrection and said he would only believe in Resurrected Christ only if he sees his hands nails print and put his fingers into Christ’s wounds to test he is not seeing a Ghost but Christ is alive in a body after his death.

Here is the Gospel reading re-telling the story in short:

“Then the same day at evening, being the first day of the week, when the doors were shut where the disciples were assembled for fear of the Jews, came Jesus and stood in the midst, and saith unto them, Peace be unto you.” (John 20:19)

“But Thomas, one of the twelve, called Didymus, was not with them when Jesus came. The other disciples therefore said unto him, We have seen the Lord. But he said unto them, Except I shall see in his hands the print of the nails, and put my finger into the print of the nails, and thrust my hand into his side, I will not believe.” (John 20:24-26)

And after eight days again his disciples were within, and Thomas with them: then came Jesus, the doors being shut, and stood in the midst, and said, Peace be unto you.
Then he said to Thomas, “Put your finger here; see my hands. Reach out your hand and put it into my side. Stop doubting and believe.”
Thomas said to him, “My Lord and my God!”
Then Jesus told him, “Because you have seen me, you have believed; blessed are those who have not seen and yet have believed.”
Jesus did many other miraculous signs in the presence of his disciples, which are not recorded in this book.
But these are written that you may believe that Jesus is the Christ, the Son of God, and that by believing you may have life in his name.” (John 20:31)

We Christians should be joyful for have not seen Christ in Flesh but have believed for we are blessed for his believe without seeing.

By same faith in God without seeing him even in old times the Jews were led by the Lord God in the desert have won wars by their believing without seeing God, prophets has prophecised, Simeon (The God receiver) hold The Savior (Christ) in his hands, by faith David won the battle with Goliath, by faith we understand the universe was formed at God’s command, by faith we know that the visible came out of the invisible.

o Kyrios mou kai o Theos mou (Greek) – My Lord and my God (Jn. 20:28) this declaration of faith clearly shows an unexpressable excitement of Thomas and his unexpectency to see Christ resurrected. Here it is interesting that here the son of God Jesus Christ is called by Thomas exactly how Jewish used to call God Yahweh (One and Only God) in the Old testament.

Today the evangical story is very accurate for our generation – a generation of disbelievers, even we who say we believe often doesn’t justify our believe with our deeds, we say we believe but we don’t keep God’s commandment “to love God and our neigbor like ourselves.” Often only difference between believers and disbelievers is on Sunday we believers visit Church and “play Christians”, but even but in daily life our deeds are same like unbelievers. Often many are disbelievers not because they reject God but because they never heard the Gospel or misheard it, also we disbelieve because we’re very much like st. Thomas, we often say “I will believe in God if I see him”, but even Thomas who saw God before the Crucifix and knew him disbelieved – a proof that often seing once could still leave space for doubt. The glorious event of Christ showing himself Alive to Thomas was made by Christ to establish the Church and strengthen faith of first Christians in resurrection. Nowadays there are plenty of people who question God’s existence saying that they will believe if they see but they’re not given to see the resurrected Christ because God knows that even if we see the Lord Jesus Christ resurrected we would try to rationally explain the phenomenon with holograms, modern technology or science.

Thomas Sunday is not only a day of Thomas disbelieve it is a day of disbelieve of all humanity. , St. Thomas should be an example even to all of us Christian disbelievers and non-believers that even if we disbelieve and doubt and strive to see God, He is powerful to come and appear Resurrected in His Glory to our souls.
Let us therefore have the Wisdom of the Holy Apostles and say together with them “Lord, Increase our faith.” Luke 17:5

How to Turn Off, Suppress PHP Notices and Warnings – PHP error handling levels via php.ini and PHP source code

Friday, April 25th, 2014

php-logo-disable-warnings-and-notices-in-php-through-htaccess-php-ini-and-php-code

PHP Notices are common to occur after PHP version upgrades or where an obsolete PHP code is moved from Old version PHP to new version. This is common error in web software using Frameworks which have been abandoned by developers.

Having PHP Notices to appear on a webpage is pretty ugly and give a lot of information which might be used by malicious crackers to try to break your site thus it is always a good idea to disable PHP Notices. There are plenty of ways to disable PHP Notices

The easiest way to disable it is globally in all Webserver PHP library via php.ini (/etc/php.ini) open it and make sure display_errors is disabled:

display_errors = 0

or

display_errors = Off

Note that that some claim in PHP 5.3 setting display_errors to Off will not work as expected. Anyways to make sure where your loaded PHP Version display_errors is ON or OFF use phpinfo();

It is also possible to disable PHP Notices and error reporting straight from PHP code you need code like:

 

<?php
// Turn off all error reporting
error_reporting(0);
?>

 

or through code:

 

ini_set('display_errors',0);


PHP has different levels of error reporting, here is complete list of possible error handling variables:

 

 

 

<?php
// Report simple running errors

error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings …)

error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini

error_reporting(E_ALL ^ E_NOTICE);
// Report all PHP errors (see changelog)

error_reporting(E_ALL);
// Report all PHP errors error_reporting(-1);
// Same as error_reporting(E_ALL);

ini_set('error_reporting', E_ALL); ?>

The level of logging could be tuned on Debian Linux via /etc/php5/apache2/php.ini or if necessary to set PHP log level in PHP CLI through /etc/php5/cli/php.ini with:

error_reporting = E_ALL & ~E_NOTICE

 

If you need to remove to remove exact warning or notices from PHP without changing the way  PHPLib behaves is to set @ infront of variable or function that is causing NOTICES or WARNING:
For example:
 

@yourFunctionHere();
@var = …;


Its also possible to Disable PHP Notices and Warnings using .htaccess file (useful in shared hosting where you don't have access to global php.ini), here is how:

# PHP error handling for development servers
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /home/path/public_html/domain/php_errors.log
php_value error_reporting -1
php_value log_errors_max_len 0

This way though PHP Notices and Warnings will be suppressed errors will get logged into php_error.log

Make Viber calls with no smartphone from Mobile to PC and from PC to Mobile – Bluestacks install android mobile apps on PC

Thursday, April 24th, 2014

Viber-for-smartphones-connect-freely-through-internet-voip-on-your-mobile

Since I've bought ZTE smat phone and I have Android on it, decided to install   Viber – iOS, Android and Desktop PC – Free Calls, Text and Picture sharing through the internet app. Viber is used by a lot of my people including many friends already so I installed it as well to be possible to speak for free with close friends …

Why Viber?


What makes this nifty app so great is its capability to make free calls over mobile phones through the Internet Viber.
Viber saves you a lot of money as calls are handled only through the Internet (you need Wifi on your mobile or Mobile 3G Internet access on phone) and you don't need to pay to your mobile operator 0.10 – 0.15 euro / cents per minute. Besides being Free another advantage of Viber is conversations sound quality which is much better than a regular phone call

Viber doesn't need a special registration, but as (login) identificator uses your mobile phone number – you just need to have a working Mobile operator phone num. Once registered under a number even if you change your mobile sim card to other operator (for example moving from country to country) still the Viber account will continue work. Another good reason to use Viber is it makes possible price free calls between different countries (for example if you travel a lot and you want to regularly speak with your wife) – in my case right now I'm in Bulgaria and my wife is in Belarus, so to save money and keep talking daily we use Viber daily.

What Devices and Operating System Viber Supports and what is Viber advantages / disadvantages ?


Another reason why Viber is so great is its multi-platform support it works on iPhone, Blackberry, Windows Phone, Nokia (Symbian), Windows, Mac OS and even (Korean own OS-ed) Bada devices. Some might argue that Viber is inferior to Skype and interms of Voice and Video quality its better because of its enhanced HD voice enhanced codecs, besides that Viber's video is still in Beta. However Viber has one big advantage it makes easy possible to reach people using just their Mobile Phone numbers where in Skype it takes time and effort to register in Skype install application on your Mobile keep yourself logged in in Skype and have all contacts previously added, all this happens automatically in Viber in time of installation of Viber App on your mobile.
 

Which Is Cheaper Viber or Skype?

Skype_VS_Viber-VOIP-Prices-which-is-cheaper-skype-or-viber


Once installed Viber could integrate itself with rest of your Mobile OS Call Manager and in time of call a friend number you have the opportunity to make it free Viber call. Viber are also selling Viber Credits so if you want to use your Viber Voice Over IP you can call external mobile operator numbers on a very very cheap price. Viber Calls to landline or mobile phones could be up to 400% cheaper than Skype! Whether you own a Smartphone it will be nice to give Viber a try.

Viber – How to make Phone calls between Desktop PC and Smarphone Mobile

 

One not so standard Viber use is to make Viber calls with no smartphone (at hand) from PC to another Viber equipped Mobile and vice versa.
I needed to make Viber calls from my ZTE Android running mobile to my wife's MacBook Air PC because her mobile is an old Nokia running obscure Symbian version which is not supporting Viber + she doesn't have an Internet access tariff switched on her mobile.

Here is what I had to do to make Phone calls between my Mobile Viber App and my wife's MacbookAir Notebook PC:
 

  • Install BlueStacks Web App Player

     

     

     

    BlueStacks_emulate-google-appstore-on-Windows-and-Mac-OS-android-emulator_Logo
    BlueStacks App Player is a software designed to enable Android applications to run on Windows PC, Apple Macintosh Computers and Windows tablets. BlueStacks is something like (VMware, Qemu) Virtual Machine which allows you to install and run any Android App on your Desktop PC.
    Its curious that app was created by Rosen Sharma in 2008 an ex CTO (Chief Technology Officer) of McAfee
     

  •  A mobile phone with a working SIM card (Nokia 6310 or any old mobile no need to be a smartphone
     
  • Desktop PC with Windows 7, 8 or PC with Mac OS


Install Bluestacks

BlueStacks is needed in order to emulate a smartphone on your PC, therefore once setupped Bluestacks. Launch it and  inside its necessary to login with your Gmail (Google Account) in order to allow access to Google Play Appstore on your PC.
viber with no mobile phone bluestacks
 

Installing and Verifying Viber

This is the most crucial and tricky part in order to make Viber working on any device you need to receive a special Viber verification code, you need to fill in this code to confirm Viber installation on PC. Here I assume you have BlueStacks running with Viber Application installed.

viber-running-under-bluestacks-on-windows-7-8-screenshot

First will be prompted to Agree with Terms and Conditions and provide Mobile Phone number for verification. Tell the Viber app that you have a smartphone with Viber already when prompted. After receving Viber Verification Code you need to fill in this code into BlueStacks Window (inside Viber should be running), go further to next step and you should be done with Desktop PC Viber number registration.

N.B. ! One brackets to open here is you need to have a working Mobile Phone number where you will receive the verification code as SMS, otherwise you cannot get the verification. On your filled in mobile phone number you will get the verification code as SMS.

Making Viber Calls to (Windows Mac) PC without Smartphone

There is no more further need for BlueStacks so you can uninstall it, however I preferred to keep it as its useful to be able to install Android Applications straight on your Desktop PC. To start using Viber on Desktop, just launch Viber application (not through BlueStacks) but the direct install.

Use Viber dial pad to dial your desired remote Smartphone number with Viber equipped.
Enjoy the free Internet calls ! 🙂
 

Best Windows tools to Test (Benchmark) Hard Drives, SSD Drives and RAID Storage Controllers

Wednesday, April 23rd, 2014

atto-windows-hard-disk-benchmark-freeware-tool-screenshot-check-hard-disk-speed-windows
Disk Benchmarking is very useful for people involved in Graphic Design, 3D modelling, system admins  and anyone willing to squeeze maximum of his PC hardware.

If you want to do some benchmarking on newly built Windows server targetting Hard Disk performance, just bought a new hard SSD (Solid State Drives) and you want to test how well Hard Drive I/O operations behave or you want to see a regular HDD benchmarking of group of MS Windows PCs and plan hardware optiomization, check out ATTO Disk Benchmark.

So why exactly ATTO Benchmark? – Cause it is one of the best Windows Free Benchmark tools on the internet.

ATTO is a widely-accepted Disk Benchmark freeware utility to help measure storage system performance. ATTO though being freeware is among top tools utilized in industry. It is very useful in comparing different Hard Disk vendors speed, measure Windows storage systems performance with various transfer sizes and test lengths for reads and writes.

ATTO Disk Benchmark is used by manufacturers of Hardware RAID controllers, its precious tool to test Windows storage controllers, host bus adapters (HBAs).

Here is ATTO Benchmark tool specifications (quote from their webstie):
 

  • Transfer sizes from 512KB to 8MB
  • Transfer lengths from 64KB to 2GB
  • Support for overlapped I/O
  • Supports a variety of queue depths
  • I/O comparisons with various test patterns
  • Timed mode allows continuous testing
  • Non-destructive performance measurement on formatted drives
  • Transfer sizes from 512KB to 8MB
  • Transfer lengths from 64KB to 2GB
  • Support for overlapped I/O
  • Supports a variety of queue depths
  • I/O comparisons with various test patterns
  • Timed mode allows continuous testing
  • Non-destructive performance measurement on formatted drives
  • – See more at: http://www.attotech.com/disk-benchmark/#sthash.rRlgSTOE.dpuf

Here is mirrored latest version of ATTO Disk for Download. Once you get your HDD statistics you will probably want to compare to other people results. On  TomsHardware's world famous Hardware geek site there are plenty of Hard Drives performance Charts

Of course there are other GUI alternatives to ATTO Benchmark one historically famous is NBench

NBench

nbench_benchmark_windows_hard-drive-cpu-and-memory

Nbench is nice little benchmarking program for Windows NT. Nbench reports the following components of performance:

CPU speed: integer and floating operations/sec
L1 and L2 cache speeds: MB/sec
main memory speed: MB/sec
disk read and write speeds: MB/sec

          SMP systems and multi-tasking OS efficiency can be tested using up to 20 separate threads of execution.

          For Console Geeks or Windows server admins there are also some ports of famous *NIX Hard Disk Benchmarking tools:

          NTiogen

          NTiogen benchmark was written by Symbios Logic, It's Windows NT port of their popular UNIX benchmark IOGEN. NTIOGEN is the parent processes that spawns the specified number of IOGEN processes that actually do the I/O.
          The program will display as output the number of processes, the average response time, the number of I/O operations per second, and the number of KBytes per second. You can download mirror copy of Ntiogen here


          There are plenty of other GUI and Console HDD Benchmarking Win Tools, i.e.:

          IOMeter (ex-developed by Intel and now abandoned available as open source available on SourceForge)

          iometer-benchmark-disk-storage-speed-windows
           

          Bench32 – Comprehensive benchmark that measures overall system performance under Windows NT or Windows 95, now obsolete not developed anymore abandoned by producer company.

          ThreadMark32 – capable of bench (ex developed and supported by ADAPTEC) but also already unsupported

          IOZone – filesystem benchmark tool. The benchmark generates and measures a variety of file operations. Iozone has been ported to many machines and runs under many operating systems.
           

          N! B! Important note to make here is above suggested tools will provide you more realistic results than the proprietary vendor tools shipped by your hardware vendor. Using proprietary software produced by a single vendor makes it impossible to analyze and compare different hardwares, above HDD benchmarking tools are for "open systems", e.g. nomatter what the hardware producer is produced results can be checked against each other.
          Another thing to consider is even though if you use any of above tools to test and compare two storage devices still results will be partially imaginary, its always best to conduct tests in Real Working Application Environments. If you're planning to launch a new services structure always test it first and don't rely on preliminary returned soft benchmarks.

          if you know some other useful benchmarking software i'm missing please share.

          Christ is Risen! Truly he is Risen ! – Christ is Risen in many Languages Happy Easter ! :)

          Monday, April 21st, 2014

          Voskresenie_Hristovo_Resurrection_of_Christ

          For one more year its the feast of feasts. Demons Fall, Angels sing in Heaven, People rejoice because Christ is Risen !  This is a day which God created for us to rejoice! Let nobody be sorrowful for the kingdom of Heaven is open for everyone! Let nobody cry for his sins because forgiveness has risen from the grave of the Savior !
          Let nobody be afraid from Death cause Christ – Savior's death has released us from death!

          "Peace be on you" – said Christ to his followers, conforting and strengthening their faith in the Resurrection.
          The savior appears to every Christian in the same way to hear his  voice saying "Rejoice!" Let we keep in our souls the graceful joy of Easter and by the same grace and faith always triumpth over sorrowful times and hardships of earthly life.

          In the spiritual fight we are not alone. Always until the end of ages the Resurrected Savior Jesus is with us according to his promise "I'm with you until the end of ages" (Mathew 28:20)

          Christ is Risen Troparion in many languages (part 1)

          Christ is Risen Troparion in many languages (part 2 )

           

           

          "I am the resurrection and the Life whoever believes in me even he dies he will live" (John 11:25)
          This is the eternal life given to us all Christians let us not be ashamed and loudly great all with

           

           

          CHRIST IS RISEN!
           

          Start Stop Restart Microsoft IIS Webserver from command line and GUI

          Thursday, April 17th, 2014

          start-stop-restart-microsoft-iis-howto-iis-server-logo
          For a decomissioning project just recently I had the task to stop Microsoft IIS  on Windows Server system.
          If you have been into security for a while you know well how many vulnerabilities Microsoft (Internet Information Server) Webserver used to be. Nowadays things with IIS are better but anyways it is better not to use it if possible …

          Nomatter what the rason if you need to make IIS stop serving web pages here is how to do it via command line:

          At Windows Command Prompt, type:

          net stop WAS

          If the command returns error message to stop it type:

          net stop W3SVC

          stop-microsoft-IIS-webservice
          Just in case you have to start it again run:

          net start W3SVC

          start-restart-IIS-webserver-screenshot

          For those who prefer to do it from GUI interface, launch services.msc command from Windows Run:

          > services.msc

          services-msc-stop-microsoft-iis-webserver

          In list of services lookup for
          IIS Admin Service and HTTP SSL
          a) (Click over it with right mouse button -> Properties)
          b) Set Startup type to Manual
          c) Click Stop Button

          You're done now IIS is stopped to make sure it is stopped you can run from cmd.exe:

          telnet localhost 80

          when not working you should get 'Could not open connection to the host. on port 80: Connection failed' like shown up in screenshot.

          How to promptly interrupt Windows shutdown in case of shutdown, restart mistake

          Thursday, April 17th, 2014

          windows-shutting-down-by-mistake-interrupt-howto-shot
          Its really annoying, when some Anti-Virus software or application updates itself and requires a Windows restart. It is even more annoying when you have 50 windows opened and suddenly they start closing one by one. In such cases it is precious to know there is way to Cancel Windows Shutdown using command line:

          Just press Windows (button) + R: type in;


          shutdown /a

          and press enter.

          That's it a quick cmd prompt will flash through the screen and Windows will stop shutdowning 🙂 Enjoy

          Save data from failing hard disk on Linux – Rescuing data from failing disk with bad blocks

          Wednesday, April 16th, 2014

          save-data-from-failing-hard-drive-data-recovery-badblocks-linux_1.jpg
          Sooner or later your Linux Desktop or Linux server hard drive will start breaking up, whether you have a hardware or software RAID 1, 6 or 10 you can  and good hard disk health monitoring software you can react on time but sometimes as admins we have to take care of old servers which either have RAID 0 or missing RAID configuration and or disk firmware is unable to recognize failing blocks on time and remap them. Thus it is quite useful to have techniques to save data from failing hard disk drives with physical badblocks.

          With ddrescue tool there is still hope for your Linux data though disk is full of unrecoverable I/O errors.

          apt-cache show ddrescue
           

          apt-cache show ddrescue|grep -i description -A 12

          Description: copy data from one file or block device to another
           dd_rescue is a tool to help you to save data from crashed
           partition. Like dd, dd_rescue does copy data from one file or
           block device to another. But dd_rescue does not abort on errors
           on the input file (unless you specify a maximum error number).
           It uses two block sizes, a large (soft) block size and a small
           (hard) block size. In case of errors, the size falls back to the
           small one and is promoted again after a while without errors.
           If the copying process is interrupted by the user it is possible
           to continue at any position later. It also does not truncate
           the output file (unless asked to). It allows you to start from
           the end of a file and move backwards as well. dd_rescue does
           not provide character conversions.

           

          To use ddrescue for saving data first thing is to shutdown the Linux host boot the system with a Rescue LiveCD like SystemRescueCD – (Linux system rescue disk), Knoppix (Most famous bootable LiveCD / LiveDVD), Ubuntu Rescue Remix or BackTrack LiveCD – (A security centered "hackers" distro which can be used also for forensics and data recovery), then mount the failing disk (I assume disk is still mountable :). Note that it is very important to mount the disk as read only, because any write operation on hard drive increases chance that it completely becomes unusable before saving your data!

          To make backup of your whole hard disk data to secondary mounted disk into /mnt/second_disk

          # mkdir /mnt/second_disk/rescue
          # mount /dev/sda2 /mnt/second_disk/rescue
          # dd_rescue -d -r 10 /dev/sda1 /mnt/second_disk/rescue/backup.img
          
          
          # mount -o loop /mnt/second_disk/rescue/backup.img

          In above example change /dev/sda2 to whatever your hard drive device is named.

          Whether you have already an identical secondary drive attached to the Linux host and you would like to copy whole failing Linux partition (/dev/sda) to the identical drive (/dev/sdb) issue:

          ddrescue -d -f -r3 /dev/sda /dev/sdb /media/PNY_usb/rescue.logfile

          If you got just a few unreadable files and you would like to recover only them then run ddrescue just on the damaged files:

          ddrescue -d –R -r 100 /damaged/disk/some_dir/damaged_file /mnt/secondary_disk/some_dir/recoveredfile
          

          -d instructs to use direct I/O
          -R retrims the error area on each retry
          -r 100 sets the retry limit to 100 (tries to read data 100 times before resign)

          Of course this is not always working as on some HDDs recovery is impossible due to hard physical damages, if above command can't recover a file in 10 attempts it is very likely that it never succeeds …

          A small note to make here is that there is another tool dd_rescue (make sure you don't confuse them) – which is also for recovery but GNU ddrescue performs better with recovery.
          How ddrescue works is it keeps track of the bad sectors, and go back and try to do a slow read of that data in order to read them.
          By the way BSD users would happy to know there is ddrescue port already, so data recovery on BSDs *NIX filesystems if you're a Windows user you can use ddrescue to recover data too via Cygwin.
          Of course final data recovery is also very much into God's hands so before launching ddrescue, don't forget to say a prayer 🙂

          How to detect failing storage LUN on Linux – multipath

          Wednesday, April 16th, 2014

          detect-failing-lun-on-linux-failing-scsi-detection

          If you login to server and after running dmesg – show kernel log command you get tons of messages like:

          # dmesg

           

          end_request: I/O error, dev sdc, sector 0
          sd 0:0:0:1: SCSI error: return code = 0x00010000
          end_request: I/O error, dev sdb, sector 0
          sd 0:0:0:0: SCSI error: return code = 0x00010000
          end_request: I/O error, dev sda, sector 0
          sd 0:0:0:2: SCSI error: return code = 0x00010000
          end_request: I/O error, dev sdc, sector 0
          sd 0:0:0:1: SCSI error: return code = 0x00010000
          end_request: I/O error, dev sdb, sector 0
          sd 0:0:0:0: SCSI error: return code = 0x00010000
          end_request: I/O error, dev sda, sector 0
          sd 0:0:0:2: SCSI error: return code = 0x00010000
          end_request: I/O error, dev sdc, sector 0
          sd 0:0:0:1: SCSI error: return code = 0x00010000
          end_request: I/O error, dev sdb, sector 0
          sd 0:0:0:0: SCSI error: return code = 0x00010000
          end_request: I/O error, dev sda, sector 0

           

          In /var/log/messages there are also log messages present like:

          # cat /var/log/messages
          ...

           

          Apr 13 09:45:49 sl02785 kernel: end_request: I/O error, dev sda, sector 0
          Apr 13 09:45:49 sl02785 kernel: klogd 1.4.1, ———- state change ———-
          Apr 13 09:45:50 sl02785 kernel: sd 0:0:0:1: SCSI error: return code = 0x00010000
          Apr 13 09:45:50 sl02785 kernel: end_request: I/O error, dev sdb, sector 0
          Apr 13 09:45:55 sl02785 kernel: sd 0:0:0:2: SCSI error: return code = 0x00010000
          Apr 13 09:45:55 sl02785 kernel: end_request: I/O error, dev sdc, sector 0

           

           

          This is a sure sign something is wrong with SCSI hard drives or SCSI controller, to further debug the situation you can use the multipath command, i.e.:


          multipath -ll | grep -i failed
          _ 0:0:0:2 sdc 8:32 [failed][faulty]
          _ 0:0:0:1 sdb 8:16 [failed][faulty]
          _ 0:0:0:0 sda 8:0 [failed][faulty]

           

          As you can see all 3 drives merged (sdc, sdb and sda) to show up on 1 physical drive via the remote network connectedLUN to the server is showing as faulty. This is a clear sign something is either wrong with 3 hard drive members of LUN – (Logical Unit Number) (which is less probable)  or most likely there is problem with the LUN network  SCSI controller. It is common error that LUN SCSI controller optics cable gets dirty and needs a physical clean up to solve it.

          In case you don't know what is storage LUN? – In computer storage, a logical unit number, or LUN, is a number used to identify a logical unit, which is a device addressed by the SCSI protocol or protocols which encapsulate SCSI, such as Fibre Channel or iSCSI. A LUN may be used with any device which supports read/write operations, such as a tape drive, but is most often used to refer to a logical disk as created on a SAN. Though not technically correct, the term "LUN" is often also used to refer to the logical disk itself.

          What LUN's does is very similar to Linux's Software LVM (Logical Volume Manager).