LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-02-2024, 08:43 AM   #1
RTD777
LQ Newbie
 
Registered: Jan 2024
Posts: 1

Rep: Reputation: 0
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.

Last edited by RTD777; 01-02-2024 at 08:53 AM.
 
Old 01-02-2024, 11:46 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,341

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by RTD777 View Post
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?
 
Old 01-02-2024, 08:29 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
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.
 
Old 01-02-2024, 08:43 PM   #4
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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
 
Old 01-02-2024, 08:46 PM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] /dev/disk/by-uuid/<uuid here> does not exist and initramfs shell Mitt Green Linux - Kernel 4 08-03-2015 11:56 AM
[SOLVED] rsync -a does NOT seem to preserve permissions. (Oops ... yes it does!) pcardout Linux - Software 1 06-12-2011 05:24 AM
[SOLVED] How to mount by-uuid if the device won't show in /dev/disk/by-uuid untill after blkid /dev/sd* ? masmddr Linux - General 4 01-10-2011 07:38 PM
Change UUID - Edit UUID using the dd command GMHilltop Linux - Newbie 10 10-28-2010 07:39 PM
Volume has problems including no uuid in /dev/disk/by-uuid abejarano Linux - Hardware 3 12-31-2008 08:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration