2

I want to automount an hard drive when my raspberry pi zero starts. The commands works but I can't write in the folder because I don't have permission even if I use sudo. I can only read. I already tried to change folder's permission with chmod but the problem persists. According to the man, I think it's the good command. This is the line I added to fstab file :

UUID=My-UUID /mnt/myFolder ntfs,auto,umask=000,users,rw 0 0

Edit :

If I add the line UUID=MY-UUID /mnt/MY-FOLDER ntfs rw,noauto,relatime,umask=22,uid=0,gid=0,nls=utf8 0 0 on my fstab file and I exectute the command sudo mount -a or I reboot the raspberry, the hard drive is not mounted but I have not an error message. So I don't have the permission problem because the disk is not mounted...

1 Answer 1

2

Your fstab entry is incorrect. It should be something like:-

UUID=       /mnt/SeagateBackupPlus     ntfs    rw,noauto,relatime,umask=22,uid=0,gid=0,nls=utf8 0   0
UUID=       /mnt/PiData     ext4    defaults,noatime,noauto  0     0

Under Stretch you may need to install ntfs-3g to enable writing to NTFS

I have added a typical ext4 drive entry. NOTE I invariably manually mount, rather than automount.

5
  • Hello, thanks for your answer but can you edit it to mount in ext4 ? I changed my mind and I want to use ext4. I added the command UUID=MY-UUID /mnt/MY-FOLDER ext4 rw,noauto,relatime,umask=22,uid=0,gid=0,nls=utf8 0 0 and sudo mount -a to test without rebooting but it doesn't mount disk. Also, is it possible to add an option to boot even if the hard drive is unpluged ? Thanks.
    – Anonymous
    Commented Dec 24, 2017 at 17:09
  • @Anonyme I have added an entry I use for ext4 . This I use for Pi backups, but rather than automount, I manage mounts in my scripts.
    – Milliways
    Commented Dec 25, 2017 at 10:07
  • When I add the entry for ext4 type hard drive, I can mount it with the command sudo mount /dev/sda and it will automatically mount in the specified folder in the fstab file. But the original question is how to mount automatically an ext4 hard drive with the fstab file ? I don't want to use a script. Why when I replace ntfs by ext4 in the command you give me it doesn't works ? Thanks.
    – Anonymous
    Commented Dec 25, 2017 at 10:31
  • @Anonyme You should add additional detail to your question, rather than in Comments. NOTE you now appear to be asking a different question, which is strictly off-topic for this site, and is a generic Linux question. Most of these can be resolved by reading man mount, but no one can give you an entry to suit all uses. Also "doesn't work" is not helpful, you need to explain what doesn't and/or list error messges. I don't use automount, because my fstab has dozens of entries, and testing for non-existent drives delays boot.
    – Milliways
    Commented Dec 25, 2017 at 11:08
  • Ok, I will open a new subject for ext4. I will focus on NTFS hard drive for this subject. Actually, the problem persists, I just edited the original message.
    – Anonymous
    Commented Dec 26, 2017 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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