SMB and BackupPC on Ubuntu 12.04

Update 2013-10-02: This issue has been resolved with BackupPC 3.3.0.

A number of people of reported issues backing up Windows hosts with SMB and BackupPC 3.2.1 on Ubuntu 12.04 precise. This is caused by a bug in Samba/smbclient since 3.6.x where excluded directories are still listed (even if they won’t be backed up). It has not yet been fixed, but there is a workaround: downgrade Samba to 3.5.x.

After some discussion in my last BackupPC post, I built Samba 3.5.11~dfsg-1ubuntu2.3 from Ubuntu 11.10 oneiric for precise using pbuilder.

You can now work around this problem by adding my repository to your BackupPC server and running:

sudo apt-get update
sudo apt-get install smbclient=2:3.5.11~dfsg-1ubuntu2.3 samba-common=2:3.5.11~dfsg-1ubuntu2.3 samba=2:3.5.11~dfsg-1ubuntu2.3 libwbclient0=2:3.5.11~dfsg-1ubuntu2.3 samba-common-bin=2:3.5.11~dfsg-1ubuntu2.3
echo "smbclient hold" | sudo dpkg --set-selections

This will downgrade smbclient and its dependencies, and mark them held so APT won’t attempt to upgrade them.

The following Samba packages have been added to the precise repository, all version 3.5.11~dfsg-1ubuntu2.3, for amd64 and i386.

  • libwbclient0
  • libwbclient-dev
  • samba
  • samba-common
  • samba-common-bin
  • samba-dbg
  • samba-doc
  • samba-doc-pdf
  • samba-tools
  • smbclient
  • swat
  • winbind

Thanks to Mike Lerley for reporting this issue and helping test the workaround.

Tags: , , , , ,

  1. Brad Morgan’s avatar

    It may not be a “bug” in the smbclient. I believe the following from http://www.samba.org/samba/history/samba-3.6.0.html may be relevant. Note: I was unable to get my BackupPC working with the suggested option.

    Changed security defaults
    ————————-

    Samba 3.6 has adopted a number of improved security defaults that will
    impact on existing users of Samba.

    client ntlmv2 auth = yes
    client use spnego principal = no
    send spnego principal = no

    The impact of ‘client ntlmv2 auth = yes’ is that by default we will not
    use NTLM authentication as a client. This applies to the Samba client
    tools such as smbclient and winbind, but does not change the separately
    released in-kernel CIFS client. To re-enable the poorer NTLM encryption
    set ‘–option=clientusentlmv2auth=no’ on your smbclient command line, or
    set ‘client ntlmv2 auth = no’ in your smb.conf

    Reply

    1. Tyler Wagner’s avatar

      Thanks for that. So you tried adding “–option=clientusentlmv2auth=no” to SmbClientFullCmd and SmbClientIncrCmd, and it didn’t work?

      Does downgrading via my method above work for you? I’ve only got one data point saying it does, and it isn’t me.

      Reply

    2. Brad Morgan’s avatar

      Yes, adding the option as you described didn’t work for me.

      I “downgraded” the hard way by reinstalling the previous working version of Ubuntu server (11.10). My server is running under Hyper-V with a separate virtual disk for /var/lib/backuppc so other than the hassle of a fresh install, I’m back to a working state.

      I’ll think about upgrading the OS again and then applying your downgrade, but it won’t happen right away. Your method would have been a lot easier than mine!

      Reply

    3. terii’s avatar

      Any ideas? Thanks.


      # apt-get install smbclient=2:3.5.11~dfsg-1ubuntu2.3
      Reading package lists… Done
      Building dependency tree
      Reading state information… Done
      Some packages could not be installed. This may mean that you have
      requested an impossible situation or if you are using the unstable
      distribution that some required packages have not yet been created
      or been moved out of Incoming.
      The following information may help to resolve the situation:

      The following packages have unmet dependencies:
      smbclient : Depends: samba-common (= 2:3.5.11~dfsg-1ubuntu2.3) but 2:3.6.3-2ubuntu2.2 is to be installed
      E: Unable to correct problems, you have held broken packages.


      # apt-get remove samba-common
      Reading package lists… Done
      Building dependency tree
      Reading state information… Done
      The following packages were automatically installed and are no longer required:
      ttf-dejavu-extra libio-dirent-perl rrdtool linux-headers-3.2.0-24 libtime-modules-perl libarchive-zip-perl libdbi1 librrd4 linux-headers-3.2.0-24-generic
      libfile-rsyncp-perl ttf-dejavu
      Use ‘apt-get autoremove’ to remove them.
      The following packages will be REMOVED:
      backuppc samba-common samba-common-bin smbclient
      0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
      After this operation, 63.4 MB disk space will be freed.
      Do you want to continue [Y/n]? n
      Abort.

      Reply

      1. Tyler Wagner’s avatar

        Ok, we need to specify more package=version lines. Try this:

        apt-get install smbclient=2:3.5.11~dfsg-1ubuntu2.3 samba-common=2:3.5.11~dfsg-1ubuntu2.3 samba=2:3.5.11~dfsg-1ubuntu2.3 libwbclient0=2:3.5.11~dfsg-1ubuntu2.3 samba-common-bin=2:3.5.11~dfsg-1ubuntu2.3

        If it works, please provide your final command and I’ll update the post.

        Reply

      2. Joe’s avatar

        From that command I get:

        E: Version ‘2:3.5.11~dfsg-1ubuntu2.3’ for ‘smbclient’ was not found
        E: Version ‘2:3.5.11~dfsg-1ubuntu2.3’ for ‘samba-common’ was not found
        E: Version ‘2:3.5.11~dfsg-1ubuntu2.3’ for ‘samba’ was not found
        E: Version ‘2:3.5.11~dfsg-1ubuntu2.3’ for ‘libwbclient0’ was not found
        E: Version ‘2:3.5.11~dfsg-1ubuntu2.3’ for ‘samba-common-bin’ was not found

        Reply

        1. Joe’s avatar

          disregard this.

          Didn’t see the bit about adding your repo.

          Reply

        2. David’s avatar

          Hi There

          The downgrading works well, thanks.
          The line to “hold” the updates needs to be changed to:

          echo “smbclient hold” | sudo dpkg –set-selections

          It as missing an ‘-‘ before the set-selections.

          Reply

        3. David’s avatar

          The ‘–‘ get converted to a single –

          Reply

          1. Tyler Wagner’s avatar

            I cannot tell you how tired I am of that little wordpress “feature”. Hulk smash!

            I’ve corrected the post, thanks!

            Reply

          2. Priit’s avatar

            Thank You

            This also solved a problem where backuppc would not work with paths that have spaces in them.

            Reply

          3. Mikko Kortelainen’s avatar

            This is great, thank you so much for providing these packages!

            Reply

            1. Tyler Wagner’s avatar

              I just read your blog and discovered Crayon. Thanks so much, this is awesome!

              Reply

            2. Tom’s avatar

              Thanks a million for providing these packages. I spent many hours trying to work around the problems described above. Applying your fix took all of five mins!

              Reply

Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.