Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

move /usr to its own slice.

Posted on 2002-04-23
9
Medium Priority
?
387 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 400 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
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.

721 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