Does rsync -D preserve the root partition uuid in fstab?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.