Mainly Linux

17Mar/110

How to mount NTFS partition in Ubuntu

If you need read and write access to a NTFS partition from Ubuntu you can add an entry into /etc/fstab so that every time you boot up, the NTFS partition automatically mounts for you.

First, create a directory where the partition will be mounted:

mkdir /media/ntfs

Find the UUID of the NTFS partition:

sudo blkid

This will output something similar to:

/dev/sda1: UUID="B070ED7770DD452A" TYPE="ntfs"

If you have multiple NTFS partitions you will need to work out which one you want to automatically mount each time you boot.

Backup your fstab configuration (just in case you break something):

cp /etc/fstab /home/you/backup

Then add this line to /etc/fstab changing the UUID:

UUID=B070ED7770DD452A /media/ntfs ntfs rw,auto, uid=1234, umask=0027, nls=utf8 0 0

You can also set the "uid" to your own user id (uid=1234 is the example used here) and you can find this out by issuing id -u at the command line. Mounting file systems with specific user (or group) ids can be useful for the security of your system.
Umask = 0027 means you can read, write, or execute any files in the NTFS partition.

Check if it works:

sudo mount /media/ntfs && df

This should output various file systems including your newly mounted NTFS partition:

/dev/sda1 1 70226940 58935140 11291800 84% /media/ntfs

The next time you reboot the NTFS partition will automatically mount. To add more than one partition (or disk) just repeat the steps above, adding a new line for every additional partition into the fstab configuration file.

Hope this helps.

Filed under: Linux Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.