Quote:>If I have a Solaris 8 server that has /usr locally on the / partition and
>I want to use some free space on the disk to create a /usr partition - how
>do I do this and have the contents of the / partitions /usr copied to the
>/usr partition?
Are you sure this is what you want to do? What else is in the root filing
system at the moment? It might well be better to pick something other than
/usr to move, as it's not exactly the easiest choice.
However, if you are sure, read on ...
Quote:>Is it just a case of creating the new partition within the "format" command,
>adding an entry in /etc/vfstab, and cpio'ing the files to the new /usr - my
>worry is there will be two /usr paths.
1. Make the new partition with "format", and build a new filing system
in it with "newfs". Then mount it as "/mnt" (say).
2. Copy the contents of /usr to /mnt. You could use cpio as you suggest,
although personally I would rather use a ufsdump | ufsrestore pipe.
You can probably do this part during normal running, as the contents
of /usr will not be changing.
3. Boot single-user. Add the new partition to /etc/vfstab as /usr.
4. Scary bit: "mv /usr /usr.old" and "/sbin/mount /usr". (You are
temporarily without /usr/lib there, so need to use a statically
linked mount program. Be prepared to boot from CDROM to sort
things out if you make a mistake.)
5. Test a few things, then reboot multi-user.
6. If everything works, and after you have taken backups of the new
filing systems, you can "rm -r /usr.old" to recover the space in
the root filing system.
Chris Thompson
Email: cet1 [at] cam.ac.uk