Wednesday, October 18, 2017

PROBLEM FORMATTING USB FLASH DRIVE


Showing unknown size of truncated size

Run CMD.EXE as administrator
Type following commands and hit ENTER key after each command.
· DISKPART starts the DiskPart program
· LIST DISK shows numeral assigned to disks
note the numeral assigned to your usb stick
The numeral 2 will be used in this example
· SELECT DISK 2
· DETAIL DISK the info shown will confirm the correctness of your selection
· CLEAN ALL the entire usb stick will be overwritten with zeros
· CREATE PARTITION PRIMARY create a primary partition on the USB stick
· FORMAT FS=NTFS format the partition
· ACTIVE the partition can contain operating system startup files
· ASSIGN the next available letter is assigned to the USB stick
· EXIT exit from the DISKPART program
· EXIT exit from the command shell

Monday, August 28, 2017

basic linux commands



ls = If you run ls without any additional parameters, the program will list the contents of the current directory in short form.

ls -l = detailed list

ls -a = displays hidden files
cp = Copies sourcefile to targetfile.
cp -r = Copies recursively (includes subdirectories)
mv = Copies sourcefile to targetfile then deletes the original sourcefile.
mv -b = Creates a backup copy of the sourcefile before moving
rm = Removes the specified files from the file system. Directories are not removed by rm unless the option -r is used.
rm -r = Deletes any existing subdirectories
rmdir = Deletes the specified directory, provided it is already empty.
cd = Changes the current directory. cd without any parameters changes to the user’s home directory.
mkdir = Creates a new directory.
cat = The cat command displays the contents of a file, printing the entire contents to the screen without interruption.
cat -n = Numbers the output on the left margin
less = This command can be used to browse the contents of the specified file. Scroll half a screen page up or down with PgUp and PgDn or a full screen page down with Space. Jump to the beginning or end of a file using Home and End. Press Q to exit the program.
grep = The grep command finds a specific searchstring in the specified file(s). If the search string is found, the command displays the line in which the searchstring was found along with the file name.
df = The df (disk free) command, when used without any options, displays information about the total disk space, the disk space currently in use, and the free space on all the mounted drives. If a directory is specified, the information is limited to the drive on which that directory is located.
df -h = shows human readable output of disk usage
du = This command, when executed without any parameters, shows the total disk space occupied by files and subdirectories in the current directory.
du -sh = Shows current folder size
du -sh * = List files/folders with their size in current folder
free = The command free displays information about RAM and swap space usage, showing the total and the used amount in both categories.
free -m = Shows output in human readable format
date = This simple program displays the current system time. If run as root, it can also be used to change the system time. Details about the program are available in date.
top = top provides a quick overview of the currently running processes. Press H to access a page that briefly explains the main options to customize the program.
kill = [You can kill processes which are executed only by you] Unfortunately, sometimes a program cannot be terminated in the normal way. However, in most cases, you should still be able to stop such a runaway program by executing the kill command, specifying the respective process ID (see top and ps).
kill sends a TERM signal that instructs the program to shut itself down. If this does not help, the following parameter can be used:
kill -9 = [You can kill processes which are executed only by you] Sends a KILL signal instead of a TERM signal, with which the process really is annihilated by the operating system. This brings the specific processes to an end in almost all cases.
ping = The ping command is the standard tool for testing the basic functionality of TCP/IP networks. It sends a small data packet to the destination host, requesting an immediate reply. If this works, ping displays a message to that effect, which indicates that the network link is basically functioning.
passwd = Users may change their own passwords at any time using this command. Furthermore, the administrator root can use the command to change the password of any user on the system.
clear = This command cleans up the visible area of the console. It has no options.

Useful options
——————–
mv -f force move by overwriting destination file without prompt
mv -i interactive prompt before overwrite
mv -u update – move when source is newer than destination
mv -v verbose – print source and destination files
man mv/info mv help manual
 


List commands to display the content of a file

head, tail, cat less, more etc

eg.  $ cat file_name.txt

Friday, April 14, 2017

Visual Studio 2017 15.1 April 2017 and Windows 10 version 1703 update _march_2017

Be carreful with Visual Studio Professional 2017 (version 15.1)
Release date 4/4/2017 even if you install the latest version from on top of latest Windows 10 OS from March 2017 which was released before obviously.... Visual Studio will throw at you the most annoying dialog windowd from which you can't copy past the error message and from there you can't open any Xamarin or XAML project

Go figure how stupid you need to be to do such things... Poor team synchronization at Microsoft...
Why can't you check the OS first instead of wasting precious time.....

en_windows_10_enterprise_version_1703_updated_march_2017_x64_dvd_10189290.iso

Get your shit together Microsoft



[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.Windows.UniversalCRT.Msu.8 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.2,6.3)'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.Windows.UniversalCRT.Msu.81 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.3,6.4)'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.Net.4.6.FullRedist as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1.1,6.4)'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.Windows.UniversalCRT.Msu.7 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.DiagnosticsHub.KB2882822.Win7 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0031][2017-04-14T14:19:05] Marking package WebSocket4NetV2 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0031][2017-04-14T14:19:05] Marking package Component.WebSocket as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.Net.4.6.1.FullRedist as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1.1,10.0.10241)'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.Windows.81SDK.Store.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.Windows.81SDK.Store.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.Windows.81SDK.Desktop.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.Windows.81SDK.Desktop.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0031][2017-04-14T14:19:05] Marking package Microsoft.VisualStudio.OfficeDeveloperTools.WindowsIdentityFoundation.Msu as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '(,6.2)'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.Windows.UniversalCRT.Msu.8 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.2,6.3)'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.Windows.UniversalCRT.Msu.81 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.3,6.4)'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.Net.4.6.FullRedist as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1.1,6.4)'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.Windows.UniversalCRT.Msu.7 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.DiagnosticsHub.KB2882822.Win7 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0031][2017-04-14T14:19:06] Marking package WebSocket4NetV2 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0031][2017-04-14T14:19:06] Marking package Component.WebSocket as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.Net.4.6.1.FullRedist as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1.1,10.0.10241)'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.Windows.81SDK.Store.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.Windows.81SDK.Store.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.Windows.81SDK.Desktop.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.Windows.81SDK.Desktop.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0031][2017-04-14T14:19:06] Marking package Microsoft.VisualStudio.OfficeDeveloperTools.WindowsIdentityFoundation.Msu as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '(,6.2)'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.Windows.UniversalCRT.Msu.8 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.2,6.3)'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.Windows.UniversalCRT.Msu.81 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.3,6.4)'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.Net.4.6.FullRedist as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1.1,6.4)'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.Windows.UniversalCRT.Msu.7 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.DiagnosticsHub.KB2882822.Win7 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0050][2017-04-14T14:19:23] Marking package WebSocket4NetV2 as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0050][2017-04-14T14:19:23] Marking package Component.WebSocket as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.2)'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.Net.4.6.1.FullRedist as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1.1,10.0.10241)'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.Windows.81SDK.Store.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.Windows.81SDK.Store.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.Windows.81SDK.Desktop.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.Windows.81SDK.Desktop.DirectX.Msi as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '[6.1,6.3]'.
[3554:0050][2017-04-14T14:19:23] Marking package Microsoft.VisualStudio.OfficeDeveloperTools.WindowsIdentityFoundation.Msu as not applicable due to reasons: The current OS Version '10.0.15063.0' is not in the supported version range '(,6.2)'.

Thursday, April 06, 2017

Add https to apache on Ubuntu 16


Install

On Ubuntu systems, the Certbot team maintains a PPA. Once you add it to your list of repositories all you'll need to do is apt-get the following packages.
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-apache 

Get Started

Certbot has a fairly solid beta-quality Apache plugin, which is supported on many platforms, and automates both obtaining and installing certs:
$ certbot --apache
If you're feeling more conservative and would like to make the changes to your Apache configuration by hand, you can use the certonly subcommand:
$ certbot --apache certonly
To learn more about how to use Certbot read certbot documentation.

Automating renewal

The Certbot packages on your system come with a cron job that will renew your certificates automatically before they expire. Since Let's Encrypt certificates last for 90 days, it's highly advisable to take advantage of this feature. You can test automatic renewal for your certificates by running this command:
certbot renew --dry-run
More detailed information and options about renewal can be found in the full documentation.

Sunday, February 26, 2017

Wordpress plugin must have

WP Google Authenticator

I wouldn’t even overthink adding this plugin to your WordPress site. It’s no hassle and will add an extra layer of security to your website. An alternative could be Rublon, which works in a similar manner, but we usually use WP Google Authenticator.

Login Lockdown

For an extra layer of security, we recommend installing a plugin like Login Lockdown, that prevents automated login requests from firing a gazillion login attempts. If some IP range does a surplus of attempts, the login function is disabled for all requests from that range. For more details, check Login Lockdown in the plugin repo.

Any image compression plugin

Yes, I would like to name just one. But the truth is that it depends on your website what plugin works best. We have used Smush, tried EWWWKraken.io has a plugin and ShortPixel has one. And has anyone tried the premium Imagify? I would really like to see a comparison for these plugins from an independent, image-heavy website. For now: pick one and use it.

Ninja Forms or Gravity Forms

Both are great plugins to create drag-and-drop forms. Both provide an option for conditional logic and are really easy to use. If you have a form on your website, and any website that has a contact page should have a form, I recommend using Gravity Forms

Wednesday, December 21, 2016

How to create animated GIFs for UI design presentations

 In Part 1 of the series, I show how to create the animated GIF above.

Key aspects of these animated GIFs are
  • Showcase of actual work flows
  • Convey the beautiful transitions between different app states
  • Small size that can be embedded on the web

 
Well, let’s get right into it. Here are some of the resources you will need.
 

Tools

You will need
  • After Effects CS6 or CC
  • Photoshop CS6 or CC
In After Effects
  1. Create the transitions in one composition
  2. Create the presentation in another composition
  3. Export composition
In Photoshop
4. Optimize into a GIF

Create your transition composition

Step 1. Fire up After Effects and create a Composition > New Composition Dimensions similar to the Iphone (either 320px by 480px or 640px by 960px) Frame rate 29 Duration 6 seconds 

 
Step 2. Import the background image of London by clicking on File > Import > File And then drag the PNG file under the Project window to the Comp1 window. Resize the background to fit the screen. 


 
Step 3. Create three blue boxes(Shape layers) of width 120px which will expand and fall down the screen during the animation and a fourth box on width 360px. Type in text of the weather and the forecast temperatures. 

 
Step 4. Add the text Snowy at the top and a cloud with six circles (At this point you apply your transitions and animations to the text and the shape layers for the animation you desire). I will cover my transitions and cool animations that you can apply in Part 3. Follow the blog to get updates when I put it up.
Step 5. Save your project but do not close it.
 

Presentation composition

Step 1. Create a New composition within the same project. This will automatically be called Comp2.  Dimensions: 1280px by 720 Frame rate: 29 The duration is dependant on the length of your effect. I had 6seconds.
Screen Shot 2014-05-09 at 5.14.28 PM
Step 2. Import the Iphone background and size it to the screen.

 
Step 3. Drag Comp1 from the Project window to the Comp2. You should now have the composition we created earlier, as a layer in the second composition.
 


Step 4. As in Photoshop, we need to Distort the Comp1 layer to match with the background layer image. With the Comp1 layer selected, click on Effect > Distort > Corner Pin   

 
Step 5. Move the corners with a crossed circle on Comp1 to match with the corners of your background image until your composition looks like a finished article.

Some key points

When you play your second composition, your first composition’s animation will automatically play as well. Save your project. Well done, we have created an After Effects composition with key mobile animations and presented on a mobile phone background. In the next part of this series, we shall present how to save the project and eventually save it as a GIF. For now enjoy your creation.

Sunday, October 30, 2016

How To Fix: External Disk Drive Suddenly Became RAW

 How To Fix: External Disk Drive Suddenly Became RAW

DISCLAIMER: These example use techniques that I actually employ once to recover a drive from a raid 1 bay where both drive where bad. This tutorial might be wrong or dangerous or inefficient. If you try yourself, it might cause damage or irreparable loss. I take no responsibility for anything you do based on my examples or the information that his provide.


A common and befuddling problem with computers is the sudden and seemingly inexplicable disappearance of an external hard drive that has been functioning properly. It can be a breathtaking experience to suddenly be told that your data, often irreplaceable pictures and documents, might be gone forever.
This can even happen on a pair of Raid 1 hard drive because maybe you purchased them as a pair at the same store and they both went down at the same time. I think it is almost better to buy them at different store location or to make sure they were not manufactured at the same time :)

As with many similar situations in life the appropriate response is “Don’t panic”. When approached sensibly and carefully, the situation can be resolved and the data saved more times than not.

Error Messages

Common error messages associated with the sudden inability to access an external hard disk drive.


Windows XP




Windows 7
DO NOT FORMAT THE DRIVE

When attempting to access the drive in Windows you may see a message asking you to format the drive DO NOT FORMAT THE DRIVE
You need to format the disk in drive before you can use it.
Do you want to format it?

Another error that you may see when trying to access the drive in Windows from a program or the command line is…
This volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted.

Attempting to run chkdsk in an attempt to repair the problem will give an error also…
chkdsk can not be run on the drive
The type of the file system is RAW.
CHKDSK is not available for RAW drives.

The Disk Management window shows the partition as either RAW or without a filesystem type.


Windows XP

Windows 7



Properties of the drive show that both used and free spaces are 0 byte in size for the raw drive



What does RAW partition mean

A RAW filesystem simply means that it is a filesystem that is not recognized by Windows. Therefore all the available filesystem drivers are unable to mount the filesystem as a drive. This often happens when the records determining the filesystem type or location on the disk are damaged or corrupted, usually the partition table or the boot sector.
Since Windows sees no filesystem in the partition, it prompts you to format it in order to create a filesystem on it. DO NOT FORMAT IT. 


Why does it happen and how to avoid it

The most common cause of external hard drives suddenly becoming RAW drives is if they are disconnected from a computer without using the “Safely Remove Hardware” option. This can happen in many ways such as a power failure, unplugging the drive from the USB port or from its AC adapter, a problem with the computer that causes it to temporarily disconnect the USB hubs and many more circumstances can lead to this occurring.
Always use “Safely remove hardware” to disconnect the drive. Left click the icon on the taskbar, select the device from the menu, and wait for the confirmation message.

Before proceeding beyond this point, you need to be aware of the risks involved. If the problem with the drive is not simply a logical error but is a manifestation of physical damage then the more you use it and try to repair, the worse the damage may become. To minimize the risks, the drive can be taken to a professional who is experienced in this type of repair. The drive should not be making strange clicking or beeping noises. That means that there is definitely physical damage and it should be sent to a facility with the proper tools and environment to repair/recover it since trying to repair it as described in this post can make that situation worse. If you wish to continue on your own there are three important rules to remember.

1. Computer problems are variable. You may very well come up with a different situation than I outline below. Make sure that you stop and think things through carefully when the process becomes different than I describe.

2. You DO NOT WANT TO WRITE ANYTHING TO THE RAW DRIVE except for the repaired MBR and repaired Boot Sector if necessary. Any other writing can overwrite data on the drive that you would want to keep.

3. This repair does not apply to solid-state drives (SSD). They are very different than normal drives and can erase important data on a RAW partition just by connecting power to them. 

Accessing and Assessing a Hard Drive’s S.M.A.R.T. Data to Determine if There is Physical Damage

Being able to effectively analyze the S.M.A.R.T. data on a hard disk drive (HDD) enables you to quickly identify problems that can aid you in recovering all of the data from it before it becomes irretrievable or requires significant expense to retrieve.
S.M.A.R.T. stands for Self-Monitoring, Analysis and Reporting Technology and is the hard drive’s record of its internal diagnostic monitoring and usage statistics packaged for being accessed externally. The primary purpose of S.M.A.R.T. is to alert us to an impending failure of the drive while there is still time to save the data. When a hard drive reports that the S.M.A.R.T. health is FAILED you must get the important data off of it immediately and not use the drive anymore.
IT IS IMPORTANT TO UNDERSTAND THAT DIFFERENT MANUFACTURERS AND DIFFERENT DRIVE MODELS CAN STORE AND DISPLAY DIFFERENT SUBSETS OF S.M.A.R.T. DATA AND CALCULATE VALUES AND TOLERANCES DIFFERENTLY.
S.M.A.R.T. data is best used as a general guide. For specifics, the hard drive’s technical documentation must be consulted. Sometimes that information is difficult to come by and can be proprietary. For example, the formulas for how some manufacturers calculate normalized values for attributes can be very difficult to find.


Proper analysis of S.M.A.R.T. data

  • Can help determine if the problem is physical damage or just logical damage.
    • With logical damage, the drive can be trusted and continue to be used after being repaired.
    • With physical damage, you want to get any important data off of the drive and replace it.
  • Helps you choose the best method for recovering all of the data from the drive.
  • Prevents you from accidentally doing things that may make matters worse.


In order to check the S.M.A.R.T. data on a HDD

  • The drive should not be making strange clicking or beeping noises. That means that there is definitely physical damage and it should be sent to a facility with the proper tools and environment to repair/recover it.
  • The drive needs to be accessible by the computer’s BIOS during POST (responds to the ATA command IDENTFY_DEVICE). In other words, the drive should be visible in Windows.
  • In the case of external drives connected via USB they need to be detected by the computer’s Plug and Play software (responds to the ATA command IDENTFY_DEVICE).

After making sure that the connection between the drive and the computer is correct and its quality is the best it can be, you need to check the health of the drive itself. Then you can rule out physical damage that requires repair with specialized tools in a controlled environment.

What We Are Looking For

·        Does the drive make noises that it did not make before?
o   Loud clicking or a periodic beeping sound may indicate mechanical damage. Physical damage may require the drive to be sent to a facility with the proper tools and equipment to recover the data.
·        Does S.M.A.R.T. show any errors or bad attribute values?
o   We look at the Raw Value of S.M.A.R.T. attributes with ID#s 5, 191 and 197.
·        Does it pass the S.M.A.R.T. Short Self-Test?
o   We run the S.M.A.R.T. Short Self-Test.
If it does not pass any of these tests, you need to take it to a data recovery lab and have it professionally recovered otherwise you risk making things worse.


View S.M.A.R.T. data with GSmartControl

Get a copy of GSmartControl for Windows
http://sourceforge.net/projects/gsmartcontrol/files/0.8.7/gsmartcontrol-0.8.7-win32.zip/download
Unzip it and run gsmartcontrol.exe
Double-click your drive and click the ATTRIBUTES tab.
  • If ID #05 Reallocated Sectors Count is listed and has a RAW VALUE greater than 5 then there is physical damage in the form of bad sectors.
  • If ID #191 G-sense Error Rate is listed and has a RAW VALUE greater than 0 then that means the drive has been dropped or bumped hard.
  • If ID #197 Current Pending Sector Count is listed and has a RAW VALUE greater than 5 then there is physical damage in the form of bad sectors.
Next, click on the PERFORM TESTS tab and execute the SHORT TEST. If it does not pass the test then there is physical damage.

If there is no indication of physical damage then you can continue. In order to repair the most common problems that cause an external disk to suddenly become RAW we will use TestDisk.
Download Testdisk
http://www.cgsecurity.org/wiki/TestDisk_Download
and run testdisk_win.exe

TestDisk is a console application so you have to use your keyboard to interact with it instead of your mouse. Won't work without a keyboard on most tablet as most on screen touch keyboard are lacking down/up arrow This is the case for  Samsung tablet

If you want to recover your data I recommend to buy a sabrent dual 3.5 HDD external enclosure where you can snap the bad disk in. Before you proceed. Purchase a disk of the same size and format it. The disk can be used to copy your data when possible using TestDisk

Run testdisk_win.exe as admin

Choose Create log if you want to document your steps 

Select the disk that you can't access - make sure the disk is online and that you identify clearly the disk you will use to recover/copy data onto vs your bad disk.
select that disk. Make sure that your external disk is highlighted
Choose Proceed and hit enter 


in Partition Table Type selection. most tutorial recommend to move the cursor from None to Intel. In my case and certainly with recent version of testdisk for NTFS disk, I just left the selection at None and just press Enter. Then TestDisk immediately found the NTFS partition.

Select Analyse and hit enter

The partition data looks incorrect (an explanation of why is beyond the scope of this article)
Select Quick Search and hit enter

When the Quick Search completes, we see one partition (if you only see the option to CONTINUE at the bottom of the screen press ENTER one time to continue to the screen that you need to be at).

Assuming that the partition was shown correctly (Structure:OK) 
Lets look at the data on that partition press
P
and you should see a list of files/folders in the partition.

If none were shown, I would assume there was none to show or Test Disk was unable to do the job :(



Hmmm… This looks like a bunch of diagnostic tools but not our missing data. We’ll need to look further. This means that you probably have more than one partition on that disk Press
Q
to go back a screen and then press
enter

To get to this screen, select DEEPER SEARCH and press enter.

Naturally, the Deeper Search takes longer than the Quick Search

When the Deeper Search completes we now see two partitions. The one we saw after the quick search and maybe another one.


Select the new partition and press
P
to see the files/folders and now we see the data we want to make visible again.


You can browse the FAT select parent folder by moving pointer to it use .. to move up etc...
pres a to select all from top folder this will select all folders and sub folders and files

press c to copy

now select target drive. The drive MUST BE a different drive than the damage drive.

Be patient it will take a while.... The file count will increase in green some might be bad meaning lost forever. At least you recover some of your data!