Solved

move /usr to its own slice.

Posted on 2002-04-23
9
376 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
Comment Utility
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
Comment Utility
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
Comment Utility
use cpio over tar because tar will not take the empty directories.
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:pshirmey
Comment Utility
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
Comment Utility
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
Comment Utility
No problem... you can remove the restoresymtable file and then do:

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

Expert Comment

by:vinnyd79
Comment Utility
%listening
0
 

Author Comment

by:pshirmey
Comment Utility
Thanks for all your help!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

743 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