0

I am copying a set of files to a directory on which the SD card is mounted via

$ cp -a * /media/BOOT

but I get

cp: cannot create regular file '/media/BOOT/u-boot.img': Permission denied

With sudo

$ sudo cp -a * /media/BOOT

I get

cp: failed to preserve ownership for '/media/BOOT/u-boot.img': Operation not permitted

But in the /media/BOOT, I'm already seeing the files being copied but with different permissions.

// source permissions
-rwxrwx--- 1 root vboxsf  367496 Aug 10 22:46 u-boot.img

// destination permissions -rwxr-xr-x 1 root root 367496 Aug 10 22:46 u-boot.img

  • Does anyone see why I'm getting the error and why are files being copied despite that?
  • Is the change in permissions also why I can't possibly boot the boot image off the SD card?

Does running chmod 777 in the destination folder sound like a good idea?

OS: 18.04.1-Ubuntu

SD card partition FS: vfat

Using it on a virtualbox but shouldn't matter

Edit:

Tried this solution but no luck!

Jazzy
  • 121
  • You haven't provided what OS & release you're using, nor what file-system is being used (can it correctly store POSIX details; or a set of defaults being masked over the non-existent permissions due to file-system in use) – guiverc Dec 20 '20 at 00:31
  • added the OS & FS of the external drive's partition – Jazzy Dec 20 '20 at 00:40
  • VFAT filesystems don't support the Linux/Unix file ownership and permission bits. The whole-filesystem ownership and permission bits are set via mount. Look at mount | grep 'BOOT and read man mount, especially about VFAT. – waltinator Dec 20 '20 at 04:25
  • I'm afraid I didn't find the man page on VFAT quite useful. I found sudo mount -o rw,users,umask=000,exec /dev/sdxn /mnt/sd1 this command on one of the SO links though – Jazzy Dec 20 '20 at 05:51

0 Answers0