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 ..

2 comments:

  1. What About if I Hibernate the Windows ...

    Is it Work Properly ?!!
    i.e. Does it will be mounted or an error will be flagged ? ..

    ReplyDelete
  2. Yes, it does, I tried it and with no errors

    ReplyDelete