Skip to main content
added 620 characters in body
Source Link

Supposing the uid of pi is 1001, and the gid of pi's group is 201, you'd use

sudo mount  -o uid=1001,gid=201 /dev/sda1 /media/usb

You need to pass the id's, not the names, and the options go before device and mount point.

Let me give you an example:

ghp-amdphIIX4B:/root
# id ghp
UID=1000(ghp) GID=1000(ghp)
ghp-amdphIIX4B:/root
# mount -o uid=1000,gid=1000 /dev/sdc1 /mnt/sdc1
ghp-amdphIIX4B:/root
# ls -al /mnt/sdc1
totaal 9087532
drwxr-xr-x  4 ghp  ghp        8192 jan  1  1970 .
drwxr-xr-x 13 root root       4096 aug 11 16:15 ..
-rwxr-xr-x  1 ghp  ghp          21 jan  1  1980 .cm0013
drwxr-xr-x  3 ghp  ghp        8192 aug 11 16:17 Jennifer
drwxr-xr-x  2 ghp  ghp        8192 jun 11  2017 System Volume Information

One difference, my usb stick contains a vfat.

Supposing the uid of pi is 1001, and the gid of pi's group is 201, you'd use

sudo mount  -o uid=1001,gid=201 /dev/sda1 /media/usb

You need to pass the id's, not the names, and the options go before device and mount point.

Supposing the uid of pi is 1001, and the gid of pi's group is 201, you'd use

sudo mount  -o uid=1001,gid=201 /dev/sda1 /media/usb

You need to pass the id's, not the names, and the options go before device and mount point.

Let me give you an example:

ghp-amdphIIX4B:/root
# id ghp
UID=1000(ghp) GID=1000(ghp)
ghp-amdphIIX4B:/root
# mount -o uid=1000,gid=1000 /dev/sdc1 /mnt/sdc1
ghp-amdphIIX4B:/root
# ls -al /mnt/sdc1
totaal 9087532
drwxr-xr-x  4 ghp  ghp        8192 jan  1  1970 .
drwxr-xr-x 13 root root       4096 aug 11 16:15 ..
-rwxr-xr-x  1 ghp  ghp          21 jan  1  1980 .cm0013
drwxr-xr-x  3 ghp  ghp        8192 aug 11 16:17 Jennifer
drwxr-xr-x  2 ghp  ghp        8192 jun 11  2017 System Volume Information

One difference, my usb stick contains a vfat.

added 51 characters in body
Source Link

Supposing the uid of pi is 1001, and the gid of pi's group is 201, you'd use

sudo mount  -o uid=1001,gid=201 /dev/sda1 /media/usb -o uid=1001,gid=201

You need to pass the id's, not the names, and the options go before device and mount point.

Supposing the uid of pi is 1001, and the gid of pi's group is 201, you'd use

sudo mount /dev/sda1 /media/usb -o uid=1001,gid=201

You need to pass the id's, not the names.

Supposing the uid of pi is 1001, and the gid of pi's group is 201, you'd use

sudo mount  -o uid=1001,gid=201 /dev/sda1 /media/usb

You need to pass the id's, not the names, and the options go before device and mount point.

Source Link

Supposing the uid of pi is 1001, and the gid of pi's group is 201, you'd use

sudo mount /dev/sda1 /media/usb -o uid=1001,gid=201

You need to pass the id's, not the names.