Tuesday, 14 October 2014

How to Stress Test the Hard Drives in Your PC or Server

How to Stress Test the Hard Drives in Your PC or Server



You have the latest drives for your server.  You stacked the top-of-the line RAM in the system.  You run effective code for your system.  However, what throughput is your system capable of handling, and can you really trust the capabilities listed by hardware companies?

Why Use SQLIO?

If we want to know the IO ability of our drives, SQLIO makes an excellent tool (like the Federal Reserve, we’ll be running “stress tests” on our drives, not the banking system). You can use SQLIO as an addition to your server set up to find the maximum ability that your drives can handle, which will communicate how effective your server set up is.
As an example, let’s suppose that we have three drives to our server, an F drive, G drive and C drive. If we have our MDF on the F drive, the LDF on the G drive and our OS on our C drive, we can evaluate whether our set up is effective. For instance, if our MDF file is the busiest in terms of writes and reads over our OS and LDF, we would want our MDF file to be on the drive that can handle the highest through put, if we’re aiming for an efficient server arrangement.
image
image
image
SQLIO helps us determine which drive would be better for our server arrangement. Using the above example with the graphs (representing the writes and reads for the OS, LDF and MDF), since we’re seeking efficiency, we would place our MDF file on the fastest drive since our MDF is the busiest. If our SQLIO analysis showed that F was our fastest drive, we would place our MDF file on drive F.

Awesome!  How Can I Obtain SQLIO?

Microsoft offers this excellent tool for free (currently available at the website http://www.microsoft.com/download/en/details.aspx?id=20163). Unfortunately, links at Microsoft can change frequently, so if the above link fails to work, you can Google “SQLIO” and locate the tool from the website.

How Do I Perform A Stress Test?

1.  We’ll need to modify the file param.txt, which specifies to SQLIO where to locate the test file. When you load the file param.txt (found in the SQLIO folder), you should see something similar:
image
For the sake of our test, if your main drive is different, you’ll want to change the location of the drive.  Also, depending on how large you want your test file to be, you can change the size of the file (in this case, 4096).  Note that if you want to test multiple drives, you can do the same (copy and paste the code below this to save time):
c:\testfile.dat 2 0x0 4096
h:\testfile.dat 2 0x0 4096
i:\testfile.dat 2 0x0 4096
p:\testfile.dat 2 0x0 4096
In the above example, we’ll be testing drives C, H, I and P.
2.  Create a batch file titled SANtest.bat in your SQLIO folder (often found in Program Files), as you’ll be running this batch file through the command prompt (shown later). This file can be created in notepad and will be created based on what you’re seeking. Keep in mind, that this file will be the instructions for the SQLIO test on your drives; the longer the list of lines in this file, the more time it will take. However, a long list means that the test is more comprehensive. Depending on what you’re seeking, you may want a long batch file or a short batch file.  Below this, I show an example of how each line will look in your SANtest.bat file; the important parameters, I’ll cover:
image
image
image
image
VariableWhat the Variable Performs
-kW or -kRThis specifies the procedure. W will write and R will read. If your disks are read-only, you would only do R.
-frandom or -fsequentialThis states whether the IO will be sequential or random.
-t2 or -t4, -t8, -t16 …Threads that will be run at the same time.
-o1 or -o2, o4, o8 …The number of outstanding requests.
-s90 or -s60, -s120 …How long the test will take in seconds. I’ve seen suggestions which range from 90 to 120.
-b6464kb, which depending on the system, you may want this to be 4kb, 8kb, or cetera.  This involves a test of SQL server which would be 8kb and 64kb.
-dCThe letter drive for the test. Note that if your drive is F you will want to change this value to -dF (or -dG for a G drive that you want to test).
After running SQLIO multiple times, the key for a batch file is organization.  I’ve found the following code below to be the most useful for a quick test:
sqlio -kR -frandom -t8 -o2 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -frandom -t8 -o4 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -frandom -t8 -o8 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -frandom -t8 -o16 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -frandom -t8 -o32 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -frandom -t8 -o64 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -frandom -t8 -o128 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -frandom -t8 -o2 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -frandom -t8 -o4 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -frandom -t8 -o8 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -frandom -t8 -o16 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -frandom -t8 -o32 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -frandom -t8 -o64 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -frandom -t8 -o128 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -fsequential -t8 -o2 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -fsequential -t8 -o4 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -fsequential -t8 -o8 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -fsequential -t8 -o16 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -fsequential -t8 -o32 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -fsequential -t8 -o64 -s90 -b64 -dC -BH Testfile.dat
sqlio -kR -fsequential -t8 -o128 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -fsequential -t8 -o2 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -fsequential -t8 -o4 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -fsequential -t8 -o8 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -fsequential -t8 -o16 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -fsequential -t8 -o32 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -fsequential -t8 -o64 -s90 -b64 -dC -BH Testfile.dat
sqlio -kW -fsequential -t8 -o128 -s90 -b64 -dC -BH Testfile.dat
This is also the code we’ll be using to test a drive later in this article to show how to interpret the results (you can copy and paste it for a demo test on your system).  Depending on what you want your drives to do, you may want a more comprehensive code with more or less threads and more or less outstanding requests.
3.  Time to run our test.  The following screenshots show the process.  You will go to the command prompt, find the location of the file SQLIO, and run the test by typing santest.bat > results.txt and hitting enter.
image
image
The process will consume some time, but the process of setting up and running the test are complete.  The final step is interpreting the results.

How To Interpret the Results

Your interpretation will be contingent on what you want from your system.  Recall, that if you have a system or server that is read only, you want to run a read only test.  You wouldn’t worry about your system performing poorly with writes, if it’s read-only (and you wouldn’t need to run a writes test).
After you perform the test, your results.txt file should look something like the following when you load it:
image
Note that each pass from our test batch file produces a block of information produced in the results file (shown in the blue outlined text below this) and if we’re concerned about the capacity, we want to look at the IOs per second and the MBs per second (shown in the red outlined text below this):
image
image
The results file lists the IOs per second and MBs per second (shown in the red outlined square above this).
The Outstanding IO(s) (a category listed in the four tables below this) are determined by the number of threads and outstanding requests on the test batch file (SANTest.bat). For instance, if you have two threads (-t2) and eight outstanding requests (-o8), you would have sixteen (16) IOs. From the test file shown above this, you can see that our thread count remains at eight (-t8) throughout the test, while the outstanding requests begin at two (-o2) through one hundred twenty-eight (-o128).
From the results, we can enter our information into tables. Note, that you can also create a SQL or PowerShell script and have it produce the results in either a database in SQL or Excel document. For the sake of this article, we will only show brief results and how to interpret these (though, for additional information, look at the references at the end).
image
This drive reaches its random read capacity at approximately 250 – 260 IOs per second and 15 – 16 MB per second.
image
The test drive reaches is random write capacity at approximately 180 to 190 IOs per second and 10 – 11 MB per second.
image
The test drive reaches its sequential read capacity at approximately 1600 IOs per second and 90 – 100 MB per second.
image
The test drive reaches its sequential read capacity at approximately 1500 IOs per second and 90 – 100 MB per second.
While this test shows us the result of one drive, if we had multiple drives we could begin to analyze which drive could handle certain loads better.  If we had a drive, which processed much lower numbers than the test drive listed above this, we wouldn’t place our busiest system on it.  Likewise, if we had a drive that processed through put much faster than the test drive above this, we would want our busiest system on it.  SQLIO helps us determine what our drives can handle, so that we can build a system which optimizes performance.


How to Bypass and Reset the Password on Every Operating System

How to Bypass and Reset the Password on Every Operating System



reset-or-bypass-operating-system-or-device-password
Passwords can be reset or bypassed on every operating system. On Windows, Linux, and Mac OS X, you can gain access to a computer’s encrypted files after resetting the password — the password doesn't actually prevent access to your files.
On other devices where you can’t gain access to the files, you can still reset the device and gain access to it without knowing a password. These tricks all require physical access to the device.

Windows

There are many ways to reset a Windows password. Windows allows you to create a password reset disk that can reset your password in an approved way — create a disk first and you can use it if you ever need it.
Resetting a password without an official tool is fairly simple. For example, the Offline NT Password & Registry Editor works well for this. First, you’ll need to boot from a special disc or USB drive — either a live Linux system or a specialized Offline NT Password & Registry Editor boot disc. The tool can edit the Windows registry, allowing you to clear the password associated with the user account. You can then boot into Windows and log into the account without a password.
Even if you’re using Windows 8 with a Microsoft account, you can always reset the password of the built-in Administrator account to gain access.
To protect against this, you could password-protect your BIOS and restrict booting from external devices. Someone with physical access to the PC could reset the BIOS password to bypass this. Encrypting your Windows system drive with something like Bit Locker would prevent the registry from being accessed and modified with this tool — encryption is the only good protection.
image

Linux

We’ll use Ubuntu as a concrete example here. Ubuntu offers a recovery mode in its default Grub boot menu — select Advanced options for Ubuntu and select Recovery mode. You’ll see the boot menu while booting your computer — if you don’t, you can hold the Shift key as you boot and the menu will appear.  You can easily boot directly to a root shell prompt from here.
This option isn't necessary, as you can just press the e button to edit Ubuntu’s boot options and boot directly to a root shell prompt from within the main Grub menu. You’ll then be able to use the root shell to reset and change passwords on the system. If the Grub boot menu is locked and password-protected, you can still boot to Linux live media and change your password from there.
Once again, encryption would prevent your system from being accessed and modified without your encryption passphrase. We used Ubuntu as an example, but almost every Linux distribution uses Grub and few people set a Grub password.
ubuntu-recovery-menu-drop-to-root-shell-prompt

Mac OS X

Macs have a built-in password reset tool, and it’s very easy to access. This option is available in recovery mode. You’ll need to restart your Mac by clicking the Apple menu and selecting Restart. Press and hold the Command + R keys as the computer boots and it will boot into recovery mode.
Click the Utilities menu in recovery mode, select Terminal, type resetpassword into the terminal, and press Enter. You’ll see the Reset Password utility, which allows you to reset the password of a any user account on the Mac. You can also access this tool from a Mac OS X installation disc.
To prevent your Mac’s password from being reset, you could enable FileVault disk encryption on your Mac, set a firmware password inside recovery mode, or both.
reset-mac-os-x-password-from-recovery

Chrome OS

Your Chromebook’s user account password is your Google account password. You could reset your Google account password on the web to regain access.
Let’s say you have a Chromebook you want to use, but you can’t sign in. Perhaps you've forgotten the Google password associated with the device. Perhaps an old Google account is considered the device’s owner account. In this scenario, you can boot the Chromebook to the sign-in screen and press Ctrl + Shift + Alt + R at the same time. You’ll be prompted to factory reset your Chromebook with Power wash. After you reset it, you can log in with another Google account and that Google account will be considered the owner account. This will erase all data on the device, but most Chromebook data is synced online.
There’s no way to gain access to a user’s files without their password on a Chromebook — those files are encrypted by default.
powerwash-or-reset-chrome-os-from-login-screen

Android

If you forget your Android’s lock screen code, you can reset it. Try an incorrect password, PIN, or pattern a few times and you’ll eventually see a “Forgot password,” “Forgot PIN,” or “Forgot pattern” option. You can then regain access to your device by entering the username and password of the Google account associated with your device.
If you don’t have this information either, you may be able to bypass the lock screen in other ways. This should be easy on a device with USB debugging enabled, as you can connect it to a computer and manipulate it over USB with adb — that’s why USB debugging is disabled by default.
You can’t bypass the lock screen without your Google account password unless there’s a hole open in the device — for example, USB debugging. If you want to use the device, you can still perform a factory reset from recovery mode — this will set the device back to its factory state, wiping the data on it . You can then log in and set up the device with another Google account.
android-wipe-data-factory-reset

iOS

iPhones, iPads, and iPod Touches are also built without a way to reset the password. Unlike on Android, you can’t just reset the device’s password with your Apple ID information. If you forget your iOS device’s password, you’ll have to perform a factory reset. However, if you’re syncing the device to an Apple ID and you still remember your Apple ID password, all your device’s data can be restored afterward thanks to iCloud backups.
You can do this in several ways. If you've set up Find My iPhone, you can visit the i Cloud website and erase your device from there. If you've backed up your device to iTunes on a computer, you can connect the device to your computer and restore your device from an iTunes backup.
If you don’t have access to Find My iPhone and you've never backed up the device to iTunes, you can still reset the device using recovery mode. Turn off the device, press and hold the Home button, and then connect the device’s USB cable to your computer. If it doesn't turn on automatically, turn it on. iTunes will tell you it’s detected a device in recovery mode and allow you to restore it to factory default settings.
restore-ipad-or-iphone-from-recovery-mode

Passwords keep honest people honest, and they ensure people can’t gain access to your device without knowing the tricks or looking them up. But, if someone has physical access to your device and wants to bypass the password, there’s nothing you can do to stop them. Even encrypting your files will only protect your personal data — they can always wipe the encrypted data and start over fresh.

How to Clear the Google Chrome DNS cache on Windows

How to Clear the Google Chrome DNS cache on Windows


Flushing your DNS cache can be a useful tool to resolve any host connection errors that you may experience with Google Chrome or other browsers. It is very simple to do and can be done directly in Chrome or from an Elevated Command Prompt window in Windows 7 or 8.

What is the DNS Cache?

Your browser’s DNS Cache (Domain Name System) is essentially a small data bank that stores all the IP (Internet Protocol) addresses for websites you access. The main purpose of this database is to make it easier for your computer to reach and access the IP addresses of websites when their servers change or if they create new servers.
When IP addresses become outdated or if a website switches to a new server, you may encounter DNS errors when you try to access them. Sometimes, due to continued use and accessing sites with a less than perfect web safety rating, your DNS cache may also become corrupted. This is where a DNS cache flush comes in handy.

What is Flushing?

Just like flushing a toilet and getting rid of any old water that is stored in the tank, a DNS flush will make your computer erase any existing information regarding DNS names and IP addresses that is has stored. After you perform a flush, the next time you try to access a website, your computer will ask for all the new IP and DNS information related to that site resulting in an error free browsing experience.

Flushing your Cache through Google Chrome

If you experience any DNS or host error related browsing issues, it can sometimes help to perform a DNS and Socket flush using your Google Chrome browser. In order to fix these problems, follow these simple steps.
Begin by opening Google Chrome and type in this address: chrome://net-internals/#dns and press “Enter.”
If you look at our screenshot, you will notice that there are 24 active entries and a list with details of all the IP addresses that the DNS cache has picked up and stored.
Flush DNS 2
In order to flush your Google Chrome browser’s DNS cache, simply find the button that says “Clear Host Cache” and click it. You can click it more than once if you want to make sure it did what it was supposed to, but a single click is usually enough. You will notice that the number of active entries has gone down to 0 and the list of websites accessed has been cleared.
Flush DNS 3
The next step will be to flush all the Sockets by navigating to chrome://net-internals/#sockets or by clicking on the drop-down menu on the top left of the screen and selecting “Sockets.”
Flush DNS 4
Once you have arrived at the sockets page, you will need to click on both options available to you to flush them all. First, click on “Close Idle Sockets” then on “Flush Socket Pools.”
Flush DNS 5
Alternatively, you could use the drop-down menu located on the top right hand side of the screen to perform both actions after navigating to “Chrome://net-internals/”
Flush DNS 6

Flush DNS with Windows 7 and 8

You will need to begin by starting an Elevated Command Prompt Window. The Elevated Command Prompt window is distinguished from a regular command prompt window because the name on the top left of the window will read “Administrator: Command Prompt.” Using this method, you will be able to manipulate your computer with unrestricted access.
If you are using Windows 7, press “Start” then type “cmd” into the search bar. Simply right click on the “Command Prompt” icon followed by a click on the “Run as administrator” option.
If you are using Windows 8, you’ll need to use the Start Screen search and then right-click to open as Administrator.
Now that you have an Elevated Command Prompt window open on your windows 7 or 8 PC, it is time to begin the DNS flush. It is as simple as typing “ipcconfig /flushdns” into CMD and pressing “Enter.” If you were successful, you will see the message shown in the following image.
Flush DNS 9
If you want to manually verify that your computer’s DNS cache was flushed, type in this command: “ipconfig/displaydns” and press “Enter.”
Flush DNS 10
You will notice that the message displayed is “Could not display the DNS Resolver Cache.” This means that there is nothing to see in the cache and the flush was successful. If you want to see something show up, simply open up Google Chrome. Once Google Chrome is open, switch back to your Command Prompt window and type in the “ipconfig/displaydns” command again.
The image above shows a list of all the items and IP addresses saved in your new DNS cache.  Now you can exit your command prompt window and resume browsing the Internet without the risk of a DNS error, since every site you access will show up as a new entry in your Cache.