I've observed that in order for other programs (i.e. Partition) to access files from Windows partitions (I have dualboot with Windows7 and Ubuntu 16.04) I need to first open that partition manually.
Is there a way to stop doing that and let my programs find files from other partition directly?
Taken from: MountingWindowsPartitions
Preface
If you require one or more of your Windows partitions mounted automatically during bootup, it is necessary to add one line to the file /etc/fstab for each partition that is to be mounted. Some reasons for mounting partitions by means of /etc/fstab, rather than relying on the file manager, include:
Convenience.
Where more than one user account is in use during a session. Partitions mounted from one user account by means of the file manager are not accessible to the other account(s).
Where libraries have been set up in applications such as Banshee or Rhythmbox (for music) or Shotwell (for photos). If those libraries contain files on partitions mounted by means of the file manager, an error will occur in a subsequent session if the partition is not mounted first.
Where more advanced or special mount options are needed. Three working configurations for different needs are given below, but anything more advanced is beyond the scope of this wiki page. The NTFS-3G manual gives a list of mount options suitable for NTFS filesystems. Automatic Configuration
Although there are a number of GUI applications available from the Ubuntu Software Centre, none of these can be recommended at the time of this writing, unfortunately. They are obsolete and unmaintained and can all cause problems. Two examples are ntfs-config and PySDM. (PySDM is no longer in the repository with effect from 12.10.) If you find a recommendation anywhere for either of these applications, it is likely to be an old one, and should not be followed. At this time it is advisable to configure /etc/fstab manually.
Manual Configuration
First, you need to find the device locations of the partition(s) you wish to mount. Open a terminal and run:
For illustration purposes, an example output from a computer setup with a Vista/Ubuntu dual-boot and shared NTFS data partition is shown here:
The first three partitions, all NTFS, are the ones that concern us here. There are no FAT32 partitions. In this instance, all three NTFS partitions have partition labels, which makes it easier to identify the purpose of each. If your blkid output does not include partition labels, this means that the partitions do not have labels and you will have to determine which partition you wish to mount by another means. Of the three NTFS partitions, we are going to configure /etc/fstab with only the third, the Data partition. Partition /dev/sda1 is the OEM manufacturer's recovery partition and should be left unmounted, or as described below. Partition /dev/sda2 is the Windows C:\ partition and is best not included in /etc/fstab for the reasons described above, or mounted read-only - see below.
You will now need to create a mountpoint for each NTFS partition that you wish to mount by means of /etc/fstab. In our illustration we are going to add one entry only for /dev/sda3. From a terminal:
In this case we have created a mountpoint with the same name – Data – as the partition label. You may use (almost) any string you wish.
Before editing /etc/fstab directly, it is a good idea to make a backup. From a terminal:
Now open /etc/fstab in a text editor with root privileges. In Ubuntu:
In Kubuntu:
In Xubuntu or Lubuntu:
For a general-purpose read-write mount, add this line to the end of /etc/fstab:
Replace the UUID with the one relevant for your partition as shown in your blkid output. “519CB82E5888AD0F” will not work for you.
Also, substitute your mountpoint for “/media/Data”. In case you have a blank space in the name of the mountpoint you want to use like "New Volume" instead of "Data" located in "/media" use "/media/New\040Volume". The space character is created by using "\040" in the fstab.
You will also need to change the “locale=en_US.utf8” option to one suitable for your location and language if you are not in the USA. You can determine your locale with this terminal command:
Or for a list of all locales available on your system:
Now save your edited /etc/fstab and close the text editor. The partition(s) you have configured will be mounted the next time you reboot, but to mount them now:
Two special cases
Sample /etc/fstab lines are suggested for two special cases.
Option 1 - for mounting read-only access. For example, this would be suitable for mounting your Windows C:\ partition if you need to access it. Modify the line below with your UUID and mountpoint:
Option 2 - to ensure that Ubuntu does not mount the partition and also disables graphical mounting from the file manager. For example, you may wish to ensure that recovery and system partitions are never inadvertently mounted and do not appear in the file manager. In this case you need to create a mountpoint in /mnt, not /media. Modify the line below with your UUID and mountpoint:
Note: with these mount options, the partition does not appear in the Devices list in the left pane of Nautilus (the Ubuntu file manager), but it still appears in Dolphin, the Kubuntu File Manager. Clicking on the partition in Dolphin causes the display of an error message. This solution is less elegant in Dolphin than with Nautilus, but the desired effect is achieved - the partition cannot be mounted.
If you need to revert to the original configuration:
Substitute your mountpoint in the second line.
FAT32 Partition
FAT32 partitions are mostly only found in older systems. If you are creating a partition to be used for data to be shared between Windows and Ubuntu, it is better to choose NTFS. Should you have a FAT32 partition which you need to mount using /etc/fstab, this will work to mount it read-write:
Replace with the UUID that blkid reveals for your partition, and adjust for your mountpoint. These mount options will make all files in the partition executable. If you have other needs, you will need to modify the options, but this is beyond the scope of this wiki page.