I'm trying to copy the files on my mounted boot partition to another device whilst preserving ownership and attributes. I'm doing this on a Raspberry Pi running RaspBMC. I've mounted the destination:
sudo mount -t vfat /dev/sda1 /temp/
Then I'm attempting this:
sudo cp -a /boot/* /temp/
But this results in errors like this:
cp: failed to preserve ownership for `/temp/bootcode.bin': Operation not permitted
So the files are being copied, but the owner is the currently logged on user (pi) rather than root. In addition, none of the files are marked as executable like they are in /boot/.
What I've tried:
- copying the files without preserving ownership and then executing
chownafter the fact. This results in the same error
rsyncinstead. This doesn't output errors, but fails to preserve ownership and attributes just like
sudo suand trying everything as
root. Same problem
sudo dd if=/dev/mmcblk0p1 of=/backups/backup_of_bootand then
sudo dd if=/backups/backup_of_boot of=/dev/sda1. Unbelievably, this still does not copy ownership and attributes (but does copy all files).
Can anyone tell me what I'm doing wrong?