Wednesday, December 17, 2008

Of Flash drives and Windows XP...Part II

Part I can be found here.

This part contains the workarounds !

How to fool Windows into thinking that the removable drive is a local disk :

This solution has been copied from here

I am posting the solution here too, just because its difficult to find the solution on that page :P.

Nearly all USB flash drives pretend to have a removable media (even it's a lie), so Windows detects them as 'removable'. On drives with a removable media Windows 2000 and higher supports only one partition.
Finally it's a single bit in the device's device descriptor, the removable media bit (RMB). If you take away the RMB then Windows sees the drive as 'local disk' and multiple partitions work.
The Removable Media Bit can be changed either in the drive's hardware or by a Windows filter driver.
Changing in the hardware works with some flash drives by means of the tool Lexar BootIt.

But this works only with some pen-drvies. It DID NOT work for me.

The second way to do this ...

A filter driver for removing the RMB has been made by Hitachi for their Microdrives (Compatct Flash cards with a mini harddrive):

xpfildrvr1224_320.zip

By modifying the included INF file the filter driver can be used with any other 'removable' drive.
For the device detection there are the lines in section [cfadisk_device]:

[cfadisk_device]
%Microdrive_devdesc% = cfadisk_install,IDE\DiskIBM-DSCM-11000__________________________SC2IC801

"IDE\DiskIBM-DSCM-11000__________________________SC2IC801" is the device ID of one of the supported Microdrives.

In analogy to these lines we add one line for each 'removable' USB drive we want to turn into an USB hard drive. The ID is found in the Windows device management: Expand 'Disk drives', right click your USB drive, select Properties. On the tab "Details" under XP the item "Device instance ID" is already selected. Click on the ID in the List and press Ctrl+C, this copies the ID into the Windows Clipboard and can be pasted somewhere else with Ctrl+V.
XP shows the tab "Details" only when the environment variable DEVMGR_SHOW_DETAILS=1 is set:
DevMgr_Show_1.reg download and doubleclick the file, then relogon to take effect.

Sample:
USBSTOR\DISK&VEN_LEXAR&PROD_JUMPDRIVE&REV_1.30\K326441127040&0
We need the fat part:

[cfadisk_device]
%Microdrive_devdesc% = cfadisk_install,USBSTOR\DISK&VEN_LEXAR&PROD_JUMPDRIVE&REV_1.30

In the last line of the INF file we change "Hitachi Microdrive" into something nice as "RemovableToFixed".

In the device manager again right-click the USB drive, "Update driver...", then "No, not this time" -> Next -> "Install from a list or..." -> Next -> "Don't search." -> Next -> "Have Disk" -> browse to the INF file here. Now "RemovableToFixed" should be in the list -> Next -> Confirm the two warnings -> Finish.
Now the drive is re-detected, actually as USB hard drive. The drive can be partitioned, and all the existing partitions are visible and usable.

Now, this solution works with all the USB flash drives. But the problem is that since this method requires installing a custom driver, the pen-drive is detected as a local disk only on the machine that uses that driver. All the other machines detect it as a removable drive. This essentially defeats the purpose of using a pen-drive !!

Re-arrangement of partitions :

This hasn't been copied from anywhere :P.

What i realized was that only the 1st physical partition was being assigned a letter. So i re-arranged the partitions within the flash drive as follows :

1) 2111 MB NTFS (for general use)
2)1024 MB ext2 ( for persistence)
3)700 MB FAT32, bootable.

This made the NTFS partition visible from Windows and i could use my flash drive as if it were a ~2 GB pen-drive.

Looking back, I actually liked this solution, since, whenever I use my pen-drive in the college, the viruses wont be able to mess up the FAT32 bootable partition ! and when I use Linux, all 3 partitions are being mounted anyway. The flip side was that sharing data between the partitions was impossible with Windows XP.....

So as it turned out, there is no concrete solution to using Flash drives with multiple partitions with Windows XP....just some workarounds, each with its pros and cons....

So what do you do if you wanna use a Flash drive with multiple partitions ? .....Use Linux :-)

Of Flash drives and Windows XP...Part I

As mentioned here, I faced quite an annoying problem when i created multiple partitions on my USB flash drive.

The layout of the Flash drive was as follows :

1)720 MB partition, FAT32, bootable
2)1024 MB partition ext2 (for persistence)
3)2111 MB parition, NTFS (for general use)

Now, the problem was that when the Flash drive was inserted when Windows XP was running, only 1 partition was being assigned a letter by Windows. The remaining partitions were visible from the Disk Management Tool, but were not being assigned a letter and as a result were rendered useless.
Any attempt to assign a letter to the drives resulted in the following error :
"The partition is not enabled. To enable the partition re-start the computer."

Restarting the computer does not help and the same error is displayed.
Now this was annoying, because the partition that was being assigned a letter was the 720 MB one, which was already filled up.

This problem is absent in Ubuntu. All the 3 partitions are detected and are usable. This problem is confirmed by Microsoft as a feature (lol :P).Only the first partition on the USB Flash drive is assigned a letter and is usable.

There are a couple of workarounds for this ....one is to fool Windows into thinking that the removable drive is a local disk. The other one involves rearrangement of partitions.

Workarounds can be found here.

Of Live USBs and MBRs

Determined to put my 4 GB flash drive to good use, i decided to create a Live USB disk of the Interpid Ibex on it.

Now, Ubuntu 8.10 comes with this neat "Live USB disk creator" tool, which makes it extremely easy to create a live disk.But on my friend Chinmay's blog, i read that this tool doesn't make the USB stick persistent. So, without trying it out myself, i headed here. Now this page describes how to install Ubuntu 8.10 on the USB stick.

After following all the steps mentioned there, i was unable to boot through my USB stick. It displayed some garbage on the screen and i was forced to restart the computer.

So now, I tried the Live USB creator tool, which led to the same problem as well !. One probable source of this kind of error can be a corrupted MBR. So i tried writing a MBR to the disk using lilo.

#lilo -M /dev/sdX

where, X is the letter assigned to the drive, which can be found out by doing a #fdisk -l .

And, as it turned out, this was the problem. Now, I was able to boot through my USB stick and everything seemed just fine. All the settings and documents were persistent. I again, formatted the USB stick and used the tool provided with the Intrepid, and surprisingly the settings and documents were persistent here too !. So Chinmay's might be an isolated problem....or mine an isolated success :P .

The major difference that i found out between the two methods was that the creator tool does not create separate physical partitions on the stick. It instead creates a file on the stick and uses it for persistent settings. On the other hand, the manual method creates a separate partition for keeping the settings persistent.

Now, my USB stick was ready ! ....well not exactly.....i faced quite an annoying problem in Windows while using this USB stick.

Since I'm running out of time, I will post the problem and some workarounds that I found out later.

Stay tuned :-D


Saturday, December 13, 2008

Problem with user Privileges and Roles in OpenSolaris

Had tried out Open Solaris a few months ago...and straightaway faced a numerous problems :P ...

The most annoying was that the user privileges were getting reset on every login.
So here i am posting how i worked around this problem.

As I said,

The user privileges of my user were getting reset on every login and now, the GUI had started throwing a strange error...when i started the user admin tool ( Users and Groups ), it asked me for authorization, when i provided the root password, it simply rejected it.

The funny part is, that i can "su" root using the same password through the terminal !! (This is ofcourse after i "su" the Primary Administrator) .

So, i was forced to work with the CLI, i tried using the "usermod" command, but I did not understand clearly the way it is supposed to be used, so gave up on that too.


Next, i opened the /etc/user_attr file .

/****************
/etc/user_attr snippet :

root::::type=role;auths=solaris.*,solaris.grant;profiles=All;lock_afte r_retries=no;min_label=admin_low;clearance=admin_high
aditya::::profiles=Prim ary Administrator;roles=root

#amod::::profiles=Apache 22 Administration,Application Server Management,Audit Control,Audit Review,Basic Actions,Console #User,Contract Observer,Cron Management,Crypto Management,DAT Administration,D-BUS Management,Desktop Configuration,Device #Management,Device Security,DHCP Management,dtwm,File System Management,File System Security,FTP Management,HAL #Management,Idmap Name Mapping Management,Idmap Service Management,Inetd Management,Information Security,IP Filter #Management,ISCSI Target Administration,ISCSI Target Management,ISNS Server Management,Kerberos Client Management,Kerberos #Server Management,Log Management,Mail Management,Maintenance and Repair,Media Backup,Media Restore,MySQL #Administration,Name Service Management,Name Service Security,NDMP Management,Network IPsec Management,Network Link #Security,Network Management,Network Security,Network Wifi Management,Network Wifi Security,Object Access #Management,Object Label Management,Operator,Outside Accred,Postgres Administration,Primary Administrator,Printer #Management,Process Management,Project Management,Rights Delegation,Rmvolmgr Management,Service Management,Service #Operator,shutdown,SMBFS Management,SMB Management,Software Installation,System Administrator,System Event Management,User #Management,User Security,VSCAN Management,Web Console Management,ZFS File System Management,ZFS Storage Management,Zone #Management;

amod::::auths=solaris.*,solaris.grant;profiles=All;roles=root

/***** ***************end of snippet

(all the lines of amod (second from last) have been commented, they might not show up properly...formatting problems)

so as u can see, my user (amod) had all the privileges, but they weren't showing up in the GUI ! (bug ?). And now i understood why i couldn't "su" root... i had no "roles" defined. I have no idea of how to set roles through the GUI or the CLI, so instead i just copied "root's" line and made some changes :P

So now, my problem is solved, i can su root directly from amod and do everything i want (heck ! im _almost_ root now :D ).

But, the problem of the GUI not showing the privileges still persists.

I had posted this workaround on the Pune Open Solaris User Group's forums and was suggested that I post it on the Open Solaris desktop-discuss forums. The post on the desktop-discuss forums can be found here. The same problem has been confirmed by 3 users there.
So, until an update for the GUI, which allows roles to be defined is released, the above workaround works just fine :-)

EDIT:
You can also assign roles to a user using the "usermod" command with a "-r" option. I did not know this then. This, again, can be done only by the Primary Admin, if no other users have "root" role defined.

Thursday, October 23, 2008

Err....

Saw the dates for practical exam yesterday and i made a choice between Fifa '09 and Proakis...

I opened my Proakis and five minutes later....closed it.......WTH !! i can't understand a word !!!

Wondering wats gonna happen, i had a vision ...(a la Vincent Kennedy McMohan moment )...

Follow these steps and 80% is guaranteed. Read on.

Before we start, here's one instruction -> Be slow, don't rush through it. Read each word carefully and follow each step !!
All set.

Now, firstly,

look down and look up .......good u r a in a state of mind where u'll do/believe everything i say :P

1) Clap your hands 3 times on a desk, 2 times with the right hand, once with the left. If you're a leftie, reverse it. If you're ambidextrous, clap 2 times with both the hands.

2) Jump 7 times without bending your knees.

3) Look down and look up. If u did it again....man u're really desparate :P...if not, see !! u're already getting smarter ...Read on....

4) Spin around 3 and a half times.

5) Say "asjdhfasdklfwmasiuwehjawergydaszmxbczxjhg" BACKWARDS !

Now, the last step....laugh at urself for being such a dumba** to read thru this crap....hehehe...

And Lo ! u're there...if u could do all the things said above, 80% is guaranteed !!

Well, i cudn't do all the steps ......so i made a choice ....between Fifa '09 and my Proakis......

AC Milan v/s Chelsea ...6-0. Peace !! :-)

PS : This is purely a work of imagination. Any resemblance to living or dead is just a result of ur twisted perception :-)

Saturday, August 9, 2008

Owned !!

ROTFLMAO !!

Check this out - >Game Over !!

Friday, August 8, 2008

WTH just happened ?

I turned on my computer and it popped a message "BIOS Checksum Error. Starting recovery ...".
It started searching my floppy drive( non-existent :P ) and the Cd-Drive for the BIOS ROM.
Fortunately, I had the support CD at hand and quickly pushed it into the CD-Drive.

Up came the message :

"M2N-MX.ROM detected
Starting Erasing...|
Starting programming ....| "


Then the mobo beeped twice-thrice and the computer restarted. And, the BIOS checksum error message popped again !! WTH !! i just saw it getting flashed !!

Happened 2 times in a row....frustrated, i decided to take out the mobo manual (dunno why i didn't take it out earlier ... :P)

It had 2 full pages regarding BIOS recovery... one way was to press Alt+ F2 before POST to start ASUS' "EZ Flash Utility " that would apparently help me flash my BIOS.

Computer restarted. I pressed Alt+F2.
The utility started and searched my Cd-Drive for a BIOS file.
Up came the message "M2N-MX.ROM detected"
and immedialtely followed by "Error ! the ROM file is outdated and cannot work with the hardware "
WTF !! This is the BIOS that came in the manufacturer's CD !!

I was starting to freak out... Fired up my old machine and downloaded the LATEST BIOS for my mobo, bought a CD and burned it onto the disk.

Computer restarted.
Up came the message:
"M2N-MX.ROM not detected !"


huh?...Sigh, the file i had downloaded had a different name ....fine, i'll just have to rename it and burn it again....I removed the Cd from the drive and instead of pushing the "power-off" button, accidentally, pushed the "restart button"...

My BIOS was detected !!

"There is a CMOS checksum error :
Press F1 to start recovery
Press F2 to reset to default settings and continue "
?_?

F2 pressed.
The screen went blank and up came the familiar message
"GRUB Loading stage 1.5. "


Wheeeee !! problem solved !!
But WTH just happened ??? The computer was running fine until yesterday ...
My guess is a faulty SMPS which isn't providing the required current at the required voltage to the mobo....
Any pointers ?

Tuesday, June 17, 2008

TrackManiac !!




Ahh ! Writing after many days...this post is guaranteed to be scratchy :P

After playing TrackMania Nations , I just had to try this newest version of TrackMania, The TrackMania Forever !!
For those who don't know what TrackMania is, here's the wiki topic link : http://en.wikipedia.org/wiki/Trackmania

The official website is : http://www.trackmania.com
The setup can be downloaded from the their site. This game is free to download and free to play :D

TrackMania Forever was released on 17-18 April, 2008 ( when the PL had just started :D ) and it has around 1 million ( 980k , to be precise) registered online players.The Indian community is not-so-strong with just around 2,500 odd players....i'm currently ranked 254th among the 2.5k players :D
TMForever lets you choose between online and offline play...i just love games which have both online and offline modes :).
TrackMania in the offline (Solo) mode offers campaigns.The campaigns have been changed significantly. Their difficulty is now reflected by colors (White - easiest, Green, Blue, Red, Black - hardest), and progression to harder tracks is limited by requiring you to finish the previous track(s) with some medal first: You need bronze medal to proceed to next track in Green difficulty, silver for Blue, and gold medal in Red. The black tracks only unlock after you gain gold on ALL the previous tracks.Nice practice before you jump onto the online community :-)

There are basically 2 types of tracks...Dirt tracks and Stadium tracks.There are more stadium tracks than dirt ones, but both the types are equally engaging.
A stadium track :


Dirt track :




Online Action :



Online mode lets you choose different servers from around the world. What I liked most is that it also provides a list of recommended servers, where the average player ranking is close to yours...
Winning races or finishing in the top 5 ,gives LP points, which is the basis for the rankings.
Online mode is madly addictive ( though MMORPGs are more addictive :P).
The only downside to the Online play is that, in India, where bandwidth is metered, online play can cost quite a lot of "MBs" ( thats the reason why i love MMORPGs :P).


The more thing that I haven't touched yet is the track editor ....which as the name suggests lets you edit tracks or create new ones !

If you haven't played Trackmania yet, then this the game to start with.If you have been playing since the United version, this version really doesn't add much ( I read this on some other review :P).

For : Good graphics, Addictive gameplay, Offline and Online modes, Track editor ,Its FREE !!
Against : May cost you lots of "MBs" during online play.
Rating : 9.5/10
(- 0.5 less coz it really uses up too much "MBs" :-( )

Friday, April 25, 2008

Hardy Heron is finally out !!

The Heron is finally out, and i can't wait to install it on my box.
Wait, why haven't i installed it yet ? Because i have an earlier installation of Gutsy, and I downloaded the Live CD instead of the Alternate CD (sad)...so i'll have to wait one more day and my exams are around the corner so I won't be able to tinker much...

Anyway, I did run the Live CD for about 10-15 minutes and though i didn't look around much, the first thing that came to my notice was the booting time....it booted in around a minute from the Live CD ,thats fast compared to the Gutsy Gibbon.
The next thing that pleased me instantly was the native resolution of my monitor was detected flawlessly....something that didn't happen in either Gutsy Gibbon or Fedora 8...
also,
Internet was configured within 60 seconds...typical of Ubuntu...
and the wallpaper is awesome.

But one thing was amiss, I remember reading that Ubuntu was going to do away with the human theme in the Hardy Heron, but the default theme still happens to be the human theme.......whether the idea was dropped, i know not....but i was really excited to see a new theme.

Overall the first impression was that the Heron does seem to be an improvement over 7.10,

More later.

Cheers !

Monday, March 24, 2008

The Real reason why we use linux....

the REAL reason why we use Linux....

Why we use Linux

I found the article and the subsequent comments really interesting....

Dev-C++ under Vista

For those having trouble using Dev-C++ under vista, follow THIS

It fixed my " source file not compiled " error ...

-cheers

Sunday, March 23, 2008

graphics.h without Turbo C/C++

hmm.........this first post took a long time coming..... :-D

I personally hate using the Turbo C/C++ compiler, no, its not a bad compiler, but its well past its sell-by date. It was one the best compilers earlier, not anymore....

When using Linux I obviously use the gcc.
When using Windows, i use the Dev-C ++ IDE.

Many people ( mostly 2nd year comp. engg. students from Pune University :P) complain that one cannot use the "graphics.h" with any other IDE, well, u can..just follow these steps..

1. Get Dev-C ++

2. Install Dev-C++ ( i usually prefer following the default install path in case of compilers ).

3. Get the "graphics.h" and the "libbgi.a" files from Here ....credit for these files goes to Michael Serrano.

Note: Copying the files from the Turbo C directory may not work ( i haven't tried it ..).

4. Copy the "grahpics.h" files to : C:\Dev-Cpp\include
and the "libbgi.a" file to : C:\Dev-Cpp\lib

Note : Your paths might be different, please check where Dev-C++ is installed on your system.

5.Start Dev-C++ . now Tools-->Compiler Options

6.Tick the "Add these commands to the linker...." and within the box , paste the following line :

-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32

This tells your linker what all extra libraries it should link....

Now its all done, enjoy the Turbo C++ graphics library on Dev- C++


Note: This is not the only place where you will find such a tutorial...i haven't devised this method, only the linker part is mine :-)

Saturday, March 22, 2008

Coming soon :)

More coming soon .....