Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing nfs mountpoint after the recovery #818

Closed
pavoldomin opened this issue Apr 11, 2016 · 8 comments
Closed

missing nfs mountpoint after the recovery #818

pavoldomin opened this issue Apr 11, 2016 · 8 comments
Assignees
Labels
bug The code does not do what it is meant to do fixed / solved / done support / question
Milestone

Comments

@pavoldomin
Copy link
Contributor

Relax-and-Recover (rear) Issue Template

After the recovery mountpoints for NFS mounts are missing. This will make nfs shares not mounted after the recovery (if they are referenced from fstab). Related to #619.

Particularly, in prep/default/40_save_mountpoint_details.sh, the collection of nfs mountpoints is explicitly excluded.
I assume there is reason for it, but cannot figure out which.

Work-around is trivial: mkdir manually.

@gdha
Copy link
Member

gdha commented Apr 14, 2016

Hi Pavol - good question: what was the reason? I cannot remember - is there any?
@rear/owners What are your thoughts?

@jsmeix
Copy link
Member

jsmeix commented Apr 15, 2016

Because in prep/default/40_save_mountpoint_details.sh
there are no comments that explain why certain
things are excluded from the "mount" output,
nobody (except the one who made that code ;-)
can know about the reasoning behind.

Regardless of the reasoning behind I think the command

... mount | grep -vE '(cgroup|fuse|nfs|/sys/|REAR-000)' ...

is wrong because it excludes any "mount" output line
that contains anywhere e.g. "nfs" (i.e. much more
than to exclude only "mount" output lines where
the mounted filesystem type is "nfs".

In general I wonder if a hardcoded list of what should
be excluded is the right thing.

If something cannot be implemented in a hardcoded way,
I think the right way is to make it configurable by the user.

In this case e.g. via a array variable in default.conf that is
predefined with a list of what would be excluded by default.

@jsmeix
Copy link
Member

jsmeix commented Apr 15, 2016

FYI how one could exclude mounted filesystem types
by using the newer "findmnt" command and output only
the mountpoint directories, e.g.:

findmnt -nrv -o TARGET -i -t 'nfs,cgroup'

But "findmnt" is not available on older systems
so that rear may use mount as fallback as I did in
usr/share/rear/layout/save/GNU/Linux/23_filesystem_layout.sh

@didacog
Copy link
Contributor

didacog commented Apr 15, 2016

Hello!

Maybe with something like this should help:

mount -l -t "$(echo $(cat /proc/filesystems | grep -v nodev) | tr ' ' ',')"

And also works for older systems

@gdha
Copy link
Member

gdha commented Apr 19, 2016

@didacog nice trick.

However, it wouldn't fix the NFS mounted file-systems. Perhaps, to catch all mounted file-systems (including the NFS ones) a simple ls -ld $(mount | grep -vE '(cgroup|fuse|nfsd|/sys/|REAR-000)' | awk '{print $3}') could do the trick?
Only change nfs to nfsd and it is fixed IMHO

@jsmeix
Copy link
Member

jsmeix commented Apr 19, 2016

@pavoldomin
first and foremost I like to understand the actual issue here.

In your initial comment you wrote:

After the recovery mountpoints for NFS mounts are missing.
...
Work-around is trivial: mkdir manually.

Only a blind guess what I think the issue could be:

Usually directories should be restored from the backup.
In general what is not in the backup does not get restored.
Now I wonder why directories that are used as
mountpoints are not in the backup.
I guess that is because rear excludes for example
all what is mounted via NFS (because by default
files on remote systems should not be in the backup).
I assume when rear excludes sub-trees of the whole
tree of filesystems it also excludes their base directories
which is for NFS mounted stuff the mountpoint directory.

If my assumptions are true I wonder if it is really the
best way to deal with missing directories in the backup
by special scripts in rear for special cases when such
directories are used as mountpoints.

What about missing directories in the backup that are
not used as mountpoints?
For example how to exclude all content in /var/tmp
from the backup but keep the bare /var/tmp directory
in the backup?

Perhaps it would be better to improve how rear excludes
sub-trees of the whole tree of filesystems from the backup?

FYI:

I had the same issue for my #779
see #779 (comment)
and https://github.com/rear/rear/pull/784/files

When moving away restored files that should not have been restored
the base directory of that files is kept (e.g. useful to remove all content in /var/tmp but keep the /var/tmp directory).

@didacog
Copy link
Contributor

didacog commented Apr 19, 2016

@gdha thanks! ;)

If the problem is the exclude of basedir, maybe you can try using '/some_path/some_mount_point/*' in the exclude array definition, at least you can try using it as temporary workarround. :-P

@pavoldomin
Copy link
Contributor Author

Sorry, again the problem where this thread was found in trash :)

What is really happening here is, that /hana/shared contains nfs mountpoint referred from /etc/fstab, but as we exclude /hana/shared from the backup, mountpoint /hana/shared/SID is not created (and as a consequence application cannot start, because it environment links to that nfs mountpoint).

I think the solution above outlined by @gdha: ls -ld $(mount | grep -vE '(cgroup|fuse|nfsd|/sys/|REAR-000)' | awk '{print $3}') should work. Got a suspicion that it was actually meant like this in the first place :).

@gdha gdha added the bug The code does not do what it is meant to do label May 31, 2016
@gdha gdha self-assigned this May 31, 2016
@gdha gdha added this to the Rear v1.19 milestone May 31, 2016
gdha added a commit that referenced this issue Jun 27, 2016
(NFS mount points are not recreated after a recover)
@gdha gdha closed this as completed Aug 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do fixed / solved / done support / question
Projects
None yet
Development

No branches or pull requests

4 participants