Welcome to the Linux Foundation Forum!

Lab 32.1 issue with diff

Hi,

In the lab 32.1, diff claims that the directory doesn't exist with some python related message. However it actually exists:

┌──(alu@nb)-[/tmp]
└─$ ls restore/
include

┌──(alu@nb)-[~]
└─$ diff -r /tmp/restore/include/ /usr/include/
diff: /tmp/restore/include/python3.11/numpy: No such file or directory

I tried the diff command with two test dirs without an issue:

┌──(alu@nb)-[/tmp]
└─$ ls test1 test2
test1:
sub1  test.txt

test2:
test.txt

┌──(alu@nb)-[/tmp]
└─$ diff -r /tmp/test1 /tmp/test2
Only in /tmp/test1: sub1
diff '--color=auto' -r /tmp/test1/test.txt /tmp/test2/test.txt
1d0
< xxx

So, the diff command as such works as expected.

Where does this issue come from?

Thanks,
Urs

Answers

  • Hi Urs,

    I checked on the labs file and Lab 32.1 is about another thing. Are you sure about the chapter and section?

    Regards,
    Luis.

  • albiurs
    albiurs Posts: 51

    Hi Luis,

    Yes, it's about backup and restore with tar. At the very end of Lab 32.1, step 4:
    "4. Compare the contents with the original directory the archive was made from."

    diff is used to compare the contents of the original /usr/includes directory, with the restored one. The solution suggests:
    $ diff -qr include /usr/include

    Regards,
    Urs

  • albiurs
    albiurs Posts: 51

    @albiurs said:
    Hi Luis,

    Yes, it's about backup and restore with tar. At the very end of Lab 32.1, step 4:
    "4. Compare the contents with the original directory the archive was made from."

    diff is used to compare the contents of the original /usr/includes directory, with the restored one. The solution suggests:
    $ diff -qr include /usr/include

    Regards,
    Urs

    ...This is the Link to the Lab:
    https://trainingportal.linuxfoundation.org/learn/course/linux-system-administration-essentials-lfs207/backup-and-recovery-methods/lab-exercises?page=1

  • Hi Urs,

    I got it. So, I went over Lab 32.1 on Ubuntu 24.04 and it worked fine for me. The diff tool didn't report any issue and the output for the command was empty, as expected:

    ubuntu@master:/tmp/backup/restore/usr$ diff -qr include/ /usr/include/
    ubuntu@master:/tmp/backup/restore/usr$

    Per the man page, the 'q' parameter reports only when files differ. And 'r' is for 'recursive'.

    What OS and version are you using?

    Regards,
    Luis.

  • albiurs
    albiurs Posts: 51
    edited November 13

    Hi Luis,

    I'm on Debian 12:

    ┌──(alu@nb)-[~]
    └─$ cat /etc/os-release 
    PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
    NAME="Debian GNU/Linux"
    VERSION_ID="12"
    VERSION="12 (bookworm)"
    VERSION_CODENAME=bookworm
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"
    
    ┌──(alu@nb)-[~]
    └─$ uname -a
    Linux nb 6.1.0-27-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1 (2024-11-01) x86_64 GNU/Linux
    

    I just tried it again with the same python error on this system. But now I also tried it on a Ubuntu VM where I don't get this error too. So I think it must be an issue of my Debian machine...

    By the way what means:
    #1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1?

    Thanks,
    Urs

  • Hi Urs,

    I just tried it again with the same python error on this system. But now I also tried it on a Ubuntu VM >where I don't get this error too. So I think it must be an issue of my Debian machine...

    Yep, it seems to be related to that system or that OS/version in particular.

    By the way what means:

    1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1?

    It indicates that the kernel has support for SMP dynamic preemption.

    Regards,
    Luis.

Categories

Upcoming Training