2

I mounted an external hdd into /mnt/edisk on my raspberry pi. If I check ownership, strangely I see this:

drwxr-xr-x 19 rpi-first-boot-wizard rpi-first-boot-wizard 128K May 10 17:44 edisk

I can write to this disk with sudo But I want to change permission to my user pi.

Tried to do this with chown -R pi /mnt/edisk but this is throwing Operation not permitted error.

What is rpi-first-boot-wizard? How can I change permissions?

update

This is an exFat formatted disk

update 2

This is the command I am using to mount:

sudo mount -t exfat -o uid=1000,gid=1000,umask=007 /dev/sda1 /mnt/edisk/

mount | grep edisk is showing:

/dev/sda1 on /mnt/edisk type exfat (rw,relatime,uid=1001,gid=1001,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro)
2

1 Answer 1

1

exFat looks like do not have separate bite for owner, so you need to mount it with option:

cd
sudo umount /mnt/edisk
sudo mount -o uid=pi,gid=$(id -gn pi) /dev/device /mnt/edisk

So it will mount the disk as a specific user.

to make it available after reboot and mount now:

sudo -s
echo "/dev/DEVICE /mnt/edisk exfat defaults,uid=pi,gid=$(id -gn pi) 0 
0 " >> /etc/fstab
systemctl daemon-reload
mount -av
exit
7
  • /mnt/edisk/etc/passwd does not exist. This is an extarnal hdd used as storage
    – bcsta
    May 13, 2022 at 9:59
  • "copy files with sudo to mounted disk." - what files?
    – bcsta
    May 13, 2022 at 10:01
  • oh, sorry, missread it. Then just run: sudo chown -Rc /mnt/edisk
    – BiG_NoBoDy
    May 13, 2022 at 10:06
  • still does not work with sudo.. look at updated question
    – bcsta
    May 13, 2022 at 10:13
  • can you show mount command you used? and mount | grep edisk
    – BiG_NoBoDy
    May 13, 2022 at 10:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .