Am Fri, Dec 20, 2024 at 11:02:55PM +0100 schrieb k...@aspodata.se: > Alan Mackenzie: > ... > > By the way, do you know an easy way for copying an entire filesystem, > > such as the root system, but without copying other systems mounted in > > it? I tried for some while with rsync and various combinations of > > find's and xargs's, and in the end booted up into the rescue disc to do > > it. I shouldn't have to do that. > > rsync as other people have suggested. > There is also > cp -x > dump/restore > find -xdev > etc. > > You can also do it by accessing the /dev/-file like > dd if=source of=dest (cp works here also but dd is more the norm). > > /// > > When something is mounted on a mount point, the files below the > mount point is hidden and the mounted filessystem will be available > instead. Do you want to copy thoose hidden files also ?
To circumnavigate this, I usually bind-mount the filesystem to another directory first. I usually only do this when I’m dealing with /, as my FS structure is not complex: mount --bind / /mnt/bind rsync -axAHX /mnt/bind/ /path/to/destination/ (-x is not needed then, but it’s part of muscle memory) -- Grüße | Greetings | Salut | Qapla’ Please do not share anything from, with or about me on any social network. Keyboard not connected, press F1 to continue.