migrating to new disk - selinux problem?

Stephen Smalley sds at tycho.nsa.gov
Wed Feb 15 20:29:59 UTC 2006


On Wed, 2006-02-15 at 12:52 -0500, Stephen Smalley wrote:
> On Wed, 2006-02-15 at 15:25 +0100, Petr Fischer wrote:
> > I really don't want install fresh system on new disk (like windows
> > reinstalls... ugly... fusty...) - I need migration by transparent
> > filesystem way - and this didn't work - should I post to fedora-dev
> > list?
> > 
> > What about "cp -ax"? Is all (selinux) attributes really copied?
> 
> No.  You need cp --preserve=all to preserve SELinux attributes (or at
> least --preserve=context).  BTW, setfiles has an alternate root path
> option (-r /path/to/altroot) that can be used to label a filesystem
> under a different root, which can be helpful when constructing a root
> filesystem separate from the operational one.

Short form of --preserve=context is -c, so you could do e.g.
	cp -acx /path/to/old /path/to/new

-- 
Stephen Smalley
National Security Agency




More information about the fedora-list mailing list