So I was going to back up my home folder by copying it to an external drive as follows:
sudo cp -r /home/my_home /media/backup/my_home
With the result that all folders on the external drives are now owned by root:root
. How can I have cp
keep the ownership and permissions from the original?