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
chown
after the fact. This results in the same error - using
rsync
instead. This doesn't output errors, but fails to preserve ownership and attributes just likecp
- executing
sudo su
and trying everything asroot
. Same problem - executing
sudo dd if=/dev/mmcblk0p1 of=/backups/backup_of_boot
and thensudo 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?