05/21/09

Permalink 11:11:15 pm by guy, Categories: Linux, Random Stuff

The other I shutdown (properly) my FreeNAS box to replace a drive. The next day I noticed that it was rebooting itself frequently. Once in a while is a bad frequency, every 15 minutes is unusable! I removed all my external drives in an attempt to narrow down the problem. Nothing changed. I finally plugged in a monitor and watched. As I expected, it was rebooting as a result of a kernel panic. Unfortunately I?ve had lots of problems like this with FreeNAS (I still want to love it!) and I?ve passed them all off as hardware incompatibilities with BSD. This time, it wasn?t. What I found was that the panic was for ?ffs_blkfree?. I?d love to copy the who panic message, but it only displays for about 15 seconds so I just look for key phrases I can google. After rebooting several more times I noticed that the drive was thrashing quite a bit and that the fsck process was running. Once I saw that I disabled an option that I had remembered setting previously which was to perform a background fsck on every boot.

After disabling the background fsck the system stabilized, but I was sure I had some kind of data problem so I dropped to a command prompt through an SSH session and manually executed the following command:

freenas:~# fsck -t ufs /dev/ad0s2
** /dev/ad0s2
** Last Mounted on /mnt/Data1
** Phase 1 - Check Blocks and Sizes
1 DUP I=4
UNEXPECTED SOFT UPDATE INCONSISTENCY

INTERNAL ERROR: dups with -p
UNEXPECTED SOFT UPDATE INCONSISTENCY
** Phase 1b - Rescan For More DUPS
1 DUP I=4
UNEXPECTED SOFT UPDATE INCONSISTENCY

** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
BAD/DUP DIR I=4 OWNER=root MODE=40700
SIZE=2048 MTIME=May 21 20:57 2009
CLEAR? [yn] y

** Phase 5 - Check Cyl groups
FREE BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? [yn] y

SUMMARY INFORMATION BAD
SALVAGE? [yn] y

ALLOCATED FRAGS 1-8 MARKED FREE
BLK(S) MISSING IN BIT MAPS
SALVAGE? [yn] y

87964 files, 23572718 used, 212474857 free (6921 frags, 26558492 blocks, 0.0% fragmentation)

Better, but let’s try again and make sure

freenas:~# fsck -t ufs /dev/ad0s2
** /dev/ad0s2
** Last Mounted on /mnt/Data1
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
LINK COUNT DIR I=2 OWNER=jackmang MODE=40777
SIZE=512 MTIME=Apr 4 17:02 2009 COUNT 9 SHOULD BE 8
ADJUST? [yn] y

UNREF FILE I=5 OWNER=root MODE=100400
SIZE=499132436784 MTIME=May 20 19:27 2009
RECONNECT? [yn] y

NO lost+found DIRECTORY
CREATE? [yn] y

UNREF FILE I=8 OWNER=root MODE=100400
SIZE=499132416000 MTIME=May 20 19:55 2009
RECONNECT? [yn] y

UNREF FILE I=11 OWNER=root MODE=100400
SIZE=0 MTIME=May 20 23:19 2009
RECONNECT? [yn] y

** Phase 5 - Check Cyl groups
FREE BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? [yn] y

SUMMARY INFORMATION BAD
SALVAGE? [yn] y

87965 files, 23572719 used, 212474856 free (6920 frags, 26558492 blocks, 0.0% fragmentation)

***** FILE SYSTEM WAS MODIFIED *****

and one more time to be sure

freenas:~# fsck -t ufs /dev/ad0s2
** /dev/ad0s2
** Last Mounted on /mnt/Data1
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
87965 files, 23572719 used, 212474856 free (6920 frags, 26558492 blocks, 0.0% fragmentation)

All fixed! I don’t know why the background fsck was causing a panic, but this worked. It may be possible that after stopping the background fsck command and rebooting that I could have used the GUI fsck command successfully, but hopefully I’ll never know. That was not fun.

03/04/09

Permalink 09:17:21 pm by guy, Categories: Windows, Random Stuff , Tags: windows live mail

Today I was trying to troubleshoot an issue with Windows Live Mail connecting to my POP3 mail host server. The details of the problem don’t matter, but I thought I would document where I eventually found the log file.

There is an option in the Menu of Windows Live Mail to enable logging:
- Click on the ‘Tools’ menu
- Click on the ‘Options’ menu item
- Select the ‘Advanced’ tab
- Click the ‘Maintenance’ button
- Click on the ‘Store Folder’ button

The path in the text box that pops up is the folder where the log file will be generated. Make your life easy by copying the path. Cancel the path dialog.

At the bottom of the Maintenance dialog there are several check boxes to select what you want to log. Select whatever you are interested in and then exit the dialogs. Now browse to the folder by pasting the path into the ‘Run’ dialog on the Start Menu of Windows. (You might want to restart Live Mail and retrieve or send mail to make sure that the log file has something to look at first)

When you get into the directory in question the file you are looking for is:
WindowsLiveMail.log

Enjoy looking at it using your favorite text editor (Notepad++ I’m sure!)

02/16/09

Permalink 07:53:49 pm by guy, Categories: Windows, MS SQL , Tags: sql server

If you restore a database from one SQL instance to another you will often run into the issue where your logins for the restored database are no longer properly mapped to the new SQL Server instance’s users. Even if the users exist on the new server they probably won’t be mapped properly. This is scary, but easy to fix in most cases. This is documented all over the place, but I’m putting it here for me.

If you already have the login in your destination SQL Server, but they are not matched up then change to the restored database and execute the following sp:

USE AdventureWorks;
GO
EXEC sp_change_users_login 'Auto_Fix', 'Bob'
GO

In this case you have restored Adventureworks to a new instance and you have a ‘Bob’ login account, and the database has a ‘Bob’ user, but they are not mapped. The command above we automap it with the assumption that the login and the user are identical.

You can map to another, non-matching account using this command:

USE AdventureWorks;
GO
EXEC sp_change_users_login 'Auto_Fix', 'Bob', 'BobsLogin'
GO

If you do NOT have a Login user an you want to create one in a single step then do this:

USE AdventureWorks;
GO
EXEC sp_change_users_login 'Auto_Fix', 'Bob', NULL, 'sUperD00perPassw0rd';
GO

This automatically creates the missing login account matching the specified user and sets the password to the specified value.

http://technet.microsoft.com/en-us/library/ms174378.aspx
http://www.mssqltips.com/tip.asp?tip=1590

Permalink 07:34:46 pm by guy, Categories: Oracle , Tags: oracle xe

Here is one for the notebook… by default the web interface for Oracle 10g Express is limited to localhost connections only. To change it to allow remote connections you can execute:

EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

Start the sql command line:

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 11 11:10:40 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> connect
Enter user-name: system
Enter password:
Connected.
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

PL/SQL procedure successfully completed.

SQL> quit;


DONE! No restart required

Here is a nice web page about some of the common XE info: http://virag.sharma.googlepages.com/oraclexemadeeasy

01/15/09

Permalink 10:43:32 pm by guy, Categories: VMWare, Windows , Tags: hiberfil.sys, w2k8, windows server 2008

I was creating a Windows Server 2008 template installation for our VMWare cluster the other day and noticed that the basic installation, before adding any server roles, seemed to use more disk space than I would have expected. I had never setup a 2008 Server before so I thought I’d investigate how the files were distributed. My favorite tool for this kind of investigation is WinDirStat ( http://windirstat.info/ ), another fine open source application from SourceForge.

I took this image directly from the web site, this is pretty much the whole interface. The top list is essentially an explorer view of your directory structure. The top right is a breakdown of file type distribution as well as the color coded key for the filemap at the bottom. The filemap is the magic of this application. The picture at the bottom represents your entire disk space for the drive that has been mapped. The rectangles that make up the image each represent 1 file. If you select a rectangle at the bottom it will automatically highlight that file in the explorer and vice-versa. If you select a directory in the explorer it will highlight all the files in the image below. Very cool and it makes it very easy to identify how your disk space is distributed.

So, to make a long story short, I immediately saw from the image that there were 2 HUGE 2 gig files. One was the page file (pagefile.sys), and the second was the hibernation mode (hiberfil.sys) file for suspending to disk. The size of the hiberfil.sys file is equal to the amount of RAM installed. Why would a server OS need to hibernate? I did some googling and found a blog entry explaining that the only way to get rid of the file is to adjust the power settings through the command line.

powercfg.exe /hibernate off

At least the fix is easy. Unfortunately I’m guessing there is all sorts of wasted disk space out there due to this unfortunate default configuration.

<< Previous :: Next >>

May 2017
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
I'm a generalist, at least if I'm honest. In my job I am primarily a developer, but also a sysadmin, and (as little as possible) technical support. I know a little about a lot of things, a lot about some things, and everything about nothing. Here I will post random learnings...

Search

XML Feeds

User tools

blog soft