Friday, June 19, 2009

Windows Vista CBS.Log and SFC Scannow failure

original error after running sfc /scannow:

windows resource protection found corrupt files but was unable to fix
some of them. details are included in the CBS.log
windir\Logs\CBX\CBS.log
C:\windows\logs\CBS\CBS.log
links:

how to take ownership of files in windows vista

well written howto on troubleshooting/repairing windows vista

Examples of taking file ownership/permissions:

C:\>takeown /f "C:\program files\windows sidebar\settings.ini"

SUCCESS: The file (or folder): "C:\program files\windows sidebar\settings.ini" now owned by user "Owner-PC\Owner".

C:\>icacls "C:\program files\windows sidebar\settings.ini" /grant Owner:F
processed file: C:\program files\windows sidebar\settings.ini
Successfully processed 1 files; Failed processing 0 files



http://jsbi.blogspot.com/2006/12/how-to-recover-boot-failure-in-windows.html

http://forums.wincustomize.com/?postid=348387

http://www.vistax64.com/tutorials/86959-access-vista-install-dvd-files.html

http://support.microsoft.com/kb/928228

Monday, June 1, 2009

Set Grub Default to Windows or Last Selected Choice

I was installing a used hard-drive in a friends computer after his drive failed, so had to re-install windows, etc. I took the opportunity to install Ubuntu Linux on the last 6 gigs of the hard-drive as well, in case he is ever having troubles (virus, root-kit, etc) with Windows, he can boot to linux if he still needs to get on the Internet, etc.

I wanted to make it so Windows would be the default on the grub menu. This in itself is actually rather easy, just setting the 'default' option in grub to the line number that Windows shows up in the Grub boot menu. This becomes a problem later in "life" if Ubuntu is updated, and a new kernel is installed in addition to the old kernel, this changes the line that Windows will show up on. One way around this was to move the lines that add Windows to the grub menu up to the top of the menu.lst, therefore it shouldn't change (hopefully)... but I came up with a better suggestion with a little more digging on google. Instead, I simply enabled the usefulness of the savedefault option in Grub, so that any grub menu options (kernel options/operating systems) that have the savedefault in their list of commands would change the default O/S to THAT O/S. If you don't have a "default 0" option, thats fine, just make sure you add the new "default saved" option to your config somewhere in the global area (near the top area).

** The lines with #XX in front of them have been replaced by the respective following line of each of them.

# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
#XXdefault 0
default saved

## should update-grub adjust the value of the default booted system
## can be true or false
#XX# updatedefaultentry=false
# updatedefaultentry=true

## should update-grub add savedefault to the default options
## can be true or false
#XX# savedefault=false
# savedefault=true

If my friend ever goes into Ubuntu, it will change the default to Ubuntu, but all he has to do to get it to default back to windows again, is simply choose to boot into windows again from the grub menu, and it will then default to windows again. Problem solved.

One other option could be to remove the savedefault from any menu entries that you don't want to make changes to the default O/S menu choice during boot-up, if you happen to boot that entry once in a while and don't ever want it to be the default.

Monday, May 18, 2009

Using sfdisk to backup and restore partition tables

I needed to backup a partition table and restore it to a new hard-drive, I tried a little bit of googling using parted with my search terms because I had forgotten that it was actually sfdisk I needed/wanted (from previous similar endeavours), so after coming up with only a few posts that poorly inform readers that copying the first 512bytes of a drive will get them their entire partition table in case of disaster, I finally came across something that mentioned sfdisk, which twigged my memory and I thusly changed my google search to include sfdisk as one of my search terms instead of parted. I came upon the article/post that this post's Title links to (also here), which nicely points out a good method of backing up your hard-drive's partition tables properly using sfdisk, which I will quote the relevant snippets here with a couple pieces edited for clarity or additional information:

Using sfdisk with the -d option we can get a dump of the current partition table in a regular file, and if needed we can restore it from that file:

sfdisk -d /dev/sda > sda_table

and to restore the partition table to the same drive (or change device name for another destination drive):

sfdisk /dev/sda < sda_table

Regardless on the method used, having a backup of the partition table might be handy. ;)

One more tip: another usage of sfdisk with -d is to create an identical partition table from another hard disk. In this example we are partitioning sdb with the exact same partitions as sda (ie. copying partition table from SDA to SDB):

sfdisk -d /dev/sda | sfdisk /dev/sdb

of course this can be handy when the hard drives are identical, in raid1 setups, etc. (actually, they don't even have to be identical, but the destination drive needs to be the same size or larger (exactly the same size, not "sales pitch gigabytes size")).

End Quote.

So there you have it (and I have it for my permanent memory now!).

Sidenote: copying the first 512bytes of your drive may copy many partition tables, but only if they do not include extended partitions, since the main/base partition table actually uses a reference that links to another part of the drive where it stores the rest of the extended partition table data. Don't ask how I know this, other then it was a late night, and interesting things were learned using hexedit! :) ask Jaymes if one must know! :P

Tuesday, April 21, 2009

Microsoft Outlook XP 2002 0x8004060c

Was receiving the following error message in Outlook 2002 when trying to send/receive email:

Sending and Receiving reported error 0x8004060C (0X8004060C) Unknown Error: 0X8004060C

After googling, came to this page (http://support.microsoft.com/kb/304863) which explains the error in more or less words.

Short Answer: your PST file is full, you need to either start using a new PST file and use your old one as an Archive (quickest method I think), or create a new PST File, and move a bunch of your old emails into it (from the old PST file), and then compact your old PST file (google for how if you don't know how).

Problem fixed.

sidenote: a person may want to setup auto-archiving of older emails to another PST file to help avoid this, until the archive pst file becomes full, and then you'll have to adjust the destination to an additional (new) archive pst file after creating another one to use.

fi.

Vista Windows Update Error 0x80072EFE 80072EFE

I encountered the error code of: 0x80072EFE on windows update on a Dell laptop after "upgrading" it (repair install) .

In the end, it ended up being that since the "Automatically detect proxy" was enabled in Internet Options in Internet Explorer, it was trying to detect my ISP's proxies, and in the C:\Windows\windowsupdate.log file, it showed it as failing via a proxy (when I didn't have a specific proxy set).

Anyways, long story short, I simply disabled the Automatically Detect Proxy option in Internet Options in Internet Explorer, windows update now stopped trying to use a proxy that vista was trying to detect (maybe my isp's proxy was down.. or broken or ?). Windows update worked flawlessly after disabling the detect proxy option.

Articles (rather, posts) I found on the problem were often unanswered (successfully) or pointed towards an internet related issue with your system. I had gone through most of a microsoft howto (http://support.microsoft.com/kb/836941/en-us) (found via this post: http://www.vistaheads.com/forums/microsoft-public-windowsupdate/185095-windows-update-fails-error-80072efe.html)on troubleshooting the issue (after manually trying some things myself beforehand), and the howto pointed/reminded me to read the windowsupdate.log file, so I went and checked, and saw the proxy trying to be used (unsuccessfully). In this instance, it was definitely an internet related issue... (a broken proxy or some other issue with it).

fi.

Monday, September 29, 2008

Windows XP (Vista?) Login Screen - Screen Saver

I was searching on how to disable the "Windows XP" screen saver on the login screen, and simply have it use the "Blank Screen" Screen-saver.

The url this post links to, describes where (near the bottom of the page) to go in the registry to edit this setting, but didn't mention how to set it to the blank screen, add my recipe to it to get the blank / black screen screen-saver.

Browse to the following key with regedit: HKEY_USERS\.DEFAULT\Control Panel\Desktop
In the right side of the window, change the SCRNSAVE.EXE entry by double clicking on it, to contain:

C:\WINDOWS\system32\scrnsave.scr

That's all.... this can also be used to change to any other screen saver, just point it to the appropriate file.

WHY?: I did this on some vmware virtual windows XP machines to reduce any extra load the screen savers would put on them while they were sitting at the login screens.

EDIT: another link to microsoft on the subject:
http://support.microsoft.com/kb/314493

Monday, July 7, 2008

mouse keys in virtual pc 2007 and ubuntu hardy heron 8.04

a few notes about getting ubuntu hardy heron 8.04 running under Virtual PC 2007 and using it via a remote desktop connection to the virtual pc host computer (or at least to get the installation done successfully with custom partitioning).

to boot up the hardy heron 8.04 (kubuntu-desktop in my case) live CD successfully without virtual pc complaining about a processor error and promptly crashing the virtual instance, you need to follow these steps:

1. choose your language upon first boot of the live CD inside the virtual pc instance (english in my case)
2. press F4 and choose the Safe Graphics mode option (down arrow to it, then enter)
3. press F6 and add: "noreplace-paravirt" to the command line that shows on the screen (without the quotes)
4. press Enter to continue the process

The live cd should boot to a linux desktop (KDE or Gnome or ... depending on which live CD you are using)

to continue the installation, choose the install icon on the desktop, at this point, you may find it hard to use the mouse (via remote desktop connection to the windows host machine), so I suggest turning on mouse keys to use the number pad as a mouse instead, following these steps:

press the left-alt + left-shift + num-lock buttons together, at first, your windows host machine will ask about turning on mouse keys, I chose to disable the mouse key shortcut (in the windows host machine that I was RDP'd into), and closed out the mouse keys configuration menus, and then repeated the process of pressing left-alt + left-shit + num-lock again, and this time, the linux session recognized it (KDE in my case) and brought up a configuration window for it, I used the keyboard and pressed tab to change focus to "continue", and then spacebar for choosing continue. Now if num-lock is turned on, i can use the number pad to move my mouse around (5 is left click btw).

Thursday, April 3, 2008

Installing Ubuntu 8.04 LTSP OR Edubuntu

I was attempting to setup an LTSP server and had decided to go the "easy" way by simply installing edubuntu (which includes a preconfigured LTSP server with some additional preinstalled packages aimed at education users (8 to 16 year old students from what someone mentioned in the IRC channel #edubuntu on the freenode IRC network (irc.freenode.net).

Unfortunately, with the new version of ubuntu (8.04) that is being released at the end of April 2008, they've changed everything around, and there is no longer a separate edubuntu (server) installation disk (per say), and you don't use the standard ubuntu-server disk either..... so how how then, do you install an edubuntu server or any other LTSP server (the advantage of the newly christened way of going about setting up edubuntu/ltsp... )? Read on to find out.. I originally spent 20-30 minutes googling for information and was coming up rather short on answers, until I finally decided to give the IRC channels a try, and happily (and quickly) found out the required details:

First things first, you need to download the pieces:

(Choose i386 or amd64 based on your hardware (64bit or 32bit), and/or based on personal choice. Personally I choose i386 initially for reasons that include better compatibility with certain programs and compiling programs from source without extra hassle, this should eventually fade as 64bit becomes the standard.. but, until then, I'll stick with builds that make my life less stressful! :) )

Required for Ubuntu 8.04 LTSP Server:
1. download the ubuntu-8.04-alternate CD Image

Required for Ubuntu 8.04 Edubuntu (LTSP) Server:
1. download the ubuntu-8.04-alternate CD Image
2. download the edubuntu-8.04-addon CD Image

Burn the Images that you need using your favorite burning software.

Installation of LTSP Server:
1. Put the ubuntu-8.04-alternate CD/DVD in your systems CD/DVD Reader.
2. Turn the machine on and let it get to the Ubuntu CD Install menu.
3. Don't get carried away and hit enter yet... instead, after choosing your preferred language, press the 'F4' key on your keyboard, this should bring up a menu, choose the LTSP option.
4. Press enter to start the installation.
sidenote: depending on how many network cards (suggested defaults included for 2) are in the system, some more interaction may be required during installation. If you want the simplest installation, just make sure you have two network cards in the system.
5. Congratulations, you now have an LTSP Server... this is all this post covers, as this is as far as I've gotten with my own LTSP installation, if you wanted an edubuntu LTSP server, read on to step 6, otherwise, enjoy your standard LTSP server:

6. After the installation, and rebooting, and logging into the desktop, insert the edubuntu addon CD/DVD into the system.
7. A popup should come up asking if you'd like to install the Extensions
8. After agreeing to install the extensions, an 'add-remove applications' dialog will popup, presenting the CD Contents sorted by category.
9. Select the edubuntu desktop category and toggle the checkbox next to the edubuntu-desktop package in the right window.
10. After all the install processes finish, restart your server to make the edubuntu artwork take effect.
11. Congratulations, you now have an Ubuntu 8.04 Edubuntu LTSP Server.

Note: some of these steps are near verbatim from the original article I was pointed to (and the one that this post links to), since I couldn't have said it any better :)

Now all I need to do is setup the client side of things :)

Thursday, March 27, 2008

Webalizer DNS problems (fails to resolve any domains)

I had the (mis)pleasure of reinstalling webalizer the other night on a server to run some stats, I ended up wasting a bunch of my time on a silly problem, and thought I should post my solution since my googled in vain for an answer.

Basically, the coles notes version: I had run a grep based on a particular domain name, on all the (several gigs) of apache2 log files sitting in the log folder, in hopes of creating just a log for a particular domain. Unfortunately, I forgot that when grepping multiple files (using filename wildcards on grep command line), that it will output the filename that any search results are found in (once per line of text found). I didn't notice this happening, since I piped the output to a new file. I later went on to try running webalizer on this file, only to find that the DNS wasn't working properly, and it wasn't resolving any of the visitor's IP's.

After googling, it became obvious that this was/is a common problem for webalizer (DNS issues), unfortunately for me, my erroneous log files were the cause of the problem, and I wasted *alot* of time trying to rebuild webalizer from source using the suggested --enable-dns option, tried downloading a newer src rpm from a newer distribution (opensuse 10.0 based system, tryed 10.2 or 10.3 src), unfortunately it had different requirements that didn't seem solveable with Opensuse 10.0.

I eventually actually looked at my log file I was trying to process (more closely.. as I had looked at it several times before... without noticing my/the error). I went on to also determine that webalizer doesn't like the vhost at the beginning of each line (don't quote me on this.. I may be dreaming.. it was late... ), so I went on to find a way to remove that as well.

Tools/methods to fix the problems:

To remove the filename "access_log-20060131:"(and variations (dates) thereof) from in front of the vhost name on each line (note, make sure all the original log filenames were the same number of characters length for this search/delete to work and not miss any, otherwise it could be modified a bit I guess):

sed -e 's/access_log-2006.....//g' testlog

This removed the filename and the colon (:) from in front of any vhost names in the log file.

To remove the vhost names for webalizer (once again, not positive you need to do this, but I wanted to make sure I had only gotten log entries that originated from the particular vhost.. my grep may have caught some that were referred by the particular vhost to other vhost domains.. so this step eliminates that problem:

split-logfile2 < testlog

split-logfile2 splits a vhost_combined format apache2 logfile into separate files based on the vhost names contained in the logfile, and also removes the vhost name from the first part of each line, since the file it outputs to (for each domain) is based on the vhost name, this isn't an issue in terms of recognizing what domain each log is for.

I hadn't known about split-logfile2 before all of this, and now that I do, it will definitely come in handy down the road.

After all this, webalizer was more then happy to finally parse the logs, and even reverse dns all the IP's providing much better results in terms of visitor information, etc.

on a side note, in my several hours of pissing around, I ran across several programs / projects / packages that either have forked off of webalizer, or forked off of other common log analyzers (seems there are many), and I will try to put a post up with what I found... if only for my own reference later. Webalizer results really do seem kind of basic after all is said and done, so finding another analyzer suite (I've used awstat before as well) may be in the cards if I want to garner more information... another alternative is also google analytics of course, but this involves having it in the pages being served, and during the fact of things happening.. its always nice to be able to process log files after the fact using tools such as webalizer and awstats.

"Upgraded" from Kingston 4GB USB Flash Drive to Patriot Xporter 8GB USB Flash Drive

I traded "up" and got a Patriot XPORTER 8GB (not the XT designated model) USB Flash drive, to replace my "little" 4gb Kingston USB Flash Drive. I had only purchased the 4gb a month or two ago for $20, and the 8gb xporter was $30 on sale last week, so thats why I picked it up, plus I have a friend that could use the 4gb drive.

While the space is an upgrade, the performance is around 50% when compared to the kingston. The kingston can read (most of the drive) at 33mb/sec, while the Patriot Xporter only manages a steady 14mb/sec across the whole drive. Writing is nearly half of the kingston also, though I can't recall what I calculated for write speeds, since the program I used (HDTACH) only supports reading tests (RAW, not filesystem based as far as I know), and I just manually calculated the writing speeds by writing a 150MB file to each drive and timed them.

In this case, I'm willing to accept the speed downgrade for the doubled capacity, allowing me to store/transfer some rather large files when I need to, or simply not have to "clean it up" as often, in order to make sure I have room on it.

Install Native Ubuntu system from the comfort of Windows GUI/System using WUBI

http://wubi-installer.org/

A friend posted this link to me, its bascially a GUI windows (and linux) based application that allows a user to install Ubuntu directly on a Windows system, on the windows filesystem (using large file(s)).

Later on, you can move the ubuntu system onto its own partition if you want a speed upgrade, as well as greater security of your data in case of power outages, since one of the notes about running ubuntu in a file on the windows filesystem, it is more prone to errors during hard shutdown / reboots then it would normally be if it were installed on its own partition.

Looks cool... I've used some other ones before (forget the names), I imagine this one is either an evolution of the ones I used, seems this stuff is always getting better and easier.

Oh yeah, and whats kinda cool, is that you can simply go to Add/Remove programs in windows if you want to remove the linux installation later, in case you want to try a different version, or need the space.

centos 4.4 lvm snapshots crash system when they become full (run out of space)

Just a note:

On a CentOS 4.4 server, lvm snapshots that eventually became full (and hence invalid), would crash a system. This problem seems to be fixed in Centos 4.6 (I didn't try 4.5). I can now run snapshots that eventually run out of space, and successfully lvremove them without crashing the system.