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!
VFAT
filesystems don't support the Linux/Unix file ownership and permission bits. The whole-filesystem ownership and permission bits are set viamount
. Look atmount | grep 'BOOT
and readman mount
, especially aboutVFAT
. – waltinator Dec 20 '20 at 04:25man
page onVFAT
quite useful. I foundsudo 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