How to Copy Timeshift to an External Hard Drive

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
trope
Level 4
Level 4
Posts: 320
Joined: Tue Feb 19, 2013 1:10 pm

How to Copy Timeshift to an External Hard Drive

Post by trope »

I have 4 timeshift snapshots, 2 each from different OSs. I want to copy the entire directory to an external HD. I made a 40 GB partition. I check the size of the timeshift directory in the terminal and it is 34G.

However when I open Caja, right-click the timeshift directory, "Copy", and then "Paste" in the external HD, I get a dialog that says something like "preparing to copy" and the size goes up into the 50 GB range and then I get an error message stating something like "There is not enough free space in the destination". Am I doing something wrong?
This seemed like the easiest way to copy it since the snapshots are from different OS, and I would have to re-boot into each one in order to make manual snapshots.

Code: Select all

$ sudo du -sh /timeshift
34G	/timeshift

Code: Select all

$ df -h
Filesystem        Size  Used Avail Use% Mounted on

/dev/sdb5          39G   48M   37G   1% /media/me/e32d28c3-6c69-2979-b03f-49474ef23b03
When I right-click in Caja and click on Properties, I get 34.3 GB (35.6 GB on disk).
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
AZgl1800
Level 20
Level 20
Posts: 11184
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: How to Copy Timeshift to an External Hard Drive

Post by AZgl1800 »

I think you are trying to make it too hard.

I have TimeShift setup to always store its' backups on an external drive.
just plug in the extUSB drive and then make your timeshift backups.

if you are doing this for more than one PC, then use a trick that I have come up with.

as you are aware, TimeShift always saves to /timeshift in the root of a partition.
when I have completed a TS backup, I then open that /timeshift folder and create a text document ASUS TUF FX705 for this laptop that I am using now.

then I Rename that folder to Timeshift FX705GM

then I create a new folder /Timeshift which is now empty of course.
but, it is ready to use for the next PC that needs a /Timeshift backup.

I have an older laptop, ASUS Thinbook TP500L
when I make a TS backup of that laptop, I open the TS folder, create a new document Timeshift TP500L
I then rename that /Timeshift folder to Timeshift TP500L

then I repeat the creation of a new empty /Timeshift folder.

----------------

Okay, let's say you have gone a month w/o TS backups being done.
you are going to need to open the existing /Timeshift folder and inspect it to see if it contains any files?

if none, then delete that folder. If you find a Text Document for ACER Aspire 5253 then you need to rename that folder for that PC.

Now open the corresponding folder for the PC you are going to make an updated TS backup, and rename it to /Timeshift.
it will be easy to determine which PC that folder is for, by looking at the Text Document that has the name for the PC it is used for.

a bit tedious, but very fast to do, and it has allowed me to save TS backups of 4 laptops of varying ages, onto the same extUSB drive.

. it is impossible to look at a TimeShift backup and determine what PC created that backup, so that is why I started using the method described above. it is easy to do, and will prevent you from overwriting backups from different PCs to the same /timeshift folder.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
User avatar
AZgl1800
Level 20
Level 20
Posts: 11184
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: How to Copy Timeshift to an External Hard Drive

Post by AZgl1800 »

later on, I replaced the internal 256gB HDD with a 1TB SSD.
I then divided that into 2 partitions.
the first partition contains the OS.
the 2nd partition is labeled Backup

Partitions.png
backup.png
as you can see, it is where I store all of the backups.

once in a Blue Moon, that Backup Partition is Rsync'd to the extUSB drive.

.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How to Copy Timeshift to an External Hard Drive

Post by all41 »

timeshift.png
Same drive, same directory
Everything in life was difficult before it became easy.
User avatar
antikythera
Level 15
Level 15
Posts: 5721
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: How to Copy Timeshift to an External Hard Drive

Post by antikythera »

trope wrote: Tue Sep 08, 2020 3:46 pm I have 4 timeshift snapshots, 2 each from different OSs. I want to copy the entire directory to an external HD. I made a 40 GB partition. I check the size of the timeshift directory in the terminal and it is 34G.

However when I open Caja, right-click the timeshift directory, "Copy", and then "Paste" in the external HD, I get a dialog that says something like "preparing to copy" and the size goes up into the 50 GB range and then I get an error message stating something like "There is not enough free space in the destination". Am I doing something wrong?
This seemed like the easiest way to copy it since the snapshots are from different OS, and I would have to re-boot into each one in order to make manual snapshots.

Code: Select all

$ sudo du -sh /timeshift
34G	/timeshift

Code: Select all

$ df -h
Filesystem        Size  Used Avail Use% Mounted on

/dev/sdb5          39G   48M   37G   1% /media/me/e32d28c3-6c69-2979-b03f-49474ef23b03
When I right-click in Caja and click on Properties, I get 34.3 GB (35.6 GB on disk).
try copying the contents like you wanted to with the file manager with rsync instead. It's what Timeshift uses as backend for non-btrfs volumes anyway. The below will preserve any symlinks and file permissions. It will also display some transfer information while in progress.

Code: Select all

sudo rsync -aHAXS --info=progress2 sourcepath destinationpath
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
User avatar
slipstick
Level 6
Level 6
Posts: 1071
Joined: Sun Oct 21, 2012 9:56 pm
Location: Somewhere on the /LL0 scale

Re: How to Copy Timeshift to an External Hard Drive

Post by slipstick »

trope wrote: Tue Sep 08, 2020 3:46 pm I have 4 timeshift snapshots, 2 each from different OSs. I want to copy the entire directory to an external HD. I made a 40 GB partition. I check the size of the timeshift directory in the terminal and it is 34G.

However when I open Caja, right-click the timeshift directory, "Copy", and then "Paste" in the external HD, I get a dialog that says something like "preparing to copy" and the size goes up into the 50 GB range and then I get an error message stating something like "There is not enough free space in the destination". Am I doing something wrong?
This seemed like the easiest way to copy it since the snapshots are from different OS, and I would have to re-boot into each one in order to make manual snapshots.

Code: Select all

$ sudo du -sh /timeshift
34G	/timeshift

Code: Select all

$ df -h
Filesystem        Size  Used Avail Use% Mounted on

/dev/sdb5          39G   48M   37G   1% /media/me/e32d28c3-6c69-2979-b03f-49474ef23b03
When I right-click in Caja and click on Properties, I get 34.3 GB (35.6 GB on disk).
The reason the size seems to increase is that each of your snapshots looks like a full snapshot to the copy command. Actually, in each pair you should have one full snapshot and another which has data only for changed or new files - files which are the same between the two snapshots from the same OS will just link the files from the second one via hard links to the already existing files from the first snapshot. The copy command just follows the hard links so both snapshots seem to be full backups; i.e., many files which are stored once in one snapshot and just hard linked to the other snapshot because the file is the same in both, appear to have two full copies of the file. But the properties display appears correct.

Here's a little explanation of how the hard links work:
viewtopic.php?p=1474848#p1474848

Here's how I display the actual space used for my TS snapshots:
viewtopic.php?p=1617900#p1617900

There is a script file I use for transferring my snapshots to an external HD. As far as I can determine (still using 18.3, so don't know if this works on 19 or 20) the data on the external USB drive is identical to the data on the internal HD. But I haven't really tried restoring from the external drive (I have restored from the internal drive OK). But apparently someone used my script to save to external drive, then, as a test tried to restore to a VM and had a problem (don't know which version of LM he was using). For what it's worth, the script and follow up posts describing the problem are here:

viewtopic.php?p=1864592#p1864592

Note - in my script, I no longer use the "| tee ~/timeshift_backup_log" part of the command.
In theory, theory and practice are the same. In practice, they ain't.
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: How to Copy Timeshift to an External Hard Drive

Post by pbear »

FWIW, I maintain a set of shadow snapshots on flash drive, but prefer to run Timeshift separately for those. My reason is that I've noticed several threads where difficulty restoring seemed to be caused by an error in the snapshots themselves. My way, the shadow snapshots are independent. I don't try to keep the shadow snapshots super-current. Rather, I only update them at kernel updates, which generally is every few weeks.
trope
Level 4
Level 4
Posts: 320
Joined: Tue Feb 19, 2013 1:10 pm

Re: How to Copy Timeshift to an External Hard Drive

Post by trope »

AZgl1500 wrote: Tue Sep 08, 2020 5:11 pm I have TimeShift setup to always store its' backups on an external drive.
just plug in the extUSB drive and then make your timeshift backups.
So you are making manual timeshift backups? Is it okay to use the OS normally while the timeshift snapshot is in progress? I am not sure if timeshift schedules itself based on time of day or system resources available when it is in automatic scheduling mode.
trope
Level 4
Level 4
Posts: 320
Joined: Tue Feb 19, 2013 1:10 pm

Re: How to Copy Timeshift to an External Hard Drive

Post by trope »

pbear wrote: Tue Sep 08, 2020 11:40 pm FWIW, I maintain a set of shadow snapshots on flash drive, but prefer to run Timeshift separately for those. My reason is that I've noticed several threads where difficulty restoring seemed to be caused by an error in the snapshots themselves. My way, the shadow snapshots are independent. I don't try to keep the shadow snapshots super-current. Rather, I only update them at kernel updates, which generally is every few weeks.
What is a shadow snapshot? Can you provide a link or what software would I use for that?
trope
Level 4
Level 4
Posts: 320
Joined: Tue Feb 19, 2013 1:10 pm

Re: How to Copy Timeshift to an External Hard Drive

Post by trope »

antikythera wrote: Tue Sep 08, 2020 6:32 pm
try copying the contents like you wanted to with the file manager with rsync instead. It's what Timeshift uses as backend for non-btrfs volumes anyway. The below will preserve any symlinks and file permissions. It will also display some transfer information while in progress.

Code: Select all

sudo rsync -aHAXS --info=progress2 sourcepath destinationpath
It worked using this code. I guess I should have made sure timeshift wasn't running before I executed it.
For future transfers, can I just delete everything on the backup and re-run this command? Or maybe I will use @slipstick's script after I figure out how it works.
User avatar
AZgl1800
Level 20
Level 20
Posts: 11184
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: How to Copy Timeshift to an External Hard Drive

Post by AZgl1800 »

trope wrote: Mon Sep 14, 2020 2:33 pm
AZgl1500 wrote: Tue Sep 08, 2020 5:11 pm I have TimeShift setup to always store its' backups on an external drive.
just plug in the extUSB drive and then make your timeshift backups.
So you are making manual timeshift backups? Is it okay to use the OS normally while the timeshift snapshot is in progress? I am not sure if timeshift schedules itself based on time of day or system resources available when it is in automatic scheduling mode.
I do it both ways.
my SSD has two partitions,
1) OS
2) /Backup
timeshift and BackInTime are set to run Automatically once each day to the /Backup.

I plug in the extUSB drive on occassion to make Manual backups.
it never hurts to have backups for your backups.

I also use FoxClone to make Images of each partition to that extUSB drive.
not on a schedule, just when I happen to think it is "about time"
FoxClone compresses the backups making that more favorable over the long term.

Partitions.png
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: How to Copy Timeshift to an External Hard Drive

Post by pbear »

trope wrote: Mon Sep 14, 2020 2:34 pm
pbear wrote: Tue Sep 08, 2020 11:40 pm FWIW, I maintain a set of shadow snapshots on flash drive, but prefer to run Timeshift separately for those. My reason is that I've noticed several threads where difficulty restoring seemed to be caused by an error in the snapshots themselves. My way, the shadow snapshots are independent. I don't try to keep the shadow snapshots super-current. Rather, I only update them at kernel updates, which generally is every few weeks.
What is a shadow snapshot? Can you provide a link or what software would I use for that?
Shadow snapshots is my own label. It's not an official term and I'm not using any special software, just Timeshift. What it means is that I have two sets of snapshots for the same system. As they're created separately and updated separately, a flaw in one isn't propagated into the other. "Shadow" is mostly meant to convey that the second set of snapshots isn't a dupe of the first. So, they're a backup in one sense, but not in another.

Main snapshots are stored on my internal drive, same disk as the system but a different partition. My schedule is four weekly plus five daily. Then, I have a flash drive for the shadow snapshots. (The flash drive also has the ability to boot a live session with persistence.) All these snapshots are done manually, what Timeshift calls On Demand. As mentioned above, I do these when there's a kernel update. Plug in flash drive; open Timeshift; go to Settings > Location; select the flash drive; close Settings. Now Timeshift displays the shadow snapshots, where before it was displaying the main ones. Delete the oldest snapshot; click Create to save a current one; label with the kernel number. Go back into Settings and restore Location to the internal Timeshift partition. Close Timeshift. Eject flash drive. YMMV, but I think that's pretty easy.

By the way, this system is flexible on how many shadow snapshots you keep. Basically, you're only limited by the size of the flash drive. At one point, out of curiosity, I had a full year of snapshots on a single flash drive (I've since pared it down to half-a-dozen). Old snapshots aren't worth much, so it makes sense to use a FIFO system, where the oldest is deleted each time a new one is created. Also, I do this with a flash drive because I find it convenient. You could do the same thing with a partition on a USB hard drive. Just bear in mind, wherever it is, the partition has to be formatted ext4.
Locked

Return to “Beginner Questions”