How copy /usr contents to a new partition?

Parameshwara Bhat peebhat at gmail.com
Sun Jan 15 05:15:44 UTC 2006


> Message: 2
> Date: Fri, 13 Jan 2006 10:32:58 -0600
> From: Les Mikesell <lesmikesell at gmail.com>
> Subject: Re: How copy /usr contents to a new partition?
> To: For users of Fedora Core releases <fedora-list at redhat.com>
> Message-ID: <1137169978.25789.17.camel at moola.futuresource.com>
> Content-Type: text/plain
> On Fri, 2006-01-13 at 01:50, Parameshwara Bhat wrote:
>
>> I want to copy /usr to a new partition and then attach that at
> /usr. I
>> issued a command
>>
>> cp -options(recursive included) /usr /mnt/"mountpoint
>>
>> This resulted in the creation of a new "usr" directory under
>> /mnt/"mountpoint"/usr and contents of /usr went into sub-
> directories. What
>> I want is to copy all the subdirectories and files directly
> under /usr to
>> go at /mnt/"mountpoint" for obvious reasons. How do I do that?
> "Man cp"
>> did not give me any clue.
> I usually cd into the directory to be copied and use "." as
> the source:
> cd /usr
> cp -a . /mnt/mntpoint/usr
> since that eliminates the question of whether it will create
> a new directory under what you specify.
> Cp -a will take all the normal unix attributes (owner, modes,
> etc.)
> but not acls or the extended attributes for SELinux.  If you need
> those, I think the current version of dump |restore is supposed
> to get them, at least on ext3 filesystems.
>
>> Also, is there a command which compares each file under two
> directory
>> trees for difference.(I want to verify after the above
> operation)
> Rsync will work - and it can be used for the copy as well
> although
> it consumes a bit more memory than cp.
> cd /usr
> rsync -av . /mnt/mntpoint/usr
> if you repeat the rsync command it will check and update anything
> that doesn't match.  If you add -n it won't actually do the copy
> but because of the -v it will report the filenames that would
> be changed if you hadn't used -n.
I did cpio as explained in other replies to this thread and then

rsync -avl between the /usr and mount point directories and nthen 'diff'ed  
between them. The diff reports some 'no such files', but they are all  
symlinks in the destination directory which point to /bin,/sbin and get  
corrected when the partition gets attached at /usr.

So far so good.Nothing seems to be amiss. Even Nautilus reports exact same  
number of files and bytes.

But, when I attach the partition at /usr and login in GUI, Gnome gives an  
error message 'no volume controls/devices were found'. But,then sound is  
available and kmix shows all the mixer controls. It is only the Gnome  
volume control applet which fails.Rest all appear to be alright.

I first did all the exercise from within GNOME-Gui and then outside of  
this in root console thinking an open file may not get copied  
correctly.Still the result is same.Any idea as to what could be wrong?

Parameshwara Bhat



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/




More information about the fedora-list mailing list