Solved

move /usr to its own slice.

Posted on 2002-04-23
9
382 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LastLogonTimeStamp Attribute 7 49
Most secure Linux or x86 Unix that are least prone to ransomware/malware 24 180
Python Assistance 7 97
aix unix tar error 3 89
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

738 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