Archive for 'Tips'

Things needed:

1) A VMware server
2) Latest Debian netboot ISO
3) PXE bootable Clonezilla
4) Server to store Clonezilla image on

 

First I had to find the BIOS password to our Barracuda Spam Firewall. It appears that barracuda is running a custom BIOS on this motherboard and you cannot boot to CD (They always hang with a blinking cursor). Enable the LAN BIOS and the option to boot to other devices. When the system reboots, F11 should get you to the boot selection screen. I picked PXE and booted Clonezilla ( How to PXE boot Clonezilla)

Clone the had drive of the barracuda spam firewall to a server on your network. Next we need a VM ready to clone the image from the barracuda spam firewall. Make sure the hard drive for this unit is big enough to clone the image to it (I made mine 275 GB because our barracuda unit has a 250  GB hard disk). Next we need to tell the VM to PXE boot. Make sure the VM is selected. Click “Configure VM” on the right side. Select the “Power” tab, and check the box that says “Enter the BIOS the next time the virtual machine boots”. Next start the VM and make sure the ethernet controller is set to boot first in the BIOS. PXE boot to clonezilla and clone the hard drive of the barracuda spam firewall back to your VM.

After clonezilla is finished cloning the hard drive back. Shut down the VM. Set the system to enter the BIOS when you boot the VM again. Change the BIOS so the hard disk boots first. Now, if the system boots, you are out of the woods. If you get an error on boot saying something like “Could not mount root partition”, then we have some more work to do. The reason you get this message is the kernel supplied by Barracuda doesn’t have the proper storage drivers for the VM. We need to copy a kernel from Debian and use that to boot the Barracuda VM.  Go ahead and shut down your barracuda VM.

Now, we need a second VM with Debian preinstalled on it. I chose a 32-bit version of Debian. Go ahead and install Debian completely in this VM. After Debian is installed, shut down the VM. We need to add the hard disk from the barracuda VM to the Debian VM, so we can copy Debian’s kernel and modules over to the Barracuda VM. Select the Debian VM, click “Add Hardware”, select “Hard Disk”, click “Use and Existing Hard Disk”. Navigate to the hard drive from the Barracuda VM and add it to your Debian VM. Now boot your debian VM.

You should at this point have the Debian VM running with both its hard disk and the Barracuda hard disk. We need to mount the first partition from barracuda disk. On my system the barracuda disk was /dev/sdb . To mount the partition I ran ” mount /dev/sdb1 /mnt”. This mounts sdb1 to /mnt. Next enter “cd /boot”. This is where the Debian kernels are contained. Copy the 4 files to /mnt/boot (The folder for the barracuda kernels). These files are: config-2.6.32-5-686, initrd.img-2.6.32-5-686, vmlinuz-2.6.32-5-686, System.map-2.6.32-5-686. The numbers on the ends of the file names may vary. Next we  need to copy our kernel modules over to the VM. These are under “/lib/modules”. There should be a number that matches the kernel you have on your Debian VM. Copy the entire folder of modules to /mnt/lib/modules.

 

Next we need to edit the grub config for the barracuda unit. This is located under /mnt/boot/grub/grub.conf. I added the following entry:
title Debian Kernel
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-5-686 root=/dev/sda1
initrd /boot/initrd.img-2.6.32-5-686

You want to put this entry before the line “title Barracuda”, so your entry is the default kernel to be booted. Now we need to change the root password for the barracuda hard disk. To do this edit the file /mnt/etc/shadow .  You’ll see a line that says something like:
root:e8,je#2ciw@$lo0nfielso2!jfJEcw:15153:0:99999:7:::
Delete everything between the first two colons. This will change the root password to blank. If you want to change the root password back later, copy down everything between the :, and you can change this line back later to restore the original root password.

Now shutdown the Debian VM. Now start the barracuda VM. The system should boot. Once you are prompted for a username, type “root”. The system should let you in as the root password is now blank. Now if you type “iptables -L” you should receive an error about missing kernel modules. You can fix this by typing “depmod” (this fix should be permanent, and this is the reason we needed to change the root password).

 

Your barracuda unit should now be fully functional in a VM. I’ve not tested this fully and I recommend STRONGLY that you test barracuda unit thoroughly before putting it into production. I also recommend reading the post from the link above (About the BIOS password) to find some other cool tricks such as enabling features on your Barracuda Spam Firewall. Please post below about your success or about other issues you may have had that I didn’t.

Share on Facebook
Tags: , , ,

3TB Hard Disk Shows up as 750 GB

Recently we purchased some larger hard drives to use to back up with. The problem is that in Windows they only show up as 750 GB. To get the drive to show up as 3 TB, and I had to burn a copy of Gparted. After booting the Gparted, you should be able to see the 3 TB hard disk. Try to create a 3 TB partition. If this fails it is because you’ve already created a partition table on the device (Which was for 750 GB), so we need to create a new partition. To do this click Device -> New Partition Table. Make sure the partition table is set to “GPT”. Then you should be able to create a 3 TB NTFS partition.

After you apply changes and reboot, the device should show as 3TB in Windows.

 

UPDATE:

I had a problem with another drive recently. I had it hooked up through a USB cradle and it kept showing up as 750GB even in Gparted. I removed the drive from the cradle and hooked it directly up to SATA and the drive showed as 3 TB. I then formatted it with Gparted and it works fine in the USB cradle now (I wrote over 2 TB to the drive to verify it was functioning properly).

UPDATE 2:

We’ve been having problems with the backup drives in the older enclosures. We could setup the drive so the entire 3 TB can be used in the enclosure, however after 3-4 days the volume would become “RAW” and we’d lose all the data on the drive (Good thing it was only backup data). We eventually ordered a new enclosure and that fixed the problems. With the new enclosure we no longer had problems seeing the full 3 TB in Windows either.

Share on Facebook
Tags: , , ,

HPISCNAPP.EXE excessive CPU Usage

So we have some HP Scanjet 5590 that some people use to scan small documents in from their desk. Anyway we needed to update some of these user’s PCs to Windows 7. That was fine because HP had the Windows 7 software on their website. Anyway after updating the PCs to Windows 7 users started complaining that it would take a very long time to scan a single page. So I sat down and went to scan a page. I found that the “HPISCNAPP.EXE” process was using 50% (1 CPU) of the users processor. I found this issue with both Windows 7 Pro 64-bit and 32-bit.

We contacted HP about the issue and they indicated that since we’ve had our scanners for longer than 1 year (The warranty period on them), that they wouldn’t even speak to us unless we paid $100. I think we should all commend HP on supporting your customers when the problem is your own software. So I did some digging around and found that they still had the Windows Vista version up on HP’s site. I downloaded this version, set compatibility to “Windows Vista SP2″ and then ran it as the administrator. The program installed and has worked fine ever since.

Share on Facebook

USB 1.1 Devices in USB 3.0 Ports

Today I was wondering if USB 1.1 devices work in USB 3.0 ports. A quick google search didn’t find any results. So I found a USB 1.1 device and plugged it into one of the two USB 3.0 ports that my motherboard (GA-P55A-UD3 — NEC Chip for USB 3.0) has. The device worked correctly.

Share on Facebook
Tags: ,

NTFS Volume Showing Up as a RAW Volume

Someone brought me a hard drive the other day. They used to be able to access the data on the drive, but now couldn’t. When I plugged the drive in, I was immediately greeted with Windows 7 asking me to format the volume. I, of course, chose not to format the volume (We’d lost data if I’d done so). I first tried to run chkdsk on the drive through the GUI. That didn’t work. It just informed me that it didn’t understand RAW volumes. After some googling, I found that running chkdsk from the command-line does work.

After a long long long wait (Just let chkdsk do its thing….. Even if it seems like it is stuck in a loop) chkdsk finished and after rebooting the drive shows up as NTFS.

Share on Facebook
Tags: , , ,

Recently we had a couple of users with Outlook 2007 having difficulty sending email to one specific contact. Whenever they’d send an email to a certain contact they’d almost immediately get a bounceback that said something like:

Subject: Test Email

Sent: 11/7/2010 11:27 AM

The following recipient(s) cannot be reached:

‘destination_email@email.com’ on 11/7/2010 11:27 AM

None of your e-mail accounts could send to this recipient.

Please be aware the email address has been changed to protect the innocent. I did a lot of digging around and eventually narrowed the problem down to the auto-complete cache for Outlook 2007 on the person’s computer. I believe it had corrupted the email address (However, the “display name” which was an email address still looked fine). To fix the issue, we just started typing the person email address. When Outlook 2007 popped up allowing us to click to complete the email address, press the delete key and it will delete the person’s email address from the auto-complete cache. You should be able to manually type the email address again and the email will go through.

Share on Facebook
Tags: ,
  1. A Backup Schedule. This implies you have a backup plan. RAID isn’t a backup. Backups are useful when you have a catastrophic hardware failure, accidental deletion/overwriting of files, or a disaster situation. One other question you should ask is how much data loss is acceptable. For instance: If your backup media only goes off-site once a week, then you have the potential of losing up to a week of data (If there is a disaster right before the media goes off-site). If data goes off-site every day, then you may have up to a day of data loss.

    Capacity comes into play here too. How much data do you need to backup? How much money do you have to spend on backups? How much data loss is acceptable? Can you save money by doing a full backup every once in a while and doing incremental backups other days/weeks (Weeks would probably be risky)?

  2. A Disaster Recovery Plan. This goes along with having a backup. Your data may be backed up, but are you sure that you can restore all data and services from the backup media? If you’ve not tried restoring from backup media, I strongly encourage that you do a trail run. I did so with my business and found issues with restoring Active Directory and Microsoft Exchange. I was able to document and address these issues now —- Instead of dealing with them in a disaster situation that is much more stressful. I didn’t need a bunch of servers to test disaster recovery. I did so with a couple of decent desktop computers and VMware Server (It is free!)
  3. UPSes and the ability to shut down servers automatically during a power loss. Simply having a UPS isn’t enough. If the servers are never made aware that their is a power outage, then they’ll just continue to run until they exhaust the UPS battery. Unexpected server shutdowns can cause data loss. The only thing just a UPS will do is preventing data loss from short power outages. Most server grade UPSes have the option to purchase an add-in network card. UPS vendors will typically provide software which allows servers to monitor UPSes and shut down in the event of a power loss. We use APC. The Smart-UPS series UPSes have a card slot on the back of them. We’ve purchased an AP9617 (I recommend getting the AP9618 though) which has an Ethernet port. This allows a single UPS to communicate to several servers.

    Power is another issue that shouldn’t be overlooked. Plugging 2 1500VA UPSes into a single 20 amp circuit can kick a breaker and cause a power issue. Be sure you plan to have enough power available so your servers don’t kick breakers. Plan extra capacity in your design. After a power failure, UPSes have to charge AND your servers have to run at the same time.

  4. A plan to shut down servers in the event of an environmental problem. I’m speaking mostly about heat related issues, but it is a good idea to ensure that you don’t have a water sprinkler in your server room (Or in the area that your server is located). In the event that there is a sprinkler in the location, you may make management aware of the dangers. If your business is building/renovating a location, I’d recommend getting a waterless fire suppression system.

    Anyway, back to the topic, heat. I have a friend that works for a large corporation. They rent space at a large data center. Anyway, at one point they lost power on a single phase of their three phase power. This wasn’t enough to disable power to the servers, but it did disable power to their AC. Temperatures quickly climbed to 180° F. This did kill some of their servers, but it also wounded many more. These server exhibited odd behavior and would die off slowly in the coming weeks. If the AC stops functioning in your server room (Or in the room that your server is located), what do you have in place. In the previous point, I recommended the AP9618 add-in card to APC UPSes because it has environmental monitoring capabilities and can shut down your servers when it gets too hot in your server room.

Share on Facebook
Tags: , , , , , ,

Regular expressions can be a tricky thing. If you ever write some of them you may want to test it first just to see what matches. I found a way to test regular expressions inside of a PHP script. Simple enter the Regex Pattern in the “Pattern” field (Without the /), then enter some sample input and click “Check it”. This regular expression tester will return all matches and not just the first match. If your pattern isn’t matching, I’d double check it and make sure you’ve escaped everything properly.

Source Code for Regular Expression Tester simply copy this code into a file named “regexcheck.php”, place it in a folder for your website (Assuming it can read PHP), and you’ll have a fully functioning regular expression tester.

I also found another place to test regular expressions. Their script seems to be a bit better than the one I wrote, but they don’t provide you the source code either.

Share on Facebook
Tags: , , ,

Occasionally you may update your website and links from other websites will be pointing towards pages that used to exist, but now don’t. Apache has a module built in to automatically redirect these pages and let Google know these pages have moved permanently.  First we need to turn on the module inside of Apache. Edit the httpd.conf file and find a line that says “#LoadModule rewrite_module modules/mod_rewrite.so” and remove the # from the line. Next restart Apache.

Next we need to tell Apache what pages to redirect. In the Document Root (The base folder) of your website create or edit a file named .htaccess . Next add a line which says “rewriteEngine on”. Below this you will add rules to rewrite webpages. The next line(s) will be: “rewriteRule ^oldwebpage\.html$ http://www.nerdfish.com/newwebpage.php [R=permanent,L]“.

It looks like Apache uses Regular Expressions to identify the webpage to be rewritten. ^ in Regex means begins with, \. means a literal period (Period means something else in Regex), and $ means ends with.

Share on Facebook
Tags: , ,

One way to save yourself bandwidth needed by webservers is to compress content (especially text) before it is sent over the Internet. Most browsers these days support gzip compression of files. Apache 2 supports this natively.

To turn this on in Apache 2, edit your httpd.conf file (In Windows, just use the shortcut to edit the Apache config). You are looking for the line that says “#LoadModule deflate_module modules/mod_deflate.so”. Remove the # sign before this line so that the deflate module is loaded when Apache starts.

Next you’ll need to add some lines which tell Apache what files to compress. If you’d like to enable compression for a single site running Apache add the paragraph below to the “Virtualhost” section for that site. If you’d like to turn it on for all sites, add it under the main “DocumentRoot”.

###Compresses certain types of documents

AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

The first line tells the system to gzip the following types. The 3 lines below it are for compatibility for older browsers.

If you’d like to confirm that compression is actually on, you can do one of 3 things:

  1. Go to run a Web Page Test. It will let you know if you have compression turned on and will also give you other tips on optimizing your website so pages load faster
  2. Download an add-on for Firefox named “Live HTTP Headers”. After you have it installed, open the add-on (Tools->Live HTTP Headers), check the box to capture, then reload the page you want to test. When the page is finished loading look back through the request for the webpage and you should see a line that says “Accept-Encoding: gzip,deflate”. This means it is compressing the page
  3. Download the Page Speed plugin for Firefox. You’ll also need to get the “Firebug” add-on for Firefox for it to work. Open the Firebug add-on then click the “Page Speed” button. It should be able to analyze the page and let you know if compression is on.
Share on Facebook
Tags: , ,
Back to top