Why Linux doesn’t come with a defrag utility

tux_file_linux

A while back I tried to explain to someone why I am never really concerned about the need to defrag my linux systems, well at least not nearly as much as any windows system. This site is one of the simplest explanations I have seen so far.

Why doesn’t Linux need defragmenting?



NDR 550 5.4.4 from Exchange

outlook_2007_logo



A few users at my company randomly receive NDR’s Containing the information below when they send to a recipient not on our domain…

Generating server: YOURSERVER.YOURCOMPANY.COM

IMCEAMAILTO-someone+40remotedomain+2Ecom@YOURCOMPANY.COM
#550 5.4.4 ROUTING.NoNextHop; unable to route ##

Although I do not know why and it happen’s so rarely that I am not worried about it I thought I would at least post the fix in case I forget, like I said, it rarely happens.

To change/fix it do the following…

Open Contact Email Setting:

Email Box Within Contact Information

Next you will see a box similar to the one below. The email type must be set to SMTP.

Email Properties - change type to SMTP



VMware: Can not add ESX 4.1 host to vCenter 4.0

vmware_logo_square

If you try to add an ESX 4.1 server to a vCenter 4.0 server one of two things will happen. First the initial connect will succeed but shortly after being connected the host will disconnect with no visible errors. If your lucky the second thing you may see is the actual error “A general system error occured: internal server error: vmodl.fault.HostCommunication”.

Unfortunately the only way to solve the problem (that I know of) is to upgrade the vCenter to 4.1, but beware… 4.1 is x64 only and as far as I know there is no 32bit version. If you do decide to upgrade remove host and then re-add as you normally would.

Personally, I am just going to reformat the server and install ESX 4.0 and perform the vCenter upgrade at later date then upgrade all the ESX servers.



Shutting down ESX guest from command-line/ssh

vmware_logo_square

This can be done through the Service console or through SSH.

The path to the configuration file will referred as . This get be obtained by using the command ” vmware-cmd -s listvms”

1) log into the esx server that the guest is located. (I use SSH personally)

2)Run the following command to get a list of the register guests config files on the esx server
vmware-cmd -s listvms

Output would look like:

[root@ESXHOST ~]# vmware-cmd -s listvms
/vmfs/volumes/4ba33211-381fb8d0-bc97-0010186458a2/GUSET1/GUEST1.vmx
/vmfs/volumes/4ba33211-381fb8d0-bc97-0010186458a2/GUSET2/GUSET2.vmx
/vmfs/volumes/4ba33211-381fb8d0-bc97-0010186458a2/GUSET3/GUSET3.vmx
/vmfs/volumes/4ba33211-381fb8d0-bc97-0010186458a2/GUSET4/GUSET4.vmx
/vmfs/volumes/4ba33211-381fb8d0-bc97-0010186458a2/GUSET5/GUSET5.vmx

3) Verify the state of the guest before attempting to shutdown.
vmware-cmd getstate

Output would look something like “getstate() = on” if the guest was on.

4) To perform a “soft” shutdown use the following:
vmware-cmd stop
To perform a “hard” shut down use:
vmware-cmd stop hard

If the virtual machine does not power off, it has likely lost control of its process. You need to manually kill the process.

Caution: The following is to be used only as a last resort option. This could cause issues with either the guest or even the host.

To determine if the virtual machine process is running on the ESX host, run the command:

# ps auxwww | grep -i .vmx

The output of this command appears similar to the following if the .vmx process is running:

[root@ESXHOST ~]# ps auxwww | grep -i GUEST1.vmx
root 16035 0.0 0.1 58648 728 pts/0 R+ 14:52 0:00 grep -i GUEST1.vmx
root 24502 0.0 0.2 3152 1228 ? S s May03 0:18 /usr/lib/vmware/bin/vmkload_app –sched.group=host/user /usr/lib/vmware/bin/vmware-vmx -ssched.group=host/user -# name=VMware ESX;version=4.0.0;buildnumber=208167;licensename=VMware ESX Server;licenseversion=4.0 build-208167; -@ pipe=/tmp/vmhsdaemon-0/vmx363998c9947311ce; /vmfs/volumes/4ba38321-381fb7d0-bc97-1010186458a2/GUEST1/GUEST1.vmx

The first output line can be ignored because this is the process info from the actual command ran.
The process ID (PID) that we are looking for in this example is 24502 (in bold). Take note of this number for use in the following steps.

Caution: Ensure that you identify the line specific only to the virtual machine you are attempting to repair. If you continue this process for another virtual machine the one in question, you can cause downtime for the other virtual machine.

If the .vmx process is listed, it is possible that the virtual machine has lost control of the process and that it must be stopped manually.
1. To kill the process, run the command:
# kill
2. Wait 30 seconds and check for the process again.
3. If it is not terminated, run the command:
# kill -9
4. Wait 30 seconds and check for the process again.
5. If it is not terminated, the ESX host may need to be rebooted to clear the process.



List all DB’s along with size for SQL Server 2000/2005

data_chart

For backup reasons I needed a list of all the MS SQL databases along with the size of each DB on our MS SQL servers. To do this log into the SQL server and go to SQL Enterprise Manager and select the server you need to query under “SQL Server Group”. Once highlighted goto “Tools” then select “SQL Query Analyzer”. In the query window type the following:

EXEC sp_helpdb;
GO

Once entered press the F5 key to submit the query. After completed you can either manually select the data you would like to copy or save as.



Format and Partition a Second Hard Drive in Linux – (ext3)

tux_file_linux

For the purpose of this example, a second hard drive was installed into a Linux system where the drive is recognized as /dev/hdb. Only one partition will be made in the following example./dev/hdb1.


fdisk

First, you will need to run the fdisk command in order to partition the disk. For this
example, I only want to create one ext3 partition. Here is an example session:

[root@linux2 etc]# fdisk /dev/hdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 4865.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4865, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-4865, default 4865): 4865

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 83

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


Create ext3 File System

The next step is to create an ext3 file system on the new partition. Provided with the
distribution is a script named /sbin/mkfs.ext3. Here is an example
session of using the mkfs.ext3 script:

[root@linux root]# mkfs.ext3 -b 4096 /dev/hdb1
mke2fs 1.27 (8-Mar-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
4889248 inodes, 9769520 blocks
488476 blocks (5.00%) reserved for the super user
First data block=0
299 block groups
32768 blocks per group, 32768 fragments per group
16352 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.


Mounting the File System
Now that the new hard drive is partition and formated, the last step is to mount
the new drive. For this example, I will be mounting the new hard drive on
the directory /db.

NOTE: You will first need to create
the /db directory before mouting the disk! (e.g. mkdir /db)

What I typically do is to edit the /etc/fstab file and add an entry for the
new drive. For my example, I will create the /dev/hdb1 entry as follows:

LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hdb1               /db                     ext3    defaults        1 1
/dev/hda2               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0

After making the entry in the /etc/fstab file, it is now just a matter of
mounting the disk:

[root@linux2 /]# mount /db

[root@linux2 /]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3             37191660  11016692  24285724  32% /
/dev/hda1               101089     12130     83740  13% /boot
none                    515524         0    515524   0% /dev/shm
/dev/hdb1             38464340     32828  36477608   1% /db


Error 1606 when upgrade to Backup Exec 13 (2010)

symantec_logo

When attempting to upgrade to Symantec Backup Exec 2010 from Backup Exec 12 error 1606 is given and “barks” about access to a network location. This occurs when Backup exec has previously been upgraded, for example from 11 to 12. For some reason the install is looking at the an older upgrade version which causes it to fail. The fix for this can be found on Symantec’s website but they provide a link to the “Windows Installer Cleanup Utility” that has been discontinued and is no longer available from Microsoft. Also… don’t let the “Network Location” fool you, it seems that the location can be pointing to several different places which caused some un-necessary reading on symantec’s (garbage) knowledge base site.

Symantec Knowledge base article – http://seer.entsupport.symantec.com/docs/346798.htm
(Also posted below)

Windows Installer CleanUp Utility – http://majorgeeks.com/Windows_Installer_CleanUp_Utility_d4459.html

Document ID: 346798

http://support.veritas.com/docs/346798

Upgrades to Backup Exec 2010 fail with “FATAL ERROR: Error 1606.Could not access network location \IDR\Data.”
Details:

The above failure occurs on systems that were previously upgraded from another version of Backup Exec. The issue is caused by the Microsoft’s Installer (MSI) database listing multiple installations of Backup Exec, which causes the 2010 installer to default to the older version of Backup Exec when looking for the upgrade files.

For Example, a user who upgraded from Backup Exec 12.0 to 12.5 may see this if both versions of Backup Exec are listed in the MSI database.

The issue can be resolved by performing two steps:

1. Download the Microsoft Uninstall tool and remove the older version of Backup Exec from the MSI database – http://support.microsoft.com/kb/290301

2. Change the following registry key to match the version of Backup Exec which you are currently upgrading from:

Warning: Incorrect use of the Windows registry editor may prevent the operating system from functioning properly. Great care should be taken when making changes to a Windows registry. Registry modifications should only be carried-out by persons experienced in the use of the registry editor application. It is recommended that a complete backup of the registry and workstation be made prior to making any registry changes.

HKLM\SOFTWARE\Symantec\Backup Exec For Windows\Backup Exec\13.0\Install\Upgrade Version

Possible Values:

Backup Exec Release Product Version
BEWS 11d 6235 11.0.6235.0
BEWS 11d 7170 11.0.7170.0
BEWS 12.0 12.0.1364.0
BEWS 12.5 12.5.2213.0

After performing these two steps, the upgrade should complete as expected.



Excel opens blank spread sheet

Excel-icon

This happens when something dealing with the file associations with excel stop working correctly. I am not sure what the exact cause is but I have only seen this in Citrix environments with Office 2007 installed. Opening spreadsheets through the excel program itself works correctly but trying to open a spreadsheet by opening the file through explorer or though a shortcut wont work.

To fix the problem…

1. Go to the folder options in control panel and select the “File Types” tab.

2. Navigate to the “xlsx” extension and click advanced. Under actions highlight “Open” and click “Edit”.

3. In the “Application used to perform action” box verify that the path to the excel executable is correct and then remove any switches that come after it. You will probably have to remove something like “/dde” or “/n” for example.

4. Once removed add /e “%1″ so that the box should read something like what you see below:
“C:\Program Files\Microsoft Office\Office12\EXCEL.EXE” /e “%1″
NOTE: the “” around %1 are important.

5. Now uncheck “Use DDE”. Click OK and close out of all windows.
NOTE: if you reopen the advanced settings for the “open” action you will see that the DDE option has been re-checked off even though you un-checked it. This is ok.

If this works you will need to repeat this process for all of excels extensions that are affected like “csv” and “xls”.



Infected with net.net virus

virus_alert

It has finally happened, last night I was infected with the net.net virus. I was searching some forums, not sure which ones, and out of no where java errors started exploding on my screen while images were loading. That is usually never a good sign and I knew something was up. I closed my browsers and opened task manager and saw some oddly named processes. Then a popup notice appeared saying “Windows defender” was deactivated… also not a good sign. I then turned to “msconfig” to see if any new items have been added to my startup. I saw “net” was now in my startup programs. I than went into my “system32″ folder and sorted by date to look for any files that have been created with the past few minutes. I saw a program by the name of “net.net” along with a dll file named “ernal32.dll” (notice the missing “k”) plus an executable file that’s name appeared to be random generated and all were created with in the same time frame, a minute apart, and very recently. I immediately moved the files to a different location and renamed them, just in case by some chance they were system files I didnt just want to delete them. I then removed the “net” from startup and rebooted. After reboot no new files were created.

Now before I go any further let me explain that I did not have a anti virus installed… I know… I know. Even my wife gave me crap about it. I did have trend installed at one point but then it expired and I upgraded my laptop to win7 and just never got around to it, and again I know, not an excuse. Well so I then proceeded to attempt to go and download “Microsoft Security Essentials”, I have heard actually some pretty decent things about it and thought I would give it a try but when going to the down load page I would get an II7 error saying the file did not exist. Umm… ok, that wouldnt be the first time I had problems downloading something from Microsoft so I went to Trend Micro and tried to use there online scan tool called Housecall. After downloading I tried to install it but then received some odd errors. I tried to then install spybot and that to failed saying that the site could not be contacted. At this point I knew something was very wrong and even though I removed the virus, at least I thought so, something was still not right. I checked my host file to see if any changes were made and found that in tact but saw a new ICS file has been created. Because I was short on time and didn’t want to deal with it all that point I did a system restore because I had no idea what else could have been changed in my system files. Luckily I had a restore point from the night before and I made no changes since then so I knew it would be ok to restore to that point. After the restore I was “mgically” able to download and install “Microsoft Security Essentials”. I scanned my laptop and found one virus and cleaned it out. I did also run “Housecall” from Trendmicro which showed no infections.

What was probably the most disturbing about this was that besides going to a webpage (a legit web dev forum) there was no other interaction needed for this virus to do its work. Most of the time I see people with popups or some other request for interaction. This required none of that. Even though I have seen it before his is the first time I have had this happen to me so my lesson has been learned. It doesnt matter if your vigilant and careful when surfing the web or not, if you dont have an antivirus installed your at risk.

If you need more detail then what I provide on removing “net.net” you can find them every where… just Google it. But if you have a restore point then use that followed by a full system scan with a reputable antivirus. I chose “Microsoft Security Essentials” simply because it is free and even MS critics have nothing bad to say about it. Additionally you may want to use a free scanning service like Trends “Housecall” for a second opinion. I have always been a big fan of Spybot as well, for spyware though, not viruses.



Backup Exec 12 Stays Queued

symantec_logo



Now there are MANY reasons why Backup Exec will go into a “queued” status but in this case I was running a SQL backup job that was backing up to a “Backup-to-Disk” folder located on a external (My World) WD harddrive. In an attempt to resolve the issue I tried restarting the services, reinstalling the agents, and rebooting the server itself, formatting the external drive. One if not all of these normally does help but sometimes they will not and the job will go back (and stay in) a queued state when the job is ran. For some reason from time to time this will happen when ever attempting to backup to external drives using “Backup-to-Disk” folder.



The only fix I have been able to find that actually works is creating a new “Backup-to-Disk” folder and then reconfiguring the job to use the new folder.

I still have not figured out why this happens (yes I looked at events) and if anyone has any insight on possible reason please share them with me because, to put it bluntly, its annoying.

When I have time to look further into this I will update the post with my findings.



Twitter Delicious Facebook Digg Stumbleupon Favorites More
313 queries in 3.213 seconds.