So, back to the original question: what in the world am I supposed to
do to have rsync copy so that the size change in the two drives is
equal, and DRIVE2 has (theoretically) the same data, taking up the same space, as DRIVE1?
-----------------------------------------------------------------------
BTW, I forgot to mention, FWIW, that the Borgbackup and rsnapshot
backups are of /home/user and its subdirectories only. Everything else
(all the system stuff) is backed up using Timeshift. The Timeshift
data, like everything else, is part of the stuff on DRIVE1.
Hi Andy!
Thanks for the reply.
I may just delete everything on DRIVE2 overnight,
So, back to the original question: what in the world am I supposed to
do to have rsync copy so that the size change in the two drives is
equal, and DRIVE2 has (theoretically) the same data, taking up the
same space, as DRIVE1?
Hi!
I have two identical 4Tb usb external drives, Western Digital Model WDC WD40NDZW-11A8JS1. My computer is a Dell Inspiron 15 3000 Model 3511 (a
very modest laptop), from early 2024, running Debian 12 Stable, always
kept updated.
The first drive, Drive 1, is my "backup drive". I backup daily using Borgbackup Version 1.2.4 from the Debian Stable repositories, and rsnapshot Version 1.4.5-1, also from the Debian Stable repositories.
It also has a whole bunch of other archival programs, data and image
files on it as well.
sudo df -h /media/user/DRIVE1
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 3.6T 1.5T 2.0T 42% /media/user/DRIVE1
sudo du -sh /media/user/DRIVE1
1.5T /media/user/DRIVE1
I am trying to use the other drive, DRIVE2, as an exact copy of DRIVE1 (except for the unused space on the drive). The only difference between
the two drives is that I just re-formatted DRIVE2 and set it up so that
the disk is now LUKS 1 encrypted.
sudo df -h /media/user/DRIVE2
Filesystem Size Used Avail
Use% Mounted on
/dev/mapper/luks-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 3.6T 1.2T 2.3T
35% /media/user/DRIVE2
sudo du -sh /media/user/DRIVE2
1.2T /media/user/DRIVE2
Every night, I have been using rsync to copy from DRIVE1 to DRIVE2,
doing:
time sudo rsync -avvv --human-readable --delete --numeric-ids --info=progress2,stats2,name2 -- exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media
/*",
"/lost+found"} /media/user/DRIVE1/ /media/user/DRIVE2/ ; date
And each time, DRIVE2 would be using more and more space, much more
than DRIVE1!
Finally, I decided to re-format DRIVE2 and set it up for LUKS. Then I
tied again to use rsync to write everything from DRIVE1 to DRIVE2, all
at once. It ran for 39 hours, using more and more space until it ran
out of space, without finishing.
So, I deleted everything from DRIVE2 (which surprisingly took many
hours), keeping it set up for LUKS, and used rsync again to copy
everything from DRIVE1 to DRIVE2, this time trying:
time sudo rsync -aHAXUSxvvv --human-readable --delete --numeric-ids -- info=progress2,stats2,name2 -- exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media /*","/lost+found"} /media/user/DRIVE1/ /media/user/DRIVE2/ ; date
which again took many hours, so it was done over multiple sessions.
(BTW, I don't know if the -U option helps; it may just screw things
up.)
Now, DRIVE2 is still using considerably LESS space than DRIVE1!
Is that due to using -H for hard links? Or -S for sparse files? Or
both? Or neither?
I have not yet done any further copying with rsync to see if the rate
of change to DRIVE1 and DRIVE2 will be equal. But I really doubt it.
So, back to the original question: what in the world am I supposed to
do to have rsync copy so that the size change in the two drives is
equal, and DRIVE2 has (theoretically) the same data, taking up the same space, as DRIVE1?
Hi, Eben!
I hate to sound stupid, but how would I do that. I have never used mkfs before.
Hi!
Every night, I have been using rsync to copy from DRIVE1 to DRIVE2,
doing:
time sudo rsync -avvv --human-readable --delete --numeric-ids --info=progress2,stats2,name2 -- exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media
/*",
"/lost+found"} /media/user/DRIVE1/ /media/user/DRIVE2/ ; date
And each time, DRIVE2 would be using more and more space, much more
than DRIVE1!
I've never used LUKS before, so we're even. With a non-encrypted
filesystem, you would
unmount the partition
mkfs -t whatever <other options> /dev/whatever
mount it again
I suggest that instead of using rsync directly you use rsnapshot. You
can set it up so that it only copies if DRIVE2 is there. The cron
entries let it happen automatically.
On Sun, 19 Jan 2025 at 02:51, Default User <hunguponcontent@gmail.com> wrote:
time sudo rsync -aHSxvvv --human-readable --delete --numeric-ids --
info=progress2,stats2,name2 --
exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media
/*","/lost+found"} /media/user/DRIVE1/ /media/user/DRIVE2/ ; date
Also, your use of --exclude looks completely wrong to me.
I do not see anything in 'man rsync' (version 3.2.7) that agrees with your use of brace characters {}.
In fact the manpage says: "--exclude options take one rule/pattern each",
as I have shown above, which is not what you have.
Em 19/01/2025 08:57, David escreveu:
On Sun, 19 Jan 2025 at 02:51, Default User <hunguponcontent@gmail.com> wrote:
time sudo rsync -aHSxvvv --human-readable --delete --numeric-ids -- info=progress2,stats2,name2 -- exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media /*","/lost+found"} /media/user/DRIVE1/ /media/user/DRIVE2/ ; date
In fact the manpage says: "--exclude options take one rule/pattern each", as I have shown above, which is not what you have.
That's a shell feature, it will expand to multiple --exclude options.
And for those specific exclusions (except /lost+found), --one-file-system is probably even better, unless there is a second filesystem mounted somewhere inside /media/user/DRIVE1 (which seems unlikely).
I would have recognised this
echo a{1..5}b
as brace expansion, but I hadn't absorbed the extra glorious
capabilities of its commas.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 154:58:39 |
Calls: | 10,383 |
Files: | 14,054 |
Messages: | 6,417,848 |