Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 16833  / 1 Year ago, mon, may 1, 2023, 6:54:19

This question started as Changing file permissions on USB external hard drive but as I can find a solution I ask again.



The problem comes when I move a USB drive I have been using in Ubuntu 10.04 to a lapto with 12.04. I want to change permissions of some scripts as they appear only with rw but I can't.



Now I have tried to copy the device line from fstab from 10.04 to the laptop with 12.04 but still get an error message.



Error mounting: mount exited with exit code 1: helper failed with:
mount: only root can mount /dev/sdb1 on /media/FREECOM HDD


The line I add to fstab to try to mount the usb drive is



/dev/sdb1 /media/FREECOM040HDD vfat rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush 0 0


When restoring original fstab and plugging the usb drive the output of mount is



/dev/sdb1 on /media/FREECOM HDD type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)


What should I add in fstab to get the drive fully working? I wanted to change permissions on files in the usb drive.



Output of sudo fdisk -l



Device     Start      End      Blocks  Id  System
/dev/sdd1 63 1953520064 976760001 c W95 FAT32 (LBA)


Thanks again


More From » 12.04

 Answers
6

I've successfully used /etc/fstab to auto mount a usb device located at sdb1 using the following:



/dev/sdb1 /media/Test ntfs-3g defaults,user,exec,uid=1000,gid=100,umask=000 0 0


With this configuration, I've mounted the device having all privileges over its files.




  • Replace /dev/sdb1 with your device


  • Replace /media/Test with your target directory


  • Replace ntfs-3g with your USB drive file system




Related reading: Fstab - Community Ubuntu Documentation






My goal was more or less the same as yours, to have an USB drive with an executable file that performs some updates, either on my home PC or my work PC.


[#37606] Wednesday, May 3, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
otatorm

Total Points: 218
Total Questions: 113
Total Answers: 124

Location: British Indian Ocean Territory
Member since Tue, Feb 22, 2022
2 Years ago
otatorm questions
;