Skip to content

rear configured with netfs backup deletes other folders on NFS at failure #465

@andreas-tarp

Description

@andreas-tarp

Hi,

when configuring rear with BACKUP=NETFS and NETFS_URL=... pointing to a folder not only containing backups of one single node, but other data (like backups of other nodes) rear can delete all files on the NFS location when cleaning up tmp directories. Here the scenario to reproduce:

  1. rear version Relax-and-Recover 1.16.1 (on SLES 11.3)
  2. configure rear with BACKUP=NETFS and NETFS_URL point to a directory which is not empty, so used for example by other machines to store also their backups
  3. login via ssh to the machine to be backed up
  4. start to create a backup with "rear -v mkbackup" and wait until rear shows progress about files system backup on terminal (something like "Archived 434 MiB [avg 8722 KiB/sec]")
  5. loose connection to your machine (either by fault or use "kill PID" where PID is the PID of your ssh session
  6. rear now recognizes that the session died
    (Log entry in rear-.log:
    /usr/share/rear/lib/_input-output-functions.sh: line 1: 38654 Hangup)
  7. rear now tries to unmount the NFS share, but this fails unfortunately as most likely still some data is transferred
    (Log entry in rear-.log:
    ++++ umount -f -v /tmp/rear.ZsnBUJDGiKeYRNw/outputfs
    .....................
    umount2: Device or resource busy)
  8. rear ignores the umount problem and forces removal of "temp" data
    (Log entry in rear-.log:
    2014-09-24 16:56:43 Removing build area /tmp/rear.ZsnBUJDGiKeYRNw
    ++++ rm -Rf /tmp/rear.ZsnBUJDGiKeYRNw/tmp
    ++++ rm -Rf /tmp/rear.ZsnBUJDGiKeYRNw/rootfs
    ++++ rm -Rf /tmp/rear.ZsnBUJDGiKeYRNw/outputfs)
  9. result is that all folders on NFS directory mounted by rear are gone (so also the ones not created by rear)

In my point of view this is a very nasty behaviour. Rear should not cleanup outputfs folder when NFS unmount fails.

Workaround is to point NETFS_URL= to a dedicated directory on NFS to ensure that rear can only delete backups of that single node.

Edit: I have a rear-.log with debugscript mode enabled. Unfortunately I can not attach it, github only accepts images?

Edit 2: Besides this rear works like a charm on HP DL380G8 servers running SLES 11.3. Thanks a lot for the great tool.

BR, Andreas

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions