Looks like hackers strike again to deface a government page... Guess it doesn't matter what type of target you are. Even the "High Court of Cassation and Justice" has something to worry about.
Sunday, January 27, 2008
And justice for all...
Posted by
cmihai
at
4:23 PM
0
comments
Saturday, January 26, 2008
Disk monitoring and tuning with dd and S.M.A.R.T. - Reallocating bad sectors and predicting disk failure
What is S.M.A.R.T.?
Modern disk drives will automagically reallocate bad sectors on the fly, as soon as they encounter some kind of R/W/ECC error. But in order for this to happen, it must first access that sector. This is why you never see surface errors on modern disks.
Modern hard drives (ATA and SATA) have S.M.A.R.T. - Self-Monitoring, Analysis, and Reporting Technology. Once you have that enabled in BIOS (assuming you have a S.M.A.R.T. capable disk and controller) you can monitor a number of disk health and performance parameters.
What you should keep an eye on is the Reallocated Sectors Count (if the drive has a problem with a R/W/ECC error it will mark the sector "Reallocated" and transfer the data to a spare area on the disk). This will result in some performance decrease, and is a sign of imminent disk failure.
Monitoring S.MA.R.T.
ATA and SATA disks:
To monitor S.M.A.R.T. data you can use HDTune on Windows or SmartMonTools (smartd, smartctl) on Darwin (Mac OSX), Linux, FreeBSD, NetBSD, OpenBSD, Solaris, OS/2, or eComStation systems. If you're up to it, you can also use SmartMonTools on Windows.
USB Enclosures:
While in most cases you should have no trouble using HDTune or SmartMonTools, some USB drive enclosures may be resilient to monitoring with S.M.A.R.T. programs and will require vendor software. In such cases, you can download vendor software to perform monitoring, like "Western Digital Data LifeGuard Diagnostics".
iPods:
You can also get S.M.A.R.T. info on your iPod. You can either configure it to act as a pass through device (regular USB media) or boot your iPod in diagnostic mode. You can check S.M.A.R.T. disk data and perform more test on your iPod. To do so, you must reset your iPod and hold REW + Select (5G) at the Apple boot menu. For other iPod models, see here (or Google Apple Diagnostic Mode your iPod Model).
Forcing the disk to remap damanged sectors
Now you should know that if you see any problems with Reallocated Sector Count, Reallocated Event Count, Seek Error Rate, Offline Uncorrectable, UDMA CRC Error Count, Multizone Error Rate, Hardware ECC Recovered values, you should consider getting a new disk. These are all signs of a failing disk. Learn more about S.M.A.R.T. attributes and their meaning here. Note that depending on vendor, there may also be enhanced or propriotary S.M.A.R.T. attributes. Read your HDD vendor documentation.
But sometimes you just need to get a bit more life out of a disk, and force the disk to reallocated damaged sectors. You can do so easily by performing a full raw disk read and write operation. For this, you can use the UNIX "dd" tool. Make sure your target disks aren't mounted (Type "mount" to list mounted disks then use "umount disk").
You can perform a disk read operation (reading the whole disk) using a syntax similar to:
# dd if=/dev/disk of=/dev/null bs=2048You can perform a disk write operation (zero out the disk, this WILL result in data loss) using syntax similar to:
# dd if=/dev/zero of=/dev/disk bs=2048Now you may wish to perform both a read and write at the same time, and not wipe out your disk data (zero it out). You can perform such a "disk refresh" using syntax similar to:
# dd if=/dev/disk of=/dev/disk bs=1mThis will read and rewrite the data to disk in 1MB chunks to prevent presently recoverable read errors from progressing into unrecoverable read errors.
Of course, you should read the dd manpage for your OS (on Windows you could use a dd for Windows implementation or resort to some sort of Linux or BSD LiveCD). Replace /dev/disk with your disk (make sure you're using the right disk). On Linux you can find out what disk you need to use from "dmesg" or /proc/partitions:
# cat /proc/partitionsYou can also use "fdisk -l" to list partitons on your disk, see if that's the right disk
# fdisk -l /dev/hdaDo note that you need root permissions for all of this activity, so on some Linux systems you may need to use "sudo -i" to get a root shell, or precede all operations with "sudo".
While you're doing this rewrite operation, you should monitor the kernel log (dmesg). You can monitor /var/log/messages for this:
# tail -f /var/log/messagesYou usually watch out for "DriveReady SeekComplete Error status=0x51 DriveStatusError error=0x04" or some other error.
You should also keep an eye on the Reallocated Sectors and other Interesting Parameters in smartctl:
# smartctl -A /dev/hdaDo this every now and then, and note the values before you've started the operation.
Once you begin the "dd" operations you can send dd a SIGINFO signal (use pkill / kill / whatever) to make it print out I/O information (progress). Some shells / TERMS also respond to Ctrl-T by sending SIGINFO.
# pkill -SIGINFO ddOnce you're done with dd and S.M.A.R.T. tools you should also perform a filesystem check (fsck / chkdsk / whatever).
Conclusions:
- Monitor S.M.A.R.T. data with smartclt, keep an eye on Reallocs. Consider getting a new disk if you see reallocated sectors
- Perform a disk refresh with dd in order to prevent recoverable read errors from progressing into unrecoverable errors. You don't need fancy tools like SpinRite.
- You can use a simple Linux or BSD LiveCD to perform the disk refresh.
- This is NOT a data recovery procedure. If you're doing data recovery, use something like dd_recover to a separate media.
- This is NOT a step by step tutorial. Read your OS manpages to make sure you're not wiping out the wrong disk or something.
- Always monitor S.M.A.R.T. parameters in order to spot disk failure before it happens.
- Always keep backups.
Links and resources:
- Linux Harddisk Monitoring with SmartMonTools (smartctl)
- HDTune - S.M.A.R.T. tool for Windows
- Wikipedia S.M.A.R.T. page (good links)
Posted by
cmihai
at
11:55 AM
2
comments
Labels: Hardware, Linux, Microsoft, Open Source, UNIX
Thursday, January 24, 2008
Vista Vulnerability Report
Security professional Jeff Jones published a Windows Vista security report for vulnerabilities between Nov. 2006 to Nov. 2007. It also does a side by side comparison with Windows XP, RedHat and Ubuntu Linux and MacOS 10.4.
It looks like the Microsoft security features, tools and approach are finally starting to pay off.
Jeff Jones was also the author of the (somewhat controversial) Internet Explorer versus Firefox report.
Anyway, before you start criticizing, look at the quoted sources (secunia, NIST, securityfocus, securitytracker, ubuntu security notices, rhel security notices, ms security bulletins, etc). The man has a point.
Posted by
cmihai
at
7:04 PM
0
comments
Monday, January 21, 2008
PostgreSQL not for sale
Here's why PostgreSQL is NOT for sale.
Posted by
cmihai
at
1:52 AM
0
comments
Labels: Databases, Open Source
Sunday, January 20, 2008
Change Windows drive letter
I get asked quite often about changing the drive letter in Windows. Here's how:
Start - run - "diskmgmt.msc"
Right click your drive - Change Drive Letter and Path. You can also use this to create dynamic disks, delete / create partitions, format disks, create RAID arrays, shrink or grow volumes, etc.
For a command line tool, use diskpart.
Posted by
cmihai
at
2:21 AM
0
comments
Labels: Microsoft
Crazy EEE modding
And I thought the touch screen mod went too far...
http://beta.ivancover.com/wiki/index.php/Eee_PC_Internal_Upgrades
Then run MacOS X on the EEE :-).
Posted by
cmihai
at
1:54 AM
0
comments
Labels: Hardware
Saturday, January 19, 2008
Sun buys MySQL: So far, so good... so what?
Sun Microsystems Inc. CEO Jonathan Schwartz answered some questions on his blog regarding Sun's future involvement with PostgreSQL, JavaDB Oracle relations and their plans with MySQL.
Sun also release a "Press Kit" on their webpage.
Some people on the other hand aren't too excited about the Sun - MySQL AB deal. Some even think this is a plot mastered by Larry Ellison to destroy MySQL (tinfoil hat, anyone?). Here's what Marketwatch has to say on the subject:
"BERKELEY, Calif. (MarketWatch) -- Sun Microsystems Inc. gobbling up MySQL is perhaps the worst single event I have ever witnessed in the history of tech mergers and acquisitions."
Posted by
cmihai
at
8:30 PM
1 comments
Labels: Databases, Open Source, Sun
Friday, January 18, 2008
WinDirStat - KDirStat graphical disk usage utility clone for Windows
If you're familiar with KDirStat (or even Baobab) Disk Usage Analyzers in *NIX, you'll be happy to know there's a clone for Windows (yes, WinDirStat is the clone). Makes disk cleanup so much easier.
Just grab WinDirStat from the SourceForce page, and run it. You'll get a nice graphical view of disk usage.
Anyway, if you use Linux/BSD/whatever just use Baobab (Gnome Disk Usage Analyzer - part of gnome-utils package), KDirStat part of KDE or Filelight.
You can also get Scanner if you like that Baobab / Filelight PIE chart view, get Scanner on Windows.
Posted by
cmihai
at
1:01 PM
0
comments
Labels: Linux, Microsoft, Open Source, UNIX
Wednesday, January 16, 2008
Sun Microsystems buys MySQL for 1 billion USD

" We announced big news today - our preliminary results for our fiscal second quarter, and as importantly, that we're acquiring MySQL AB." - Jonathan Schwartz - CEO of Sun Microsystems, Inc.
Read more here. Sun & MySQL AB press conference here.
I'm also not quite sure on how will this impact Sun's long term policy on PostgreSQL. Sun offers PostgreSQL support (PostgresSQL on Solaris even has native DTrace probes), and was a big contributor to the project. I don't think they would drop PostgreSQL support though. Maybe port PostgreSQL to MySQL as a storage engine? :-).
I'd still like to know how Sun expects to make money off MySQL. Well, enough money to justify the 1 billion investment. Sun does tend to make money off support contracts, services, hardware and all that, but MySQL AB hardly managed to pull in $50 million last year. And they have around 350 employees. And besides, nothing stopped Sun from selling MySQL support and all that before.
http://finance.google.com/finance?q=NASDAQ:JAVA
Sun Microsystems also released the Preliminary Results for Second Quarter Fiscal Year 2008 Report:
"Sun expects to report revenues for the second quarter of fiscal 2008 of approximately $3.60 billion, an increase of approximately 1 percent as compared with $3.57 billion for the second quarter of fiscal 2007. Net bookings for the second quarter of fiscal 2008 were approximately $3.85 billion, an increase of approximately 7% year over year."
I'm waiting to see how Oracle (who already bought Open Source databases Berkeley DB2 and the MySQL InnoDB engine) will react to this one. Remember what Oracle did when RedHat bought JBoss? Shortly after, Oracle "Unbreakable" Enterprise Linux (based on RHEL sources) "just happened". What now? OracleSolaris? :-). Oracle also tried to buy MySQL AB before.
On a side note, Oracle bought BEA today, for $8.5 billion, after BEA turned down their original offer of $6.7 billion. Here's the Oracle Press Release. A nice addition to their "strategic acquisition" list, which already gathered almost 40 entries since 2005.
Posted by
cmihai
at
8:27 PM
0
comments
Labels: Databases, Open Source, Oracle, Solaris, Sun
Tuesday, January 15, 2008
Macbook Air - Razor Thin Computing
Razor thin MacBook
64 GB Solid state drive and 1.36 kg is awesome for a 1.6-1.8Ghz machine with 2GB of RAM.
Posted by
cmihai
at
9:54 PM
2
comments

