Monday, July 27, 2009

Automatically attach Windows formatted partitions on booting Ubuntu

As the title say, I consider in this how-to attach windows formatted partitions (FAT32, NTFS ..), it would be a very close procedures to attach other formats.
  1. Step One: Determine Which partition do you want to mount automatically.
    You have to know your target partition's Linux name, which differs from partitions' labels (those names given to partitions in Windows like "Sources", "Entertainment" ..).
    • Installing a suitable Disk-Scanner is a good idea to give you good information about your disk if you don't already know, I suggest gparted
      sudo apt-get gparted
    • Once installed, run it
      sudo gparted
      to see something like:


      now determine which partition you'd like to attach, and know its name (the column at the most left with heading "Partition"), I'll assume it is [my_part]
  2. Step Two: Determine Where to attach the target partition
    Lets assume you want attach the partition in the directory [my_dir], you have to create the directory
    sudo mkdir [my_dir]
  3. Step 3: Tell Ubuntu to attach Partition[Step 1] in Directory[Step 2]
    • Open the file /etc/fstab as root
      gksudo gedit /etc/fstab
    • Add the line
      [my_part] [my_dir] vfat auto,users,uid=1000,gid=100,utf8,dmask=027,fmask=1 37 0 0
      And dont forget to
      • Replace [my_part] with your partition (got from step 1)
      • Replace [my_dir] with your directory (got from step 2)
      • Replace "vfat" (which is for FAT32 partitions) with ntfs for NTFS partitions
    • Save and close /etc/fstab
  4. Step Four: Try attaching new entries in the /etc/fstab
  5. , by typing
    sudo mount -a

Enjoy ..

Friday, July 10, 2009

Open Command Prompt here

Opening the command prompt/shell interpreter in a specific is handy, and is very common to much many people.
I'll be talking in this post about how to do it in three different platforms.

First Windows Vista

Recently I shared an article that shows how to do it in Vista, which is not more difficult than just holding another button before hitting mouse's right one.

Second Debian based systems

It is also as simple here as installing any other program, here is a How - to which illustrate the operations.
At the end an additional option is added to the right click.

By clicking it, the terminal should be opened in the specified directory (in my case the desktop):


Third Windows XP

Operations here are a bit more tricky, I'll go in some details:
  1. Open Control Panel => Tools Menu => Folder Options => File Types Tab
  2. Select the "File folder" file type.
  3. Click the "Advanced" button.
  4. Click New (to add new action).
  5. Enter action's name, which will be some thing like "Open Command prompt here".
  6. Enter
    cmd.exe /k cd "%L"
    against the "Application used to perform action".
    Menu state should end up to something like:


  7. Press OK, OK.
Good, but it is not the end.
We need now to assure that folders behave normally, i.e. The default action of the folder file type is to be opened by windows explorer.

  1. Press Start => Run
  2. Write
    Regedt32.exe
    and hit enter.
  3. Open HKEY_CLASSES_ROOT/Directory/Shell
  4. From the Edit list choose the name (Default).
  5. Edit Menu => Modify



  6. Enter None and hit OK.


Right click any folder now and note the new action: