Converting From RAID 1 To RAID 5

I have been playing around with a Linux server in my home lab and wanted to try expanding a Linux software RAID 1 array to a 3 disk RAID 5 array.

So I already have a two disk RAID 1 array with a pair of 1TB SATA drives at /dev/sdb and /dev/sdc. I am going to add a third drive at /dev/sdd to the array.

I start by removing the array description from /etc/mdadm.conf
I also comment out the line from the /etc/fstab

Next I stop the array with
# mdadm --stop /dev/md0

I also unmount that drive
# umount /mnt/vg001/lvol1

Next I change the array configuration to RAID 5
# mdadm --create /dev/md0 --level=5 -n 2 /dev/sdb /dev/sdc
At this point it says that the drives are already part of an array and asks if you really want to do this. Answer Y.

This part takes a little while so go find something else to do while it reconfigures the array.
Once it is done, I add the third drive to the array.
# mdadm --add /dev/md0 /dev/sdd

Now it is time to grow the array
# mdadm --grow /dev/md0 --raid-disks=3 --backup-file=/tmp/raid.backup
I started this 24 hours ago and it is only at 43% complete at this point and it is estimating that it will be another 100+ hours before it completes. Wow. So it works, just painfully slowly.

What I take way from this is if you need to add more space to your array and you are using Linux software RAID, put all your data on another device and build a brand new array, move your data back. It would take less time to move all the data than it would be to wait for the array to grow.

**UPDATE**
I checked in the morning and the grow had completed. So it took between 24 and 33 hours to complete the grow.

Comments

Introducing Microsoft SQL Server 2008 R2

Get a free eBook from Microsoft Press titled “Introducing Microsoft SQL Server 2008 R2“.

Comments

MSSQL Table Reindex

Use this single line command to re-index every table in a Microsoft SQL Server database:

EXEC sp_msForEachTable
  @COMMAND1 = 'DBCC DBREINDEX ("?")'

Comments

Select The Correct Equipment

We use an open source software package called GLPI to track our equipment and the trouble tickets associated with them. A while back I had built a ASP.net front end for our end users to enter their own trouble tickets. Since the database is populated with every computer, printer and phone in the company there was a simple little interface that allowed them to select a radio button for say printer and then a drop down box would appear with all the printers in the company with the printer’s location for them to select the printer that is having the issue.

The problem came into the fact that I thought people would be conscientious enough to actually select the device that was actually having the problem. This was not the case. Instead all the trouble tickets were being generated for the first piece of equipment in the corresponding list. A bit frustrating as we would then have to drop into the database and change the association between the ticket to the correct equipment.
This needed to stop so here is how I did it.

First off I changed the SQL query to add one more select option to the top of the list of options they could choose from. For the printers the query now looked like this for the printers:

SELECT * FROM
   (SELECT  id,
       CONCAT(name,'  {  ',comments,' } ') AS name
   FROM glpi_printers
   WHERE deleted = 0
       AND is_template = 0
       AND name <> 'shelf'
   UNION ALL
   SELECT  0,
       '--SELECT A PRINTER--'
   ) as t1
ORDER BY
   name;

This now adds the option –SELECT A PRINTER—at the top of the list with an ID value of 0.
Next I add a CompareValidator control to the drop down list that displays the equipment listing.

<asp:CompareValidator
   ID="cvDevice"
   runat="server"
   ControlToValidate="ddlSelectedDevice"
   ValueToCompare="0" type="Integer"
   operator="GreaterThan"
   ErrorMessage="<br /><strong>You must select a valid device for support!</strong>"
   display="Dynamic"
   SetFocusOnError="True"
/>

Now when they create a ticket if they skip over the dropdown list for the equipment, they will get a message telling them to select a valid device. While this does not guarantee that they will actually choose the equipment that is in need of support, I have a better chance at getting the correct equipment selected.

Comments

JavaScript – Object doesn’t support this property or method

Working on an intranet app and was trying to get a javascript function to run onchange of a drop down box. We use IE7 as our standard web browser so as I was testing it I kept getting this message stating “Object doesn’t support this property or method”. Kept limiting my javascript function to I finally just had an alert(“TEST”) that wouldn’t even work.

I was calling the function medicalPlan and it related to an form with an id=”medicalPlan”. Apparently there is a problem if you call a javascript function with the same name as the form element’s id. As soon as a renamed the function everything worked as you would expect it to.

Comments

Where’s The Speed

I have Comcast for my home internet connection and I have the 16Mb pipe. The cable modem and wireless router sit in the basement and we normally work from the main floor. The problem is that I am not seeing any speed at all on my connection. And by no speed I mean 3Mb down and 400k upload.

If I go straight from the cable modem to my laptop I get over 20Mb down and 1.5Mb up. Crap that kind of points to the router as my problem. It is a Linksys router running the OpenWRT. The reason I am using this firmware instead of the stock is that I wanted to get rid of my internal servers to save power and the last service I needed to provide was internal DNS. OpenWRT gives me that ability. Since I have no other routers anymore to try out, I can either downgrade the firmware to the stock release from Linksys or buy a new router and see what kind of speed I get there.

Arrrrgggggghhhhhh!!!!!!!

UPDATE
So running some tests all through the same router with the same OpenWRT software build on the router.

I have two laptops I am testing with and here are the results:
HP Pavilion ZV5000
Wireless speed: 6Mb
Wired speed: 13Mb

MacBook Pro
Wireless speed: 4Mb
Wired speed: 13Mb

The uploads were all around the 400K speed.

Looks like I need to find a way to tweak the wireless speeds and the upload speeds.

UPDATE #2
On the router I disable the G-Mode Protection settings.
HP Pavilion ZV5000 now at 7Mb
MacBook Pro now at 10Mb

UPDATE #3
Now on the router I have set it to only G mode and got rid B settings.
HP Pavilion ZV5000 no at 9Mb
MacBook Pro now at 11Mb

Don’t think I have any more B mode devices anymore, but that could be an issue if I come across a long forgotten device.

UPDATE #4
Got my uploads figured out now. No longer capped at 400k I am now getting 1.5Mb uploads.
Apparently even though the QoS Service is disabled, there is a setting called QoS Overhead Calculation which by default is on. Once this setting is also disabled, everything uploads quickly.

After all this I kind of feel bad for gripping at the Comcast people on the phone when it was not them that hosed the connection. {blushes} I hate being that jerk.

Comments

FireFox Custom Dictionary

One of the cool features of FireFox for the linguistics challenged like me is that it will spell check items in a textarea of a web page. If you misspell it, there is little red line that shows under the word and you can right mouse click on it and select the correct spelling of that word. The problems for me is that I get a little too quick on my clicking and from time to time, select the Add To Dictionary option which is directly under the list of other options for the word you misspelled.

To clear the word from the custom dictionary you need to find the persdict.dat and open it in a text editor and removed the wrong entry. On Windows XP you will find it in C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles\unique.default And on Mac OS X it is located at /Library/Application Support/Firefox/Profiles/unique.default

Comments

MSSQL ’show tables’ Equivalent

MySQL has a cool command called

SHOW TABLES;

which will list out all the tables in the current database.

I wanted the same ability in Microsoft SQL Server. To get the same info you would issue

SELECT NAME
FROM {databasename}..sysobjects
WHERE xtype = 'U'

Replace {databasename} with your database.

Comments (2)

Upgrade

There has been a link at the top of the admin page of this site for a little while. I run it on WordPress and it is telling me there is an upgrade available. Usually this means I pull down the tar ball, unpack it and usually overwrite some file I really wanted to keep. By the time I get to the last site that I manage it usually goes much smoother but about an hour of my life is gone. So tonight I see that it had a button that said upgrade automatically. After doing a quick upgrade, I clicked the button. Moments later, it says it is completed and check the site and everything is cool.

This is nice!

UPDATE
Apparently this is the only site that will upgrade automatically. It failed on all the others. {sigh}

Comments (1)

PHP

I have never really done much with PHP. I do very little coding and when I do it has always been a Microsoft centric language. For whatever reason, it can’t be boredom I have too much to be doing, this weekend I started fiddling around with PHP. I am actually working through a PHP tutorial so I actually learn the correct ways to use the language instead of just mashing things together like I have done in the past.

Not sure if it is the procedure or the documentation that I am using but it seems to be a very easy language with incredible power available to use. At this point I have only worked through operators, arrays and loops but I have been impressed with the little bit that I have done with it. I am curious once I get to the point of pulling data from a MySQL database and that should be fun.

I have no idea what I am going to do with this knowledge, we use ASP and ASP.net at work.

Comments (1)

« Previous entries Next Page » Next Page »