P
P
Pavel2021-11-22 11:01:45
Backup
Pavel, 2021-11-22 11:01:45

Is it possible to copy the entire Ubuntu OS via ssh?

I want to copy the entire disk, and run it on another PC, I want to do it via ssh in LAN, but in Linux it’s not like in Windows “this file is currently running and you can’t copy it”?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
rPman, 2021-11-22
@mrusklon

read-locked files in linux are exactly the same as in other systems, historically, any backup is suggested (on any OS) to be done by creating a snapshot (in linux, this is done using lvm if it is used or when using cow file systems such as btrfs / zfs /... directly by their means), a snapshot is a frozen snapshot of the filesystem, with no read restrictions.
it's perfectly fine to use root to copy using regular cp (scp if over ssh) or rsync or tar -c for example. | ssh [email protected] tar -x will copy everything remotely, wrapping first in tar and decompressing on the remote machine (using tar switches you can control for example the --one-file-system file system or transferring hardlink and symlink, for example --dereference and -- hard-dereference will add the file itself to the archive and not a link to it ...)
be careful, there may be running databases in the working system, the files of which cannot be copied to the live one (there will be no guarantees that the data will be copied correctly), such databases must be copied using databases
ps if you still want to copy the system as is, and snapshots are not available, then it is better to transfer the disk to ro mode: mount -r remount,ro /dev/sd... and so on with each partition on which the system is located (then programs trying to record will start to fall off) and you can copy the resulting data
in this case, you can use partclone , can copy the partition as dd but not transferring sectors marked as free, which is noticeably faster (in fact, this is the fastest way to copy a partition)

S
Sergey Karbivnichy, 2021-11-22
@hottabxp

can

A
Armenian Radio, 2021-11-22
@gbg

It is possible, but it is still better to use an installer that works over the network.
And of course, during the copying process, you should not change any files on your computer, otherwise you will get stuffing on the other end.

N
nihi1ist, 2021-11-22
@nihi1ist

Can. Approximately so .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question