Bacula-users

Re: [Bacula-users] Linux: backup and restore of file capabilities ?

2012-01-02 16:35:52
Subject: Re: [Bacula-users] Linux: backup and restore of file capabilities ?
From: Marco van Wieringen <mvw AT planets.elm DOT net>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 2 Jan 2012 21:08:15 +0000 (UTC)
Wolfgang Denk <wd <at> denx.de> writes:

> 
> Dear Marco,
> 
> In message <loom.20120102T163316-867 <at> post.gmane.org> you wrote:
> >
> > > It appears that bacula does not save, and thus cannot restore, such
> > > file capabilities.
> > > 
> > Thats not really true. I did some searching on google to find out
> > how these so called POSIX file capabilities are implemented.
> > Its also quite new code it went into Linux 2.6.24 in may last year or so.
> 
> Hm... v2.6.24 is four years old...  Maybe you mean v2.6.34,
> and May 2010?
> 
No idea I'm not much into Linux these days the website describing
the info seems to indicate its in 2.6.24 and later if that's 4 years
old then it been there a bit longer only no one used it or nobody
did look at it.

> > Yup add acl = yes and xattr = yes to your fileset and you should
> > be set to backup most of the future options. Bacula is one of
> 
> Hm... I have these settings in the FileSet definition:
> 
>   Include {
>     Options {
>       signature = MD5
>       xattrsupport = yes
>       aclsupport = yes
>     }
>     File = /usr/bin
>   }
> 
> When restoring, the file attributes were lost anyway.
> 
Ok interesting.

> Is there any other place I need to give extra options?  When
> restoring?
> 
Nope when its saved it will be restored unless you restore
to a filesystem where no xattr can be restored. So restore
to a real filesystem not to things like ramfs etc because
those are known to be very limited.

> > the few Open Source backup products (probably the only)
> > which has very broad support for all these kind of exotic
> > acl's, extended attributes and extensible attributes. I had to
> > write everything from scratch as no other projects address all
> > know interfaces. So we are quite good in doing the exotic stuff.
> 
> Guess why I've been using bacula for so long...
> 
No idea I only have been for 3 years+ and the support was
only added in these 3 years before that the support was rather
sparse.

> And btw: thanks 
> 
> > We already found out that Novell uses extended attributes for
> > storing additional access control lists on there NSS filesystem.
> > And those also backup and restore fine with the generic xattr code.
> 
> I'm just a user of bacula, no developer of it, so I don't care much
> about the implementation or the interface. As long as the
> functionality is present and working I'm fine with it.
> 
But I do because I don't want to code and support code when
it not needed and we can use a generic support layer.

> > > Note that this is probably a bigger problem - it appears that
> > > neither cpio nor tar nor rsync etc. can deal with file capabilities.
> > > At the moment I don't know how to create a 100% correct backup of a
> > > plain vanilla Linux root filesystem...  
> > > 
> > If you look at the linked webpage you will see that rsync and cpio
> > have support for extended attributes and that is used to copy these
> > posix file capabilities.
> 
> In the linked PDF file I cannot find a reference to cpio or rsync.
> 
The PDF linked is about the NSS stuff the website linked has quite
some info on how they are implemented and how they are stored and retrieved
using normal tools like attr etc.

> But rsync does indeed work as needed when using -X.  Sorry, I missed that.
> 
Ok that is at least something as rsync uses the same interface
we use on Linux for extended attributes so either you are restoring
to a filesystem without xattr support or we are for whatever reason
not getting these xattr saved,

> The cpio in Fedora 16 does not appear to support this.
> 
> > So I would say give the xattr=yes a go on your install and see
> > if it works for these attributes. You could create a test fileset
> > with a known file with a posix file capability and run the bacula-fd
> > with a debug level of 100 and watch for xattr save messages.
> 
> Done that, but I could not see any.
> 
Ok, so its on Fedora 16 will install a VM then and see what
is going on in that respect. You got me curious on why the
xattr doesn't get saved.

> This is with bacula as distributed with Fedora 16, most recent
> updates installed:
> 
>       bacula-client-5.0.3-13.fc16.x86_64
>       bacula-common-5.0.3-13.fc16.x86_64
>       bacula-console-5.0.3-13.fc16.x86_64
>       bacula-console-bat-5.0.3-13.fc16.x86_64
>       bacula-director-common-5.0.3-13.fc16.x86_64
>       bacula-director-mysql-5.0.3-13.fc16.x86_64
>       bacula-docs-5.0.3-13.fc16.x86_64
>       bacula-storage-common-5.0.3-13.fc16.x86_64
>       bacula-storage-mysql-5.0.3-13.fc16.x86_64
> 
> Anything ales I could look for?
I guess its compiled with xattr support otherwise you
would get fatal errors on backup trying to enable xattrsupport.

I'll see if I can find something obvious, but as rsync works
I'm confident that we should just save them without additional code.

Marco


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users