LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Does rsync -D preserve the root partition uuid in fstab? (https://www.linuxquestions.org/questions/linux-newbie-8/does-rsync-d-preserve-the-root-partition-uuid-in-fstab-4175732368/)

RTD777 01-02-2024 08:43 AM

Does rsync -D preserve the root partition uuid in fstab?
 
I have a few partitions. One is for my main OS installation, and a second is set aside as the destination for a backup of the main OS. I have a secondary OS set aside for maintenance purposes, with both of the aforementioned partitions mounted as /source and /dest respectively.

After a successful run of sudo rsync -av --del /source /dest I noticed that the fstab file in the copy has a different uuid for the root partition than the original, but, why?

Does it have anything to do with the -a argument being equivalent to -rlptgoD, with -D being --devices --specials?

I need to be sure I'm doing what I intend to do for this copy operation. Thanks in advance.

jailbait 01-02-2024 11:46 AM

Quote:

Originally Posted by RTD777 (Post 6474155)
I noticed that the fstab file in the copy has a different uuid for the root partition than the original, but, why?

Which file has the same uuid as the actual uuid on the partition?

rknichols 01-02-2024 08:29 PM

There is no way that rsync would know that some part of the file should be different in the source and destination. It either copies the file exactly or does not copy it at all. If the two files happen to have the same size and modification time, rsync will, in the absence of the "-c" (--checksum) option, believe that they are already identical and will not do a copy.

IsaacKuo 01-02-2024 08:43 PM

Yeah.

rsync treats /source/etc/fstab just like any other file. It does NOT examine the contents and adjust them in any way.

So, possible explanations include:

1) For some reason rsync is unable to overwrite /dest/source/etc/fstab and it already had some fstab file that was different. Note that rsync will complain about not being able to overwrite this file, so look out for such complaints in its visible output. (Remove the "v" flag if necessary to make it easier to see this complaint.)

2) Somehow you got mixed up and looked at fstab files from different locations. It happens to all of us sooner or later.

3) Somehow you got your head mixed up when you were reading the fstab files. The fstab files are actually the same, but somehow you got confused by looking at different parts of them or something. We've all been there.

But in any case, I would expect /source/etc/fstab to be identical to /dest/source/etc/fstab

IsaacKuo 01-02-2024 08:46 PM

BTW, if you want to NOT place the destination files in a subdirectory named "source", then you want something like:

sudo rsync -av --del /source/. /dest/

This is just one of those goofy things you gotta learn about rsync based on experience and/or experimentation.


All times are GMT -5. The time now is 03:03 AM.