I just created a rootfs with debootstrap in a Debian Jessie VirtualBox VM. Now I would like to transfer this to the host, by first compressing the directory to a tar archive, so I can upload it and download it again on the host.
I want the tar archive to preserve permissions and make an exact copy of the rootfs. So I used tar -czpvf --one-file-system like the Arch Linux Wiki suggests. However I get "tar: Exiting with failure status due to previous errors", those previous errors seem to "tar: $path: Cannot open: Permission denied" errors. I am afraid that running tar as root will modify the ownership/permissions of the files and directories in the rootfs folder. How do I preserve the permissions and ownership of this rootfs when compressing it to a gzipped tar?