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:

  1. ┌──(alu@nb)-[/tmp]
  2. └─$ ls restore/
  3. include
  4.  
  5. ┌──(alu@nb)-[~]
  6. └─$ diff -r /tmp/restore/include/ /usr/include/
  7. diff: /tmp/restore/include/python3.11/numpy: No such file or directory

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

  1. ┌──(alu@nb)-[/tmp]
  2. └─$ ls test1 test2
  3. test1:
  4. sub1 test.txt
  5.  
  6. test2:
  7. test.txt
  8.  
  9. ┌──(alu@nb)-[/tmp]
  10. └─$ diff -r /tmp/test1 /tmp/test2
  11. Only in /tmp/test1: sub1
  12. diff '--color=auto' -r /tmp/test1/test.txt /tmp/test2/test.txt
  13. 1d0
  14. < xxx

So, the diff command as such works as expected.

Where does this issue come from?

Thanks,
Urs

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

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.

  • 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 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.

  • Posts: 51
    edited November 2024

    Hi Luis,

    I'm on Debian 12:

    1. ┌──(alu@nb)-[~]
    2. └─$ cat /etc/os-release
    3. PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
    4. NAME="Debian GNU/Linux"
    5. VERSION_ID="12"
    6. VERSION="12 (bookworm)"
    7. VERSION_CODENAME=bookworm
    8. ID=debian
    9. HOME_URL="https://www.debian.org/"
    10. SUPPORT_URL="https://www.debian.org/support"
    11. BUG_REPORT_URL="https://bugs.debian.org/"
    12.  
    13. ┌──(alu@nb)-[~]
    14. └─$ uname -a
    15. 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.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training