Solved

move /usr to its own slice.

Posted on 2002-04-23
9
377 Views
Last Modified: 2010-04-21
What is the best way to move /usr to its own slice?
0
Comment
Question by:pshirmey
9 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 6964398
This is something that is best done wile in single user mode and the tool of choice is dump (or ufsdump on Solaris). Assuming that the new location for /usr already has had a filesystem made on the slice you'd do something like:

# mount /dev/??? /mnt
# cd /mnt
# dump 0f - /usr | restore rf -

Some implementations of dump don't allow for one to specify other that a mount point as the source. For those systems tar is appropriate, as in:

# mount /dev/??? /mnt
# cd /usr
# tar cf - . | (cd /mnt; tar xpf -)

When the copy is finished modify /etc/fstab or /etc/vfstab as appropriate to mount the new location of /usr. To keep from covering the space that usr is currently occupying, so you can delete the contents, rename /usr to be /old-usr. Then reboot and when you see that everything works 'rm -r /old-usr'.
0
 
LVL 3

Expert Comment

by:elfie
ID: 6964915
if you want to have a short 'down' time.

you can first copy data using "cpio -pvdum".

Then going for the single user mode and use "cpio pvdm" to copy over the modified files.

Don't forget to the fstab/vfstab or volume group definitions.
0
 
LVL 1

Expert Comment

by:stan64
ID: 6965940
use cpio over tar because tar will not take the empty directories.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 6966028
If you have a tar that doesn't handle empty directories, then you have a broken tar implementation. Handling empty directories is required in a sparsely populated directory tree and if the empty directories can't be stored in the archive and extracted then that implementation of tar is simply broken and not usable.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:pshirmey
ID: 6966664
Okay,  I did the ufsdump and ufsrestore to the new slice, and that worked great!  But the /mnt now has a file "restoresymtable" and a usr directory.  So if I mount the slice to /usr the effective path to usr is /usr/usr.

Thanks for all the help so far!
0
 

Author Comment

by:pshirmey
ID: 6966730
Okay,  I did the ufsdump and ufsrestore to the new slice, and that worked great!  But the /mnt now has a file "restoresymtable" and a usr directory.  So if I mount the slice to /usr the effective path to usr is /usr/usr.

Thanks for all the help so far!
0
 
LVL 40

Expert Comment

by:jlevie
ID: 6966977
No problem... you can remove the restoresymtable file and then do:

cd /mnt
mv usr/* .
rmdir usr
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 6967034
%listening
0
 

Author Comment

by:pshirmey
ID: 6967166
Thanks for all your help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now