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

Clarify --nobsdflags behavior #4489

Open
cruftex opened this issue Apr 3, 2019 · 7 comments

Comments

@cruftex
Copy link

commented Apr 3, 2019

It is unclear what file flags and attributes will be skipped from the backup when --nobsdflags is used. Does this option only affect BSD like systems, or is it about a certain subset of flags that are present on all filesystems?

@ThomasWaldmann

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

did you check the docs about this?

@cruftex

This comment has been minimized.

Copy link
Author

commented Apr 3, 2019

Yes, the most relevant I could find is:

--nobsdflags do not read and store bsdflags (e.g. NODUMP, IMMUTABLE) into archive

When I google "BSD flags" nothing relevant shows up. The term is not well defined.

Probably what is meant are the flags that are traditionally modified via the chflags command on BSD systems. See: https://en.wikipedia.org/wiki/Chattr
But that is just a guess.

Is it possible to include a list of the flags/attributes in the documentation?

@ThomasWaldmann

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

The name comes from mapping the linux flags to their equivalent on bsdish systems.

Linux:

https://github.com/borgbackup/borg/blob/1.2.0a5/src/borg/platform/linux.pyx#L125

All others:

https://github.com/borgbackup/borg/blob/1.2.0a5/src/borg/platform/base.py#L81

@cruftex

This comment has been minimized.

Copy link
Author

commented Apr 4, 2019

Thanks for the pointers. As I understand it now, its not about BSD flags but actually all FS file level flags.
What I read from the code and the Linux ioctl documentation:

borgbackup does backup flags on a file. On a Linux system not all flags that Linux or the file system supports are supported by borgbackup, but only a subset, which is: NODUMP, APPEND, COMPRESS and IMMUTABLE

The complete set of flags available in Linux is documented here: http://man7.org/linux/man-pages/man2/ioctl_iflags.2.html

In case the option --nobsdflags is specified, no flags are backed up at all and the ioctl that requests the flags is omitted.

The naming BSD / --nobsdflags is misleading, since it is actually not (only) about flags defined in BSD.

Since I know finally what to look for I found the documentation on flags in the general section:
https://borgbackup.readthedocs.io/en/stable/usage/general.html
From here I can understand, that borgbackup is calling it "BSD flags" since borgbackup did choose to use the BSD flags datastructure in the backup data and can therefore copy over the BSD flags as-is. Linux flags have to be translated, hence only a subset is supported. The term "BSD flags" is actually borgbackup internal.

Suggestions:

  • Rename option to "--noflags"
  • Refer to the general section about flags
  • Also support all Linux flags, by adding a copy of the ioctl result to the metadata and keep the BSD translation for compatibility between OSs
@ThomasWaldmann

This comment has been minimized.

Copy link
Member

commented Apr 4, 2019

Yes, --noflags might be less confusing.
Before changing anything related, we should do #3955 benchmarking.

Depending on the outcome we could:

  • deprecate --nobsdflags for borg 1.2, offer --noflags as the new name. completely remove --nobsdflags later.
  • deprecate/ignore --nobsdflags, don't need a new name in this case. completely remove option later. (this is for the case we do not find a significant performance difference on linux any more)

@ThomasWaldmann ThomasWaldmann added this to the hydrogen milestone Apr 4, 2019

@ThomasWaldmann

This comment has been minimized.

Copy link
Member

commented Apr 5, 2019

Currently it looks like we want to:

deprecate --nobsdflags for borg 1.2, offer --noflags as the new name. completely remove --nobsdflags later.

PRs welcome.

@ThomasWaldmann

This comment has been minimized.

Copy link
Member

commented Apr 5, 2019

Also: improve docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.