Backup /usr files (permissions?), repartition, restore?

Backup /usr files (permissions?), repartition, restore?

Post by MH » Mon, 07 Aug 2000 04:00:00



I need to increase the size of my /usr partition.  I performed a backup
of /usr to a drive on another machine using cp -a.  I noticed "unable to
perform operation" errors as the files were being copied.  I assume this
has to do with file permissions, since most files in /usr are owned by
root.  I noticed that the user:group identies on the backup files had
been reset to large numeric values.  I presume this is some sort of
default behaviour.

My question is this:  Can I safely delete my existing /usr partition and
restore all the files from backup to a new, larger /usr partition?  If
not, how do I accomplish resizing the /usr partition without having to
reinstall my entire system?

TIA

--
"For it is the natural tendency of the ignorant to believe what is not
true.
In order to overcome that tendency it is not sufficient to exhibit the
true;
it is also necessary to expose and denounce the false."

                                        -- H. L. Mencken

 
 
 

Backup /usr files (permissions?), repartition, restore?

Post by <jos.. » Tue, 08 Aug 2000 04:00:00


NO!!! ( capitals intensionally used as in a * curdling scream)

cp has an option to preserve the user/group id's. It's in the man page .
man cp at the xterm or the console

I only know of one way to do this :

as root, copy out the entire /usr tree ( with the option to preserve group
and owner data ) , tar and gzip it, and put it somewhere safe. Preferably
another hdd on another computer .You could even use samba and dump the file
on a w2k drive.
Then unmount the /usr partition, proced to delete it with fdisk. Make a new
one, and then use mke2fs .

mke2fs /dev/hda7

there may be options to mke2fs that I can't remember now ( did all this
about a year ago ), so consult the man pages on mke2fs before jumping in :)

After it has put in the ext2 file sytem, mount the partition as /usr, and
untar your backup into it .

Don't forget to go into /etc/fstab and change the entry for /usr to point to
the new partition number.

HTH
joseph

 
 
 

Backup /usr files (permissions?), repartition, restore?

Post by MH » Tue, 08 Aug 2000 04:00:00



> NO!!! ( capitals intensionally used as in a * curdling scream)

Thanks for the warning, but I was already concerned, which is why I
posted.

Quote:

> cp has an option to preserve the user/group id's. It's in the man page .
> man cp at the xterm or the console

I used cp -a which is supposed to retain owner/group/permissions,
symbolic links, and directory structure.  Unfortunately, it does not
appear that it actually does this--at least not when copying to another
machine.

Quote:> I only know of one way to do this :

> as root, copy out the entire /usr tree ( with the option to preserve group
> and owner data ) , tar and gzip it, and put it somewhere safe. Preferably
> another hdd on another computer .You could even use samba and dump the file
> on a w2k drive.

I've tried using tar before but have experienced very odd results such
as reporting files as "not found in archive" while clearly listing
them.  Also, reporting unmatched files when verifying.  Makes me very
uneasy, regardless of all the comments I've received to the effect "but
tar has been used reliably for years".
 
 
 

Backup /usr files (permissions?), repartition, restore?

Post by Prasanth A. Kum » Wed, 09 Aug 2000 04:00:00




> > NO!!! ( capitals intensionally used as in a * curdling scream)

> Thanks for the warning, but I was already concerned, which is why I
> posted.

> > cp has an option to preserve the user/group id's. It's in the man page .
> > man cp at the xterm or the console

> I used cp -a which is supposed to retain owner/group/permissions,
> symbolic links, and directory structure.  Unfortunately, it does not
> appear that it actually does this--at least not when copying to another
> machine.

I assume you are doing this as root because you cannot fully maintain
attributes as a normal user.

Quote:

> > I only know of one way to do this :

> > as root, copy out the entire /usr tree ( with the option to preserve group
> > and owner data ) , tar and gzip it, and put it somewhere safe. Preferably
> > another hdd on another computer .You could even use samba and dump the file
> > on a w2k drive.

> I've tried using tar before but have experienced very odd results such
> as reporting files as "not found in archive" while clearly listing
> them.  Also, reporting unmatched files when verifying.  Makes me very
> uneasy, regardless of all the comments I've received to the effect "but
> tar has been used reliably for years".

--
Prasanth Kumar

 
 
 

Backup /usr files (permissions?), repartition, restore?

Post by <jos.. » Wed, 09 Aug 2000 04:00:00


Strange.
I had a 500 MB drive slowly filling up . So I moved everything onto a 2.5
GIG drive using cp. For the first 2 minutes, I was hand copying files and
changing the user and group ID's . Then I got tired of it and checked the
man pages.

I moved all of it into new partitions using cp , and all I had to do was
a) /etc/fstab had to be changed .
b) Rerun lilo for the new drive.

Of course, the computer was in *single user* mode while all this was done.

 
 
 

Backup /usr files (permissions?), repartition, restore?

Post by MH » Wed, 09 Aug 2000 04:00:00



> > I used cp -a which is supposed to retain owner/group/permissions,
> > symbolic links, and directory structure.  Unfortunately, it does not
> > appear that it actually does this--at least not when copying to another
> > machine.

> I assume you are doing this as root because you cannot fully maintain
> attributes as a normal user.

Yes.
 
 
 

Backup /usr files (permissions?), repartition, restore?

Post by MH » Wed, 09 Aug 2000 04:00:00



> Strange.
> I had a 500 MB drive slowly filling up . So I moved everything onto a 2.5
> GIG drive using cp. For the first 2 minutes, I was hand copying files and
> changing the user and group ID's . Then I got tired of it and checked the
> man pages.

> I moved all of it into new partitions using cp , and all I had to do was
> a) /etc/fstab had to be changed .
> b) Rerun lilo for the new drive.

> Of course, the computer was in *single user* mode while all this was done.

I suspect you had no problem because you were copying to <the same
box>.  I'm trying to copy to a <different> box.