2010-04-03

ReadyNAS 600 RAID Recovery with Ubuntu

Assumptions: (you have the following)
Infrant (now Netgear) ReadyNAS 600, Sparc based, kernel: 2.6.17.14ReadyNAS
A Linux system running Ubuntu (would work with live image: Lucid Lynx used for this.) with 4x SATA ports.

Trying to recover data off the disks from a ReadyNAS 600 on Ubuntu is not as straightforward as the existing guides might lead one to believe, especially getting ext2fuse to compile.

First, the guides:
Written specifically for Ubuntu, and succinct. - Useful for an overview.
Recovering a failed ReadyNAS 1100 array - Has a bit more information.
Mounting Sparc-based ReadyNAS Drives in x86-based Linux - Step by step instructions; this is the most detailed, and the one I'm working off of; please refer to this one to make sense of the rest of this post.

If working off a LiveCD, or a new system, be sure to start off making your editor readable, after opening your terminal.

(This post assumes limited to no Linux experience, beyond being capable of burning an Ubuntu .iso to disc. Anyone attempting recovery of a failed RAID is assumed to have basic problem solving skills and the capacity to learn.)
sudo su
cat >> ~/.vimrc
highlight Normal ctermbg=black ctermfg=white
set background=dark
syntax on
CTRL-D
to exit

Now,
agt-get install libfuse-dev
prior to making ext2fuse.  Doing so should avoid this:

In file included from readdir.c:1:
readdir.h:6:27: error: fuse_lowlevel.h: No such file or directory
In file included from readdir.c:1:
readdir.h:8: error: expected ‘)’ before ‘req’
readdir.c:7: error: expected ‘)’ before ‘req’
readdir.c:46: error: expected ‘)’ before ‘req’
make[2]: *** [ext2fuse-readdir.o] Error 1
make[2]: Leaving directory `/usr/local/bin/ext2fuse-src-0.8.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/bin/ext2fuse-src-0.8.1'
make: *** [all] Error 2


You will want to do the following when presented with the library errors, but can safely skip steps 6 thru 8.
ln -s /lib/libcom_err.so.2.1 /lib/libcom_err.so
ln -s /lib/libext2fs.so.2.4 /lib/libext2fs.so

What follows are the errors from running make, and the solutions, with reference as necessary. If you don't get the errors on your system, due to newer headers and the like, you can disregard the (non)relevant solution.  Also, I've 'shown my work', so to speak, so as to lend to evaluation whether my solution is correct or not; after all, one shouldn't blindly follow advice from strangers on the intertubes. For the inpatient, simply scroll to the necessary fix.

First compile error:
imager.c:41: error: conflicting types for ‘ssize_t’
/usr/include/unistd.h:221: note: previous declaration of ‘ssize_t’ was here
make[2]: *** [libext2fs_a-imager.o] Error 1
make[2]: Leaving directory `/usr/local/bin/ext2fuse-src-0.8.1/lib/ext2fs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/bin/ext2fuse-src-0.8.1'
make: *** [all] Error 2
in /usr/include/unistd.h around line 221 we see:
#ifndef __ssize_t_defined
typedef __ssize_t ssize_t;
# define __ssize_t_defined
#endif
and __ssize_t gets defined in: /usr/include/bits/types.h:180
__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error.  */
__SSIZE_T_TYPE is defined in: /usr/include/bits/typesizes.h:60
#define __SSIZE_T_TYPE          __SWORD_TYPE
And __SWORD_TYPE is defined in /usr/include/bits/types.h:60
# define __SWORD_TYPE           int
So, the solution is to simply comment out the redefinition in imager.c
lib/ext2fs/imager.c
#ifndef HAVE_TYPE_SSIZE_T
#ifndef __FreeBSD__
typedef int ssize_t;
#endif
#endif
Solution:
vi lib/ext2fs/imager.c
//typedef int ssize_t;


Next error:
In function ‘open’,
    inlined from ‘check_mntent_file’ at ismounted.c:153:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[2]: *** [libext2fs_a-ismounted.o] Error 1
make[2]: Leaving directory `/usr/local/bin/ext2fuse-src-0.8.1/lib/ext2fs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/bin/ext2fuse-src-0.8.1'
make: *** [all] Error 2
From here: https://wiki.ubuntu.com/CompilerFlags:
When using open() with O_CREAT, best-practice is to define a valid mode argument. For the least modes, try using (S_IRUSR|S_IWUSR) first. If that doesn't work as expected in the program, then start adding back perms. For example, user and group: (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); user, group, and other: (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH).
And additionally: http://opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html
So, the simple solution is:
vi lib/ext2f/ismounted.c, around line 153
from:
fd = open(TEST_FILE, O_RDWR|O_CREAT);
to:
fd = open(TEST_FILE, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);

Next (snipped some duplicate lines for brevity):
llseek.c:68: error: expected declaration specifiers or ‘...’ before ‘_llseek’
llseek.c:68: error: expected declaration specifiers or ‘...’ before ‘fd’
llseek.c:68: error: expected declaration specifiers or ‘...’ before ‘offset_high’
llseek.c:69: error: expected declaration specifiers or ‘...’ before ‘offset_low’
llseek.c:69: error: expected declaration specifiers or ‘...’ before ‘result’
llseek.c:70: error: expected declaration specifiers or ‘...’ before ‘origin’
llseek.c: In function ‘_syscall5’:
llseek.c:74: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
llseek.c:68: error: parameter name omitted
llseek.c:117: error: expected ‘{’ at end of input
make[2]: *** [libext2fs_a-llseek.o] Error 1
make[2]: Leaving directory `/usr/local/bin/ext2fuse-src-0.8.1/lib/ext2fs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/bin/ext2fuse-src-0.8.1'
make: *** [all] Error 2
I found a solution here: http://www.mail-archive.com/sisuite-users@lists.sourceforge.net/msg03353.html:
in lib/ext2fs/llseek.c: around line 66
#ifndef __i386__
static int _llseek (unsigned int, unsigned long,
                   unsigned long, ext2_loff_t *, unsigned int);
static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
                 unsigned long, offset_low,ext2_loff_t *,result,
                 unsigned int, origin)
comment out, and do:
static int _llseek (unsigned int fd, unsigned long oh,
                   unsigned long ol, long long *result,
                   unsigned int origin) {
       return syscall (__NR__llseek, fd, oh, ol, result, origin);
}

With any luck, it'll compile, and you can `make install` now. Then, this command is needed, from a developer post on the Netgear forums:
mdadm --create /dev/md2 -f -c 16 -l 5 -p la -n 4 /dev/sdb3 /dev/sdc3 /dev/sdd3 missing

Modify the above to suit your actual system (fdisk -lu to see your drives). Then, if you're unfortunate enough not to have a clean volume, you've a bit more work to do (this is with 250gb drives):
pvscan
  Incorrect metadata area header checksum
  PV /dev/md2                      lvm2 [691.11 GiB]
  Total: 1 [691.11 GiB] / in use: 0 [0   ] / in no VG: 1 [691.11 GiB]

pvdisplay /dev/md2
  Incorrect metadata area header checksum
  "/dev/md2" is a new physical volume of "691.11 GiB"
--- NEW Physical volume ---
  PV Name               /dev/md2
  VG Name            
  PV Size               691.11 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               Epe2Ox-iNYp-T6nY-fD3F-9zag-HWmq-tMs5rq

So, this is the part you shouldn't do unless it's a last resort. (Reference: http://www.tldp.org/HOWTO/LVM-HOWTO/recovermetadata.html)
(volc.txt was created by doing:
dd if=/dev/md2 bs=512 count=255 skip=1 of=nasconfig
and then manually extracting the LVM config with ghex and putting it in a text file (see references at end))


pvcreate --uuid "Epe2Ox-iNYp-T6nY-fD3F-9zag-HWmq-tMs5rq" --restorefile /etc/lvm/archive/c_00000.vg /dev/md2
  Incorrect metadata area header checksum
  Incorrect metadata area header checksum
  Physical volume "/dev/md2" successfully created



vgcfgrestore -f volc.txt c
Restored volume group c

vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "c" using metadata type lvm2

vgdisplay
  --- Volume group ---
  VG Name               c
  System ID             nas-00-xx-xx  1221946398
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                256
  Cur LV                1
  Open LV               0
  Max PV                256
  Cur PV                1
  Act PV                1
  VG Size               691.06 GiB
  PE Size               32.00 MiB
  Total PE              22114
  Alloc PE / Size       22114 / 691.06 GiB
  Free  PE / Size       0 / 0   
  VG UUID               ghNwGu-XNBV-Rnyc-ojT7-D5IE-hRCp-07uygA

vgchange -ay c
  1 logical volume(s) in volume group "c" now active

lvdisplay
  --- Logical volume ---
  LV Name                /dev/c/c
  VG Name                c
  LV UUID                000000-0000-0000-0000-0000-0000-000000
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                691.06 GiB
  Current LE             22114
  Segments               1
  Allocation             normal
  Read ahead sectors     1024
  Block device           252:0


If you're lucky, or sacrificed the requisite virginal nerd while chanting source from the Editor of the Beast, you can now mount and retrieve data, wiser and forever having learned that a NAS device doesn't count as 'backing up'.
Further Reference:
http://www.readynas.com/forum/viewtopic.php?t=14828 - Forum thread on the Netgear forums.
http://www.linuxjournal.com/article/8874?page=0,2 - Format of the LVM metadata; good for creating the .txt file to feed back in.
http://www.akadia.com/services/logical_volume_manager.html - An excellent guide to LVM, with pretty pictures!

2010-03-24

Microsoft programmers need to be shot first.

I finally get the inside joke: Vista is Microsoft's foray into Clockwork Orange type movie-making; except, instead of being entertaining, it simply leaves one with only the homicidal rage.

This sentence shows considerable restraint, and has replaced 20 pages consisting entirely of obscenities.

I've already decided to limit my exposure to Vista/W7 as much as is possible, and am copying off all my data from the Vista system, so I can wipe it and put on a real operating system (it's a toss up between FreeBSD and a linux strain; ashame Haiku is still not an option).

Vista can barely copy.  Removing a directory around 5gb with tens of thousands of files on XP takes nearly no time at all; on Vista, it's still calculating, ('discovering') 5 minutes later.  That's pathetic.

Vista likes to add the current computer name to your credentials for CIFS shares.  That's pretty aggravating; screwing with local security policies 'sort of fixes' it.  Apparently, Microsoft's rightly decided people shackled with its crappy OS are too stupid to properly provide a domain name when required.  Shrug, I got past it.

But, dear reader, this rant is on account of the fact that Vista CAN'T EVEN PROPERLY COPY TO A DEVICE!

Augh!

There's never a good time for your NAS to die, but when you've just filled up almost two terabyte worth of platterverse with valuable data, ... certainly leans towards 'a worse time than most'.

I'm pretty sure my playing with installing silly SCM addons like Git was to blame; no biggie, right?

(Update 2010-03-25: It was a biggie; I lost everything --- my ReadyNAS is one of the Sparc-based ones; I finally coaxed a Ubuntu livecd into compiling ext2fuse so I could deal with the file system that likes 16k page sizes, only to find lvm wouldn't give me any love by finding a valid volume.)

Well, except, my old ReadyNAS doesn't exactly recover gracefully from having its config files manually edited.  No worries, I'll just use the TFPTD recovery method.

Or not.  Well, no worries, then, I'll just yank the CF card out and dump the raw image to it.

Enter The Vista.

Vista CANNOT concurrently copy files!  I'm typing this in 2010.  15 years ago, on a 386, I could copy files to a floppy drive AND a secondary hard drive.  Really!  And... and... just 5 years ago, I could copy files from two optical drives to multiple hard drives, all at the same time... EVEN on Windows XP!

But, here we are, and Vista shits itself ... oh, my, there's my profanity rearing its ugly head again.

I've been backing up what's left on the Vista system to a crappy Maxtor external drive (truly only slightly better than nothing, but since two of the four drives on the Vista system are also dying... gotta shove bits somewhere) and its been at it for some hours.  Trying to copy the firmware for the NAS to its CF kept resulting in errors writing sectors.  The card reader is hooked up to one of the motherboard's usb headers; the external drive is going direct to soldered usb connectors (and not the one in the card reader, nor any other expansion ports <-> headers).

After failing with Sector Edit (from the same guy who wrote Unstoppable Copier --- and which, oddly enough, doesn't keep copying when faced with an error) and even trying to use Hex Workshop's "Open Disk..." tool to try to copy, I gave in and snagged NTRawrite.

It failed.


D:\tmp>NTRawrite.exe
NTRawrite v1.0.1 by Blake Ramsdell


Please type the image pathname: RAIDiator-3.01c1-p6
Please type the diskette drive: M:
Please insert a diskette and press any key.
Copying image file RAIDiator-3.01c1-p6 to floppy drive M.
........................................]
NTRawrite: The request could not be performed because of an I/O device error.

Went through that hoop a few times, until I got a clue, and realized I could just put it on the command line:


D:\tmp>ntrawrite -f RAIDiator-3.01c1-p6 -d M: -n
NTRawrite v1.0.1 by Blake Ramsdell


Copying image file RAIDiator-3.01c1-p6 to floppy drive M.
*****...................................]
NTRawrite: The request could not be performed because of an I/O device error.

If at first you don't succeed, keep trying... (snipped slightly)

D:\tmp>ntrawrite -f RAIDiator-3.01c1-p6 -d M: -n
Copying image file RAIDiator-3.01c1-p6 to floppy drive M.
****....................................]
NTRawrite: The request could not be performed because of an I/O device error.


D:\tmp>ntrawrite -f RAIDiator-3.01c1-p6 -d M: -n
Copying image file RAIDiator-3.01c1-p6 to floppy drive M.
*******************.....................]
NTRawrite: The request could not be performed because of an I/O device error.


D:\tmp>ntrawrite -f RAIDiator-3.01c1-p6 -d M: -n
Copying image file RAIDiator-3.01c1-p6 to floppy drive M.
**......................................]
NTRawrite: The request could not be performed because of an I/O device error.


D:\tmp>ntrawrite -f RAIDiator-3.01c1-p6 -d M: -n
Copying image file RAIDiator-3.01c1-p6 to floppy drive M.
**************..........................]
NTRawrite: The request could not be performed because of an I/O device error.

Good clean fun, especially when one doesn't have any paint to be mesmerized by as it dries.  At this point, logically, I figured it was time to order a new CF card; after all, this one must be corrupted, if nothing can write to it.  But, then... my copy to the external drive finished.  As a ditch effort, I started shutting down all my open windows, in preparation to try a boot disc (Hiren's or a linux livecd, whichever was handier), and figured I'd give it one more go:

D:\tmp>ntrawrite -f RAIDiator-3.01c1-p6 -d M: -n
NTRawrite v1.0.1 by Blake Ramsdell


Copying image file RAIDiator-3.01c1-p6 to floppy drive M.
****************************************]
Verifying image file RAIDiator-3.01c1-p6 with floppy drive M.
****************************************]
Completed!
D:\tmp>

Yup.

Worked without a single hiccup.

System's a core2duo; I'm positive it can handle copying through two usb ports at once. The external drive, of course, is powered with a wall wart, and not via the usb cable.  I have absolutely no explanation for this; while there must certainly be a rational reason involving gremlins and fairy lanes, I'm going with the obvious: Vista's device stack SUCKS.  In the interest of my own piece of mind, I plan on obtaining another CF card, and dd'ing in 'nix while copying to the same external hdd.  I'm betting it'll work without any issues whatsoever, on the exact same hardware.

Data's important.

Eyecandy isn't.

Microsoft's really taken to heart the success of the mediawhore darlings of Hollywood, and crafted their latest OSes to be pretty (debatable) and useless.

I say good riddance; even Apple's running a modified BSD core these days, and Macs have typically been the machines for the absolutely computer illiterate.

Life's too short to waste time with operating systems that can barely copy data.

[This sentence continued the thought about the shortness of life, but my lawyers informed me it entered the realm of 'real threat' and as such, I was forced to remove it.]

2010-03-02

Vista/Windows 7 - Can't Stop Itself From Being Fresh

Here's the scenario:  I've got two folders open, one with sorted folders, and the other one containing over 500 files that need to go into the sorted folders.  Many of the files need minor correcting: say, a file is named SOMEJUNK-And_The_Rest. It needs to be just And_The_Rest.  So, I hit F2, slash off SOMEJUNK and... my file disappears!  It's gone up to the 'A' section of the file list, while my view is still in the 'S' part.  I then need to go to the 'A's, select the file, and move it to the folder with the sorted directories.

This is annoying.  In XP, editing a name left the file where it was, until you hit F5 to refresh the folder, or changed the sort order by clicking on a column name.

Turns out, there's no fix for this behavior in Vista and Windows 7; no setting to revert to not auto-refreshing/auto-arranging Explorer fews.  According to a Microsoft employee:

"Windows Explorer in Windows 7 uses a new custom list view control that doesn't support custom ordering like the old one did. So in folder views you can no longer drag items around to rearrange them. Basically, pretty much nobody used this (except on the desktop, where it is still supported), and re-implementing it in the new virtualized list view wasn't worth the cost.

You can sort the items by any of their properties, such as name, date, etc.

Why do you want to arrange them differently?
"
(source: Brandon Live's post at http://www.neowin.net/forum/topic/813020-rearrange-folders-in-the-user-folder/)

I especially enjoy the last bit; this is a developer on the Windows Desktop team that asserts no one used a feature, and can't fathom why anyone might have wanted it.  Except, a quick google search on terms relating to turning it off reveals quite the opposite: people are butting their heads against this and desperate for a way to turn off this new 'feature'.

Some further digging shows that Microsoft sort of documents this on MSDN:
"By default, the Windows 7 item view does not support custom positioning, custom ordering, or hyperlinks, which were supported in the Windows Vista list view. Use this interface when you require those features of the older view. If, at some later time, the item view adds support for those features, these options will automatically use the newer view rather than continuing to revert to the older view as they currently do."
(source: http://msdn.microsoft.com/en-us/library/dd378351(VS.85).aspx)

So, Vista and Windows 7 both not only get confused and occasionally can't be bothered to refresh media in one's optical drive, but when it comes to folders, there's no way to stop it from refreshing.  There's a very nice explanation from the Classic Shell developer(s) FAQ:
"Can Classic Shell disable the "Auto-arrange" feature in Explorer?
No. The Auto-arrange is not a feature, but rather the absence of the feature to "remember the position of any icon in any folder". As far as I know there is no switch to turn on and the feature has to be implemented from scratch. This is further complicated by the fact that Explorer in Windows 7 uses a new undocumented control "DirectUIHWND" instead of the documented "SysListView32" control like all the versions before it. Most likely when the functionality was moved from the old control to the new, this feature didn't make it.
I understand many people are upset about this (since it worked fine on Vista and before), but I don't believe this can be solved by a shell extension. You have a better chance complaining to Microsoft about it."


I become more disgusted with Vista daily, but there is a work around on it; in a folder where you're working on your files, simply select one and move it 'out of order'.  This prevents Vista from refreshing after every rename --- for that folder, until you close it.  

The long term solution, obviously, is to use a replacement explorer, or, for those adventurous sorts, buy a Mac or run a 'nix and leave the Redmond nightmare behind. 

2010-02-28

Paranoia and Filtility

While trying to figure the reason Vista sometimes can't seem to read optical media, I came across this rather amusing nugget regarding mini-filters, aka file system filters:
"A file system filter driver intercepts requests targeted at a file system or another file system filter driver. By intercepting the request before it reaches its intended target, the filter driver can extend or replace functionality provided by the original target of the request. "
Source: http://www.microsoft.com/whdc/driver/filterdrv/default.mspx

Well, golly, seems sort of scary to me; as if it weren't bad enough having keyboard hooks for any aspiring malware writer to whet their skills with, now Microsoft makes it easy for any skript kiddie to get themselves inserted between me and my data.  

I realize this functionality existed before, but, gosh, it's just so EASY now.  What's eye opening to me, though, is I had no idea about it; it's been around since XP!  

Obviously, the first thing I did after reading about it was to see what was hanging about on my system:
C:\bin\si>fltmc

Filter Name                     Num Instances    Altitude    Frame
------------------------------  -------------  ------------  -----
aswFsBlk                                7       388400         0
PROCMON20                               1       385200         0
aswMonFlt                               9       320700         0
luafv                                   1       135000         0
SbieDrv                                 8        86900         0
FileInfo                                9        45000         0

Huh.  Happily, Microsoft provides a handy reference in the form of an excel spreadsheet for any 'registered' filters: http://www.microsoft.com/whdc/driver/filterdrv/alloc-alt.mspx (File System Minifilter Allocated Altitudes); aswsFsBlk belongs to... Avast.  As does aswMonFlt.  The amusing part is that I only use Avast to scan some large data drops... never for residential shield. (For that matter, I don't use any AV... but I also don't use IE, so... it works.).  It looks like Avast needs its wedge to exist constantly.  This, I think, is the final straw regarding antivirus for me; I'm tossing the lot of them (AVG, Avast, Avira... ) into a vm and scanning from there.

I mean, seriously, why does a program need a filter in place to open and read a file?  When that's ALL I want it to do?  

ProcMON20, of course, is Process Monitor's wedge.  This one makes sense; it needs to monitor all file I/O to show me pretty screens of ACCESS DENIED.  I like that.

luafv, on the other hand, belongs to Microsoft.  This blog post: http://fsfilters.blogspot.com/2010/02/deal-with-luafvsys.html does an excellent job of explaining what it is, and its functionality.  

However, I don't need that; I'm running as Admin, and I want my misbehaving programs to do so with wild abandon!  This one was easy to get rid of; I just had to turn off UAC's virtualization. 

SbieDrv is Sandboxie's wedge. This one's existence makes sense, as well --- except, again, I get annoyed at programs that keep running after I've closed them.  For fun, I wanted to see if I could unload it (since it wasn't running):
C:\bin\si>fltmc unload SbieDrv

Unload failed with error: 0x801f0010
Do not detach the filter from the volume at this time.

Huh; doesn't seem I can.  Certainly there must be some performance penalty, to have every filesystem api call traverse a filter chain, no?  Granted, altitudes decide just what they 'see', but, still... mightn't this be just one more drop in the bucket of what made Vista such a dog?

Moving on, to the last one, we've got FileInfo.  This is simply bloat.  It serves both ReadyBoost and Superfetch: both of which I've disabled.  (This is a decent explanation of it: http://winprogger.com/?p=971)

Despite having them disabled, this filter is still loading, and, presumably, being referenced every time filesystem I/O occurs.

Naturally, I wanted to get rid of it, so, expecting it to behave, I bopped into regedit, and set the service start type to 4... and it still started... which admittedly had me scratching my head.

(DISCLAIMER: Following random advice on the Internet is BAD. Don't do this on your own system.)

So, I took the sledgehammer approach, and simply deleted the service key altogether... and it worked!

As I type this, I get the following Kirsten Dunst Turning Japanese (NSFW) warm and tingly feeling giving result:

C:\>fltmc


No filters loaded


Vunderbar! I can't say it feels faster, but I know my bits appreciate not being fondled quite as much; at least, that's what the voices in my head told me, when I was changing my tinfoil headgear.




2010-02-21

Vista x64 SP1 Doesn't Refresh CD/DVD Drive View (Volume / Directory)

Ah, the frustration of a Microsoft operating system.  This one's got me stumped.

A brief description of the issue:  After ejecting a disc, and putting a new one in, the old directory shows up, and not the one from the newly loaded disc.  This is in Explorer, in a command prompt, and also in FreeCommander.  A procmon watch of Freecommander shows it's calling CreateFile on the drive and getting the old list directly from Windows, and not some cached file.  At least, the caching's not taking place in the userland file manager.  With Imgburn, I can eject and load, have it show stats of the disc (as well as using DVDIdentifier), but Windows Explorer, cmd, and FC all display the stale information.  From some googling, it doesn't look like anyone's found a real solution to this, and it appears to still exist on Windows 7.

The often mentioned fix is:
gpedit.msc
-Local Group Policy
--User Configuration
---Administrative Templates
----Windows Components.
-----Windows Explorer.
Double click on “Remove CD burning features“.
Set the value to “Enabled”

Or, for anyone fixing a system with Home on it:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Create a DWORD, name it NoCDBurning, and put a 1 in it.
The above does fix the issue where Vista sees a UDF disc as blank and wants to format it, but wasn't much use to me.

Another solution which tends to be mentioned is to enable Autorun, which is counterintuitive for those of us who have specifically disabled it.  However, in true Microsoft fashion (and to get a Princess Bride reference in), they tell us, "I do not think that word means what you think it means." and go on to create much confusion.  The following apply to HKLM\SYSTEM\CurrentControlSet\Services\Cdrom and not to Windows Explorer.

http://technet.microsoft.com/en-us/library/cc960238.aspx says AutoRunsAlwaysDisabled "Suppresses the Media Change Notification (MCN) message for particular CD-ROM drives."

http://technet.microsoft.com/en-us/library/cc976182.aspx says Autoruns "Determines whether the system sends a Media Change Notification (MCN) message to the Windows interface when it detects that a CD-ROM is inserted in the drive. The MCN message triggers media-related features, such as Autoplay.
If the MCN message is disabled, the media features that use it do not operate."

This is great, except the official documentation says the upshot of this is, if Media Change Notification isn't enabled, you have to hit F5 or select Refresh to show changes; obviously not the issue here, since hitting F5 or refresh just shows the previous disc directory listing, again.

Am I the only one flabbergasted Vista can't _list the damn contents of a DVD_?! And, this IS Vista (and Windows 7?) specific.  In XP, you might see something almost like this, but deleting the \burn directory would clear it right up.  This also isn't the same issue as Upper and Lower filters by idiotic programs.  This really seems to be some new 'feature' present in cdrom.sys from Vista forward.  The cynic in me would tend to think it has to do with ci.dll (code integrity) and the Protected Environment Authentication crap, but, then again, it could just be some sort of stupidity in the file system parsing code.  

As a point of amusement, leaving an Explorer window open to a share on a NAS... goes blank after an amount of time (files are still there, the view just disappears until it's refreshed).  

My temporary 'solution' (obviously, rebooting fixes this, as everyone knows.  However, rebooting every damn time you want to read a new disc is ludicrous) is to right click on the drive in device manager, Uninstall, select 'no' to the query to reboot now (you'll note the drive's still there, unlike in XP...) and then Scan For Hardware Changes.  This _works_.  Explorer now sees the disc that's actually IN the drive.  Rinse, repeat.
Of note is there doesn't seem any nice (and hence, scriptable) way of doing this using devcon; the drive isn't happy to be restarted or disabled/enabled there, and happily reports its status as running the whole time.

Some info for anyone digging into this:
X64 Vista SP1 Ultimate
i975x chipset 
Drive:
C:\bin\devcon\i386>devcon stack @IDE\CDROM*
IDE\CDROMSONY_DVD_RW_DRU-190A____________________1.65____\5&36E1B51B&0&0.0.0
    Name: SONY DVD RW DRU-190A ATA Device
    Setup Class: {4d36e965-e325-11ce-bfc1-08002be10318} CDROM
    Controlling service:
        cdrom
1 matching device(s) found.

There isn't any third party junkware installed (no sonic, or easycd, or even Nero; no daemontools, or poweriso, etc).  Imgburn is used exclusively to burn.  Services HAVE been trimmed, but nothing that should be related to this have been modified; most are set to 'manual' (remote registry to disabled, etc).  Nothing is odd looking at the service registry entries.

Based on the other posts regarding this issue by people who obviously don't tinker about with their system, I doubt it has to do with anything I've messed with.

So, it begs the question: where is Vista saving this, WHY is Vista saving this, and how does one stop it?

Update #1:  Interesting tidbit; using dskprobe (yes, from the Windows Support Tools for XP2) and the LOGICAL volume, I can happily read 2048 sectors (arbitrarily picked to test) and see the 'real' new disc, despite even Disk Manager showing the stale volume header.  So, the problem must be in the file system driver and caching... 

Update #2: Another quicker solution than the uninstall temporary solution: Using diskmgmt.msc, eject disc, and then (in my case, because computer is actually in another room; gotta dig strings of cables and KVMs) using Imgburn to reload, works: Drive is refreshed.  However, using Imgburn, or Windows Explorer even, to eject, or the button on physical drive, _doesn't_ refresh.  

2010-02-04

For All Your Glowing Rod Of Light Needs...

If you're in the UK, you're no doubt familiar with the experience of being told that "this video is not available in your country" on streaming websites such as Hulu. This is particularly problematic if you're looking for anime shows, versus more shared genres.


Good news, then: AnimeOnUK.tv is back! The webmaster has had the cobwebs dusted off and is bringing the site firmly into the Internet video age, with plans to feature listings of which sites have what, plus breaking news about UK digital distribution of anime.


After all, no one should be without a little bit of Noir.

2010-02-03

Vista x64 All Tasks aka "God Mode"

The recent hype over Windows' "God Mode" likely hasn't done much to put to rest the contention the whole operating system is little more than a rather cheesy game.

http://brandonlive.com/2010/01/04/the-so-called-god-mode/ (of ambiguous officialness by a Microsoft employee) goes into a little bit of detail; but the main point of interest is the general amount of hawing from Microsoft, and the tossing around of how goofy and silly people are for their use of this 'trick'.  Vista, and Windows 7 both illustrate this mentality of giving their users what Microsoft has decided they'll need, rather than what, perhaps, their customers actually want.

Sadly, no one in Redmond seems to be asking what the significance of all this interest being shown by so many less technologically-savvy and historically oblivious users in what should be system errata could mean.

An obvious answer, of course, is by hiding so many system settings and focus grouping ease of configuration into oblivion, users of Microsoft's newer versions of Windows have become so desperate for a way of getting at the options they remember from the older releases that the 'All Tasks' view must indeed seem diety-given.

Whatever the case, it's handy for not having to wade through the sometimes mind-bogglingly unintuitive depths of control panel applets when doing initial system setup by having most of the published settings in a simple list.

After all, as we all learned from random girls throwing themselves off rooftops after being bit by T-virus infected subjects, a little information really can save lives. (I'm not at all insinuating that the Umbrella corporation is in anyway controlled by Microsoft. Please stand the black helicopters down now..)

For those folks privileged enough to be running x64 Vista and would rather not crash their shell (if using Explorer), the following method perhaps will give more joyous results.  Create a shortcut, and use the following command line:
explorer.exe shell:::{ED7BA470-8E54-465E-825C-99712043E01C}


Then, simply pin to start menu and enjoy; a productive citizen is a happy citizen!


Some further reference:
http://www.windowsvalley.com/blog/windows-7-god-mode-behind-the-scenes/

A not so useful list:
http://msdn.microsoft.com/en-us/library/ee330741(VS.85).aspx

2009-07-09

Attempting to Fight Ignorance With Some Dull Light

I've started a blogspot blog to engage in that age old tradition of bashing some twit that Really Needs It™

Here, for reference, is the link which has irritated me and tickled my rant-bone: http://michaelbluejay.com/electricity/computers-questions.html#turnoff

I stumbled there searching for a wattage issue with Seagate drives, and I poked around. Exasperated by the drivel there, I find myself... typing my own!

So, how should one make sense of a line like this?

"Keeping your computer on constantly means it's running three times longer than normal."

Really?

Normal for who?

People who turn on their computers once a week to email with the grandkids?

Or Google's server farm?

I live about an hour's drive from anything; quite normal where I am. Some people are within walking distance of fast food restaurants. Very normal, for them. Pretty subjective.

I bet there are places where it's somewhat abnormal to have deer jump out in front of you while you're driving; not here, where it's not quite so normal if you haven't seen a couple playing at being a kamikaze missle as you try to dodge their attempts to embed a hoof or two into your hood.

Of course, the statements on this fellow's page just get more moronic as he warms up into it. My favorite:

"The computer will become obsolete long before you wear it out, no matter how often you cycle it."

He then defines "obsolete" to mean around two years.

Huh.

I'm typing this on a system I built back in '01.

It's a venerable old ECS K7S5A; I finally maxed out the memory to a single gig a few years ago. (DDR, mind you, though the board itself also can take SDRAM.)

(I've always loved boards that are forward upgradeable; I've still got one capable of using both SDRAM and EDO; I've not yet been able to bring myself to dispose of it.)

Back to this system: I've had to replace the power supply in it, as well as a bad memory module. I also upgraded the Athlon XP 1300+ to one a few revisions higher.

All I use this system for is programming (compiled languages, like C and asm) web browsing (20+ windows open in Chrome right now), and when creating and testing web pages, obviously, Firefox, Opera, and IE are also all open at once.

Then there's Putty, and then there's Paintshop, and let's not forget all those Explorer windows (Yes, sadly, I'm running XP; I had Linux on here back in '02, but it ran so well and fast I felt I was spoiling myself, so I put a Microsoft® OS back on it.) people who actually use their computers tend to attract like langoliers.

Let's see, I also do video capture, and... you get the point.  This brier computer, it be used.

I'm typing this in 2009. I've been using this system over 8 years.

The system next to it is as ancient; a P4 from around '00: One of the reference boards for the 845 chipset.

Then there's my venerable Linux router: a celery 300 overclocked to 450mhz, with 192mb memory... on a FIC motherboard of all things. It's been rock solid since '97 or so. It had a short stint running Win2k back in '98, but we don't like to talk about such things in polite company, or, for that matter, here.  (My Linux system wishes to insert here that the week it had Windows ME on it was, like, TOTALLY groovy.  I didn't know computers could have acid trips, either.)

I do have one newer system; I haven't finished building it yet.  When I do, it'll be my primary box for a good many years, no doubt.

I take great issue with anyone asserting computers are good for a mere 2 years, and then... only if you use them 'normally'.

I'm using a system which, at this point, is literally a decade old and still running great, despite hardly ever being turned off.

It was only a few _weeks_ ago when I finally threw away some 386 boards. I know people who are still doing nothing but browsing the web and emailing their grandkids with Windows 95 on PIIs, and not only are they fine with doing so, but wouldn't know why they'd need anything else.

I realize the author of the above linked FAQ did `tech/troubleshooting` support for Apple;  thus, his ignorance of computer equipment that lasts longer than a few years is quite understandable, as is his apparent inability to grasp this rather simple concept:

It takes a lot of energy and resources to build more computers.

Seriously. I'm not joking; it's a sad fact of our dimension, but computers don't simply materialize when you wish for one.  I speak from first-hand experience, here.

Before Santa and the Easter Bunny bring them to you, someone still has to build them.

Again, building computers take a lot of resources; we have to dig up the raw materials, process them, transport them, manufacture them into something useable (having had to pay people to sit under horrendous flourescent lights to design those useable things), etc. All of which, naturally, takes energy.

Much more energy AND resources than simply using your computer for, say, one more year...

So, dwelling a bit more on the friendly neighborhood ex-Apple Support twit and his "let's focus on REALLY saving energy" drivel, here are my thoughts and responses to his garbage advice:
  • I never turn off my systems. I don't recommend anyone who heavily use their systems do, either.  I'm a fan of hibernate where appropriate, as well built in power management functions of the newer processors, boards, and even peripherals. 
  • I know I'm incurring the wrath of Murphy and his cruddy law by saying this, but the myriad 30gb (ancient!) to 100gb hard drives in the systems I mentioned before are still going strong after all this time and heavy use. (I now have a NAS, with 4x 250gb drives, as well. It doesn't get turned off, either.)
  • I did REAL tech support for years, FIXING computers, not 'troubleshooting them over the phone'. (And that's COMPUTERS, not `Apples`... apparently, Apples can't be fixed, but become obsolete within two years of purchase.) From the thousands of systems I dealt with, the ones that failed the earlist were ones that were cycled down. Granted, some failures were from heat deaths (from having a couple of household pets, or equivalent, in lint/fur, sucked into the chassis) or other weirdness. Most, however, had failing components where the usage model involved being cycled nightly. The most common dead part was the PSU; expensive PSUs can fail somewhat randomly; the cheap ones seem to die if you look at them funny --- turning them on and off is just asking for trouble. Some computer brands, like Emachine, where the motherboard fails because it's made of junk components, shouldn't ever be turned on in the first place, and certainly never turned off, if you do manage to get it to boot. People who buy a $300 system from Walmart shouldn't expect better, if they're realistic.
  • The only 'name brand' systems I own are my laptops. Buying quality parts and building a system means that it'll last many more years than the rebranded crap from places like Dell, HP/Compaq, Acer/Gateway/Emachine, and, apparently, Apple.
  • Buying quality parts and putting together a system which won't be obsolete/dead after two years means you've reduced your carbon footprint and made the earth feel better, as it didn't have to be further raped of resources and energy to aid in your ever waging war of come-uppednance with The Joneses. Isn't that nice?
For people not into the tripe of the previous list, here's a thought: Let's invest in renewable, limitless energy, like wind and solar.

Yes, I know: it's too expensive to do this right now.

Yes, I know, there are still a lot of issues to be resolved.

However, until the Sun supernovas, we can happily use as much solar energy as we want from it, and, until our Earth's rotation is retarded by whatever Hollywood disaster du jour wins out for the job, we can harness wind, as well.

Because, really, the solution isn't to use LESS energy; the solution is to make it so we mass consumers can have more, affordable energy.

And, of course, to perhaps buy more reliable computers.

Lastly, I wanted to address this particular FAQ answer:

"Any energy use has to be weighed against the benefit we expect to get from it. Personally, I don't feel the alleged gains from distributed computing projects are worth the energy it requires and the pollution it creates. Take a look at the projects: One involves searching for extraterrestrial life. Of course it would be kind of ironic if we actually found some aliens and our contact with them was necessarily brief because climate change wiped out life on our planet shortly after we found them."

Alleged gains, huh? As for finding aliens -- they're not so much lost as most likely hiding from idiots who'd want to make them turn off their spaceships to conserve energy.

Disregarding the very real results of password cracking with distributed computing, frankly, just because you don't choose to look for intelligent life somewhere in the universe, or find folding proteins or curing cancer useful, doesn't mean that other people can't waste the energy they're paying for as they see fit, whether there are any 'actual' gains from doing so or not.

I know fighting on the interwebs is quite akin to competing in the special olympics (no offense, if you happen to be a contender...), but I have a real problem with someone pushing their agenda on neophyte computer users who really might not know better: it's okay to leave their system on -- they could seriously shorten their computer's useful life by following the advice of some wannabe ex-Apple support troubleshooter with a god-complex regarding everyone else's power usage.

Well! I do feel rather better, after this rant.

I've done did my part, a'fighting the good fight, against the ignorance and doubleplus ungood untruths from the drooling fruit-damaged troglodytes, with their disposable systems and crazy, red eyed stares glaring at my rolling power meter with hostile reproach.

Remember, kids, don't believe everything you read on the interwebs.  If you ever want to talk about computer reliability in the real world, and don't know any hackers (or are scared of their fascination with trains), then simply find yourself an active COBOL programmer supporting a 70's era metal hulk gathering dust in your bank's basement.  If you can wake the fellow up, he'll fill you with some Truth™ -- but only if you trounce not upon his punchcards.

2007-05-01

K7S5A Back From The Dead

My little ECS K7S5A has been a rock solid little board all these years. It's getting to be a bit long in the caps, at almost 6 years old, but it's been good to me.

Until, of course, for reasons apparent to many of you reading this, I needed to edit the DMI info. One toasted board, served on a nice bed of silicon.

For other folks who manage to get to this point (and there are some, since I looked about for a solution for my problem and didn't find one), here's the answer for resuscitation.

Symptoms:
On POST, wicked green screen with pink and yellow streaks --- hit TAB key. Enjoy your normal POST view until you get:
DMA Error
System Halted

Quake in fear. At this point, setting the clear CMOS won't work, nor removing the CMOS battery. Yanking out the nice little winbond chip doesn't do much either. If you have a way of hot flashing, you might be shiny at this point, but, then, who wants to troll e-bay in the hope there's a broken one somewhere that you can cannibalize? Whatever; no point in waiting, either.

Make your AMIBOOT.ROM floppy as usual (you DID keep a non-USB floppy around somewhere, right?) and pop it in the system. Turn system on.

With a flatblade screwdriver and a steady hand, short out pins 30 and 31 (A17 and #WE) on your DIP winbond chip. (If you've got the other kind, sorry, no idea if this'll fly --- it still might). (Note: You can probably use other pins as well --- the goal here is to screw things up enough that the BIOS decides it needs to invoke the boot block).

System should beep once, with no display, and floppy drive should start reading. You're not out of the woods at this point; go ahead and stop shorting the pins, and wait a minute or two.

Now, power off system, hold CTRL-HOME, power on system. Floppy drive should be reading, and you can release keys. Listen for the 3 beeps, wait until floppy drive is done, and watch system become useable again.

Woot.

I can't take credit for this solution. A far smarter relation suggested it on the phone, and, I might add, had a little disappointment in his voice when he assured me I wouldn't electrocute myself.

This trick may works for other motherboards that have a boot block that isn't modified during a flash.

For info on the flash chip in the k7s5a, google-fu for the win: w49f002u.pdf.

(This was originally posted on my now defunct Myspace blog.)