2

I can open nautilus file manager as root and tried various tutorials on this site but still having the same problem every time.

I'm able to right click then select properties as root on my second hard drive either through FILESYSTEM/media or right clicking the second drive in the list on the left panel.

However when I go to change ownership as root to my my username or change settings like read write etc it goes back to root or it's previous settings before I've closed the properties window and there seems no way of changing ownership or settings of my second hard drive. I need full access to this hard drive as my username.

The drive is an internal SATA and formatted in NTFS and I'm using Ubuntu 12.04 LTS 64 bit

I will be grateful of any help

1

2 Answers 2

4

First, the NTFS file system handles permissions significantly different (more the Windows way) than any Linux file system like ext4. You should edit the line in /etc/fstab which mounts your NTFS partition.

You can open an editor to edit it with this command (use a terminal): gksu gedit /etc/fstab

  • Firstly: which partition is it?

    In this case, this needs to be a device node identifier. e.g. /dev/sda1, a partition UUID, or a partition label.

    Running sudo blkid -c /dev/null in a terminal will tell you all the relevant information about your partitions. Hopefully you can determine from this list which one is the correct partition.

    If you use a UUID or Label, you need to declare it as such. e.g. "LABEL=Windows", "UUID=ABCDEFGHIJKLKLMNOP".

  • Next, where should it be mounted?

    This part is simple: where do you want the partition to be accessible from? Ubuntu mounts partitions in /media by default, so if you want the partition to be mounted there, say so. e.g. /media/Windows. You will need to manually create this folder since fstab will complain if it's not there, so make sure that the folder isn't being used already, and run

    sudo mkdir /media/Windows

  • Next, which filesystem should it be mounted as?

    Since we're mounting an ntfs partition, specify ntfs-3g for this column. Don't use "ntfs" unless you don't want to be able to write to the partition after it's mounted (by write, I mean making new files, editing files, moving files and folders, etc.; the "ntfs" driver is outdated and only lets you read files.)

  • Next, what options should it be mounted with?

    This is the most important column in this case, this is where you specify permissions. How you do this isn't immediately obvious, but there's a way, and it's actually rather simple.

    This is a comma separated list, so don't use spaces or tabs, or else you'll find that the mount line doesn't work as expected. To specify the permissions, you merely need to declare three things: UID, GID, and umask.

    uid=#### specifies which userid should own the files on the partition. e.g. uid=1000 means that the user with the id "1000" should own the files. You can find out your UID by opening a terminal and running echo $UID.

    gid=#### specified which groupid should own the files on the partition. e.g. gid=1000 means that the group with the id "1000" should own the files. Finding out groupids is slightly more difficult than finding out your userid because you can belong to several groups at the same time.

    Now, Ubuntu normally creates a group for every user, with the same ID as the UID, so you can probably use your UID as the GID. However, you can get a list of groups by running, in a terminal, cat /etc/group. This will display a list with up to four colon-separated fields per line. The lines will contain the following items: name, an encrypted password, the GID, and a list of users in the group. Find the group you want to use, and add it's GID to the options.

    umask=UGO is the most important of the three options; it specifies what the permissions will be for the user, the group, and everyone else. The numbers used here need to be between 0 and 7, anything else will probably cause an error. These numbers are actually an inverse of normal permissions, so while "7" means "read, write, and execute" in normal permission setting, in fstab "7" means "no permissions". Setting umask=000 will give EVERYONE read, write, and execute permissions. For clarification, the U is the permissions for the user, G is for group, and O is for others. See www.cyberciti biz/tips/understanding-linux-unix-umask-value-usage.html for more details about umask.

    You may also add other things to this list. Generally speaking, it's best to start with the "defaults" option. "auto" makes the partition mount automatically when you boot up. Read more here: www.tuxfiles org/linuxhelp/fstab.html

  • The final two columns should be "0" and "0". These two columns are only used for Linux filesystems, so setting them to 0 stops any complications from arising.

A finished fstab line may look like:

UUID=ABCDEFGHIJKLKLMNOP /media/Windows ntfs-3g defaults,auto,uid=1000,gid=1000,umask=002 0 0

The next time you boot up, or the next time you run sudo mount -a, the partition should be mounted where you want it, with the permissions you want it to have.

Source

0
0

To Get Mount ntfs partitions in Ubuntu we need to install ntfs-3g package to get it use

sudo apt-get install ntfs-3g

To Mount the partition to some directory

mkdir /mnt/ntfs_data
mount -t ntfs-3g /dev/sda2 /mnt/ntfs_data

Make it to mount while every boot by adding fstab entry

/dev/sda2   /mnt/ntfs_data  ntfs-3g defaults    0   0

Even you can mount using UUID by getting the UUID using

blkid 

Output will be similar to this

/dev/sda2: UUID="Uo4y9S-Y9ip-hsSp-z8oI-nNnP-hwRn-x0bEQG"

And and replace the UUID instead of /dev/sda2 in fstab entry

replace sda2 and ntfs_data according to your environment

If you need help regarding ntfs-3g just run the command

man ntfs-3g

You can find this at top of ntfs-3g man page :

EXAMPLES

Mount /dev/sda1 to /mnt/windows:

ntfs-3g /dev/sda1 /mnt/windows

or

mount -t ntfs-3g /dev/sda1 /mnt/windows

Mount the ntfs data partition /dev/sda3 to /mnt/data with standard Linux permissions applied :

ntfs-3g -o permissions /dev/sda3 /mnt/data

or

mount -t ntfs-3g -o permissions /dev/sda3 /mnt/data

Read-only mount /dev/sda5 to /home/user/mnt and make user with uid 1000 to be the owner of all files:

ntfs-3g /dev/sda5 /home/user/mnt -o ro,uid=1000

/etc/fstab entry for the above (the sixth and last field has to be zero to avoid a file system check at boot time) :

/dev/sda5 /home/user/mnt ntfs-3g ro,uid=1000 0 0

Unmount /mnt/windows:

sudo umount /mnt/windows
2
  • Thank you this worked now creating and deleting data like I want. I'm still a beginner with Ubuntu as you may tell but always wanting to learn more about it. Feb 22, 2014 at 11:23
  • welcome, come with new issue and ask for fix it Feb 23, 2014 at 2:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .