Solved

move /usr to its own slice.

Posted on 2002-04-23
9
386 Views
Last Modified: 2010-04-21
What is the best way to move /usr to its own slice?
0
Comment
Question by:pshirmey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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
 

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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

632 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