Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've found out two ways to automount a NTFS partition on Ubuntu start up.

  1. File /etc/rc.local:

    mount -t ntfs /dev/sda8 /mnt/data/
    
  2. Or by fstab:

    UUID=1C02CB8502CB627E /media/data/ ntfs defaults 0 0
    
    • Is there any difference between them?
    • Is one more recommended than other? Which should I choose?
share|improve this question
    
off topic migrate to serverfault –  MK. Apr 6 '12 at 15:10
1  
One quick note, in Ubuntu add uid=xxxx to the fstab entry. (If you are the only user that would be uid=1000) Reason being that Ubuntu then creates a Trash folder and nautilus then has "Move to Trash" option. –  tomrlopes Mar 17 at 6:01
    
@tomrlopes - Cool! Thank you for sharing. –  Victor Hugo Mar 17 at 10:43
add comment

migrated from stackoverflow.com Apr 6 '12 at 15:31

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 8 down vote accepted

Use the fstab; that is the standard place for automatically mounting volumes.

rc scripts are intended to be used for running generic startup commands and launching startup services.

As a side note, you don't have to use the UUID in the fstab if you really don't want to, it should work equally as well using /dev/sda8

share|improve this answer
    
Thanks! :) Another question: the permissions and owner of the folder are autoset to drwxrwxrwx 1 root root. I've tried chown and chmod commands but I could not change it to drwxr-xr-x 1 victorhugo victorhugo. Do you know why it is happening? –  Victor Hugo Apr 6 '12 at 15:27
1  
Have a look at some of the mounting options available to you en.wikipedia.org/wiki/Fstab You can replace "defaults" with more customised options. But be wary, you are using an NTFS file system which doesn't use the standard unix permissions, so attempting to change them may not even make sense. Just make sure you have read and write access the file. –  eltommo Apr 6 '12 at 15:49
3  
/dev/sda8 could change, the UUID is, at its name says, unique –  Walter Tross Nov 14 '12 at 13:23
    
Tutorial: howtoadvice.com/2014/03/08/… –  Lonnie Best Mar 16 at 23:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.