How to automount my Windows partition at boot?

I have a dual boot Windows 7, Ubuntu 11.10 system. Ubuntu was pretty much a vanilla installation and it was able to automount my two Win partitions.

I used to see them in Nautilus. To recover this problem I manipulated the /etc/fstab which is operated under roots and that I am not able to unmount from Nautilus as Admin (unless I sudo from terminal)

How can I restore the original behavior (from my admin non-root account)? Thank you


Solution 1:

The visual way

(if you are using version Ubuntu 12.10 Quantal Quetza or higher)

Make sure the drive/partition you would like to attach is attached to your system and is turned on.

This guide is referenced from here.


Click on the "Dash" icon on your Unity taskbar (Ubuntu icon) and enter:

disks

Click on "Disks" to open up the program.

Once opened, on its main window, "Disks" graphically shows you your current partition layout.

Now simply choose the NTFS partition that you want to automatically mount on boot, then click on the small gears icon slightly below it. From the menu choose:

‘Edit Mount Options…’

From the next window that is shown, move the slider button to the left, next to the ‘Automatic Mount Options’ label, to gain access to the settings.

Keep the check-marked option ‘Mount at startup’.

Select/Fill the next four options if you wish. "Display Name" is a handy visual aid in Nautilus (file manager).

If you wish to have the drive as read-only

Add...

,ro

...to the end of the field that says "nosuid,nodev,nofail,x-gvfs-show" (without a space).

Once done, click on the ‘OK’ button at the bottom. When asked, enter your administrative password.

If you have more than one NTFS partition, then follow the same steps for each one individually.

Restart your computer and enjoy!

Solution 2:

The command-line way

Make sure the drive/partition you would like to attach is attached to your system and is turned on.

This guide is taken from here (it is for 12.04, but should work for other versions of Ubuntu) and bits from here.


Press Ctrl + Alt + T on your keyboard to open Terminal and type:

sudo blkid

This will list the drives on your system, with handle labels, where available.

Take note of the UUID of the drive you wish to automatically mount.

Now the "fstab" file needs editing:

sudo gedit /etc/fstab

OR

sudo nano /etc/fstab

Add this line to the bottom of the file, replacing the UUID with your noted UUID and choose a mount point name (the space character is created by using "\040" in the fstab):

UUID=xxxxxxxxxxx /mnt/Your\040Chosen\040Name ntfs-3g defaults,windows_names,locale=en_US.utf8  0 0

Also replace the local to one suitable for your location and language if you are not in the USA. You can find your locale by typing in the terminal:

locale

The "ntfs-3g" (a Kernel module) is a lower level software tool in almost all GNU/Linux distributions.

Save the file and close it.

Now type this into the terminal:

sudo mkdir "/mnt/Your Chosen Name"

Next, make yourself the owner of the mount point by typing:

sudo chown <username> "/mnt/Your Chosen Name"

Replacing with your username (your username is always lower-case). This will prevent other users from touching it.

Restart your computer and enjoy!

Solution 3:

Try this program.

sudo apt-get install pysdm
sudo pysdm

This will help you configure your drives that are mounted at startup.

In the program, select your windows partition. When it asks you to configure, click 'Ok'. Then click on the assistant. It's pretty clear from there.