There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

[SOLVED] How to copy existing Timeshift Snapshot to another drive?

I want to copy (not move) my Timeshift Snapshots (Rsync) from my existing drive to another drive. Both drives are ext4. As far as I searched I am not able to find any viable results.

If not possible, just why?



Solved

https://www.cyberciti.biz/faq/linux-unix-apple-osx-bsd-rsync-copy-hard-links/

TLDR


<span style="color:#323232;">sudo rsync -az -H --delete --numeric-ids /path/to/timeshift path/to/destination/
</span>

Where,

-a : Archive mode (i.e. recurse into directories, and preserve symlinks, file permissions, file modification times, file group, file owner, device files & special files)

-z : Compress file data during the transfer

H : Preserve hard links (i.e. copy hard links as hard links)

–delete : Delete extraneous files from the receiving side (ones that aren’t on the sending side), but only for the directories that are being synchronized i.e. keep exact replica of your /path/to/timeshift directory.

–numeric-ids : Transfer numeric group and user IDs rather than using user and group names and mapping them at both ends.

–progress : Show progress during transfer.

–log-file=“/var/log/my-rsync-script.log” : Log what rsync command is doing to the /var/log/my-rsync-script.log file.


Thanks to @skullgiver

Original Comment: lemmy.world/comment/11611743

Churbleyimyam ,

Have you looked at Clonezilla?

gpstarman OP ,

I already have several files on the drive which I want to copy the snapshots.

Won’t clonezilla replace everything?

Churbleyimyam ,

it will, yes. Which is good if you want to keep everything from from the source drive but bad if you want to keep everything from the destination drive.

skullgiver ,
@skullgiver@popplesburger.hilciferous.nl avatar

Surely just copying the files over should do the job? For a single snapshot, that is, otherwise you’ll probably be duplicating a lot of deduplicated space by copying every file out of every backup.

I believe using rsync and telling it to maintain hard links should work.

gpstarman OP ,

Surely just copying the files over should do the job?

It gives me an error ‘cannot copy special files’. Even when doing as root.

The article confuses me a bit. But I’ll look into it.

Thank you.

skullgiver ,
@skullgiver@popplesburger.hilciferous.nl avatar

It seems to me like the copy utility you’re using (file manager?) doesn’t maintain soft links/hard links. You may need a command line tool to do the copying that does support it, like rsync, or a different GUI tool (though I admit I don’t know for sure what GUI tools specifically support this).

gpstarman OP , (edited )

Yeah I was using Nemo.

rsync

Can you give me some guidance on how to copy using snaps rsync in CLI, please?

Edit: I just read the article you linked. I’ll try that and let you know

gpstarman OP ,

Thanks man. It worked.

electricprism ,

Can’t remember if this had mv in scope, still good to keep on radar

github.com/digint/btrbk

gpstarman OP ,

My snapshot is rsync on ext4.

Thanks anyways.

Landless2029 ,

Nice addition of solution.

In time Lemmy will replace reddit for tech questions. Give it a few years!

gpstarman OP ,

Thanks man.

replace reddit for tech questions.

The thing is as of right now most Lemmy users are just tech enthusiasts. We want all sort of people to create a more robust community. I want to Lemmy to fully replace reddit in terms of amount of users, communities, posts and activeness.

Let’s just give Lemmy some time.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines