FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 12-07-2007, 09:38 PM
"Tod Merley"
 
Default Best way to copy /usr to different partition?

On Dec 7, 2007 11:48 AM, Rick Stevens <rstevens@internap.com> wrote:
>
> On Fri, 2007-12-07 at 11:12 -0800, Daniel B. Thurman wrote:
> > Daniel B. Thurman wrote:
> >
> > >Sent: Thursday, December 06, 2007 7:31 PM
> > >To: Fedora-List (E-mail)
> > >Subject: Best way to copy /usr to different partition?
> > >
> > >I was getting dangerously close to running out of disk space
> > >since /usr was filling up fast.

> > It seems to me, that the only files I need to worry about are the above
> > libsysfs.so.1/2 needs to be relabeled and I am not sure what to do about
> > the /etc/resolv.conf file.
>
> The hard links to /etc/resolv.conf are typically somewhere in
> /etc/sysconfig/networking/profiles
>
> You can "ls -i /etc/resolv.conf" to get the inode of resolv.conf.
> Then "find /etc/sysconfig/networking -inum inode" to find the other
> hard links. Example on my laptop:
>
> [root@golem3 ~]# ls -l /etc/resolv.conf
> -rw-r--r-- 2 root root 75 2007-11-26 08:57 /etc/resolv.conf
> [root@golem3 ~]# ls -i /etc/resolv.conf
> 8389128 /etc/resolv.conf
> [root@golem3 ~]# find /etc/sysconfig/networking/profiles -inum 8389128
> /etc/sysconfig/networking/profiles/Office/resolv.conf
>
> You can delete the entry in the networking tree (in this case,
> /etc/sysconfig/networking/profiles/Office/resolv.conf), restorecon
> /etc/resolv.conf, then recreate the hard link.
>
> ----------------------------------------------------------------------
> - Rick Stevens, Principal Engineer rstevens@internap.com -
> - CDN Systems, Internap, Inc. http://www.internap.com -
> - -
> - IGNORE that man behind the keyboard! -
> - - The Wizard of OS -
> ----------------------------------------------------------------------
>
>
> --
> fedora-list mailing list
> fedora-list@redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>

Hi Rick Stevens and All!

For those like me whose "Education Continues" I note the following link:

http://linuxgazette.net/105/pitcher.html

One of the reasons I love this list is the practical education it facilitates!

Thanks!

Tod

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-07-2007, 09:44 PM
Karl Larsen
 
Default Best way to copy /usr to different partition?

Daniel B. Thurman wrote:

Tony Nelson wrote:


Sent: Friday, December 07, 2007 8:43 AM
To: fedora-list@redhat.com
Subject: Re: Best way to copy /usr to different partition?


At 10:43 PM -0500 12/6/07, Kevin J. Cummings wrote:


Daniel B. Thurman wrote:


I was getting dangerously close to running out of disk space
since /usr was filling up fast.

I thought it was simple to tar-copy /usr to a different


drive/partiton


using tar copy such as:

(cd /usr; tar cpf - .) | (cd /newpartition; tar xpf -)


using tar doesn't copy the extended attributes used by SELinux. ...


...

`man tar` shows the --xattrs and --no-xattrs options (though
`man tar` and
`info tar` don't say what the default is), so tar should work
for EAs if

used with --xattrs.
--
__________________________________________________ __________________
TonyN.:' <mailto:tonynelson@georgeanelson.com>
' <http://www.georgeanelson.com/>

--



I have discovered that using:

(cd /usr-b; tar -cp -xattrs -f - .) | (cd /usr; tar -xp --xattrs -f -)
OR
(cd /usr; cp -pR /usr-b/. .)

did not preserve the selinux attributes.

I have checked the attributes in /usr-b/lib/libsysfs* and
it has lib_t assigned to these files against the copied files
/usr/lib/libsysfs* and it shows default_t instead of lib_t.

This may mean that my entire /usr filesystem has improper
selinux attributes.

Can someone tell me how to copy the files from my original
/usr-b filesystem to /usr filesystem with the selinux attributes
intact?

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.16.17/1176 - Release Date: 12/6/2007 11:15 PM



I think the best thing from the selinux point of view is to turn off
selinux while doing the copy and then when done and checked out turn it
back on and wait while selinux re-inserts it's stuff.




--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-07-2007, 11:49 PM
"Daniel B. Thurman"
 
Default Best way to copy /usr to different partition?

Stephen Smalley wrote:
>Sent: Friday, December 07, 2007 1:17 PM
>To: For users of Fedora
>Subject: RE: Best way to copy /usr to different partition?
>
>
>On Fri, 2007-12-07 at 12:35 -0800, Daniel B. Thurman wrote:
>> Tony Nelson wrote:
>> >Sent: Friday, December 07, 2007 8:43 AM
>> >To: fedora-list@redhat.com
>> >Subject: Re: Best way to copy /usr to different partition?
>> >
>> >
>> >At 10:43 PM -0500 12/6/07, Kevin J. Cummings wrote:
>> >>Daniel B. Thurman wrote:
>> >>> I was getting dangerously close to running out of disk space
>> >>> since /usr was filling up fast.
>> >>>
>> >>> I thought it was simple to tar-copy /usr to a different
>> >drive/partiton
>> >>> using tar copy such as:
>> >>>
>> >>> (cd /usr; tar cpf - .) | (cd /newpartition; tar xpf -)
>> >>
>> >>using tar doesn't copy the extended attributes used by SELinux. ...
>> > ...
>> >
>> >`man tar` shows the --xattrs and --no-xattrs options (though
>> >`man tar` and
>> >`info tar` don't say what the default is), so tar should work
>> >for EAs if
>> >used with --xattrs.
>> >--
>> >_________________________________________________ ___________________
>> >TonyN.:' <mailto:tonynelson@georgeanelson.com>
>> > ' <http://www.georgeanelson.com/>
>> >
>> >--
>>
>> I have discovered that using:
>>
>> (cd /usr-b; tar -cp -xattrs -f - .) | (cd /usr; tar -xp
>--xattrs -f -)
>
>That's a bug - bugzilla it. Should work with --xattrs or --selinux.
>
>> OR
>> (cd /usr; cp -pR /usr-b/. .)
>
>Use cp -a; cp -p only deals with DAC perms.
>
>> did not preserve the selinux attributes.
>>
>> I have checked the attributes in /usr-b/lib/libsysfs* and
>> it has lib_t assigned to these files against the copied files
>> /usr/lib/libsysfs* and it shows default_t instead of lib_t.
>>
>> This may mean that my entire /usr filesystem has improper
>> selinux attributes.
>>
>> Can someone tell me how to copy the files from my original
>> /usr-b filesystem to /usr filesystem with the selinux attributes
>> intact?
>
>star is supposed to know how to handle xattrs.
>tar was patched in F8 but something seems amiss there.
>cp has support.
>Or you can just copy however you please and then perform a relabel,
>either by running fixfiles relabel manually or by touch /.autorelabel
>and reboot.
>
>--
>Stephen Smalley
>National Security Agency
>
>--

Whoa!

I tried cp -aR and guess what - it does not preserve the
selinux attributes.

Also - the hard links were not restored either - they appeared
as broken links (which is not unexpected, I think). At least
this is the long way of finding hard links, I think

When I tried the tar string mentioned above, it seems to also
reconstruct the hardlinks at the new partition area but of course
does not preserve the selinux attributes.

Seems that both the cp and the tar has the same problem of preserving
selinux attributes.

I think I will stick to tar and /.autorelabel.

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.16.17/1176 - Release Date: 12/6/2007 11:15 PM


--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 

Thread Tools




All times are GMT. The time now is 04:28 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org