Geeks With Blogs
.NET Corner Jeans, .NET and Physics (eka The Quantum Boy)


In a nice sunday afternoon I opened a MC++ sorry oldy MFC project in VS.NET.So far so good. Now i was going to insert a merely innocent breakpoint before firing the program. Mouse cursor changes to hourglass changes to infamous BSOD(Blue Screen Of Death for Windows). I ignored the memory dump and rebooted but Windows XP was unable to start. It seems some boot information table or partition table might have been corrupted in the process. Sad but inevitable in a developer's life.But I hade some serious unbacked-up data(Always be a good child and regularly backup your critical data) on the disk. Hope it could be retrieved. The entire evening I tried to restore the data using my liable Knoppix(Get the latest here) distribution.But I got stuck to a single point. How to transfer files to USB devices(pen-drive /hard-drive) from knoppix(knoppix is happily detecting windows partitions - hda1,hda2...) The next day(A gloomy monday) I handed the laptop(I forgot it was a nice VAIO laptop with 3.4 GHz,2 GB RAM) to PSS(to which it belongs) lab people. The PSS support attendee was a dumb one(real jerk grrrr...) and had no honest intention to help me out. Even he was sensitive about knoppix (I gave him the idea) in a Microsoft world.This is the kind-of-a-guy for which Bill-And-Co is cursed in GNU/GPL and 'Ux world. If a linux distribution can detect windows partitions and data could be recovered what's the problem? Microsoft implements .NET for FreeBSD (Which is a Unix variation), Mono.NET is roaring, Rotor(see my earlier post: Compiling The CLR) is rotating fast enough. Some people (and read some redundant people living inside The Giant also) are so shaky about new tricks/hacks that they will resist the light that wants to come in! So I patted myself and told something positive should be there in an otherwise negative condition.Let's practise some dark art - Linux at Microsoft. It seems that my knoppix had become aged v3.7 instead of the current v5.3.1. But I didn't want to download the ISO, burn and then start the rescue process. V3.7 got to support USB storage devices.I tried to mount the device's filesystem to a pre-created mount point namely(/mnt/usb)

[knoppix-root#] mount -t usbdevfs /dev/s.. /mnt/usb

Wait a minute. Is the device's name correct.I later found out how to figure out device names that are plugged/hot-plugged(USB stuff) into the system. The magic command is dmesg

[knoppix-root#] dmesg

Lots of dump. Lets apply a grep sd on that to search for usb devices(which are basically used SCSI emulation devices).

[knoppix-root#] dmesg | grep sd
----========================== --
--========================== :sda at sda1.. etc

But what should be the file system. I watched earlier in XP that it was FAT32. Must be. Linux can work with FAT32 and other 80 different file systems. In linux world FAT32 is known as vfat

[knoppix-root#] mount -t vfat /dev/sda1 /mnt/usb

No error! Hurray. Let's copy. Alas.."readonly filesystem". It seems that file-system that I mounted to /mnt/usb is readonly. But just how? After some sweating hours in front of Google(lazy programmers' guide) I found the culprit. The fstab (File System Table) has to be edited with proper user permission(as a part of linux security enforcement). The file is in /etc/ folder. But in knoppix /etc is readonly in normal shell.So /etc/fstab has to be copied to writable ramdisk(wonderful concept for On-CD linux) at /home/knoppix and edited.

[fstab entry] /dev/sda1 /mnt/usb vfat noauto,users,exec,rw 0 0

By root console I copied it back to /etc/fstab and start restoring my data. Red light in the drive is glowing...The world is not enough.... 

Re: Beg your pardon for putting this linux post in a .NET world. But I think it is excusable. Posted on Saturday, November 8, 2008 4:08 AM .NET Core , Scientific Geekology , lab.geek.com | Back to top


Comments on this post: The BSOD Factor

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © dbose | Powered by: GeeksWithBlogs.net