Now lets see if I have done everything right. At the command prompt:
# df -h   <---This the command
Filesystem    Size   Used  Avail Capacity  Mounted on <--Result
/dev/ad0s1a    97M    45M    44M    50%    /
/dev/ad0s1f   2.7G   2.0G   513M    80%    /usr
/dev/ad0s1e    19M    19M  -1.5M   108%    /var
procfs        4.0K   4.0K     0B   100%    /proc
/dev/ad1s1e   5.8G   1.0K   5.4G     0%    /newusr
I can see the second hard drive is now being recognized. I know need to move stuff over. At the command prompt:
# cp -Rpv /usr/* /newusr/
Let me help explain what is going on here. If you have no DOS background this is going to seem weird. 
If you do have a DOS background you get the idea.
cp  is a command for "copy" . You are telling the system I want a duplicate of something.
-R  (Recursive) everything follows the lead step. First Step 1, then Step 2 and so on.
-p  (preserve) user Id's system modifications a the little touches that customized you setup. 
If not they will default back to original settings.
-v  (verbose) The DOS equivalent of @echo on. It basically lets things scroll across 
the screen as they are being done. Most DOS users @echo off. You don't see what is going on. 
/usr/ the original or source directory where things are being copied from.
*    copy everything. This sometimes called a wildcard. It basically means I want it all.
/newusr/  The place where everything is going.
I have 2 gigs worth of information being moved to the new hard drive. I have a 200mhz cpu and 24mb of RAM. What does this mean.
It means that this copying of files is going to take a while. A couple of hours to be specific. If you have a faster machine with more RAM
this will happen faster. Fortunately BSD run very nicely on older boxes like mine. If the copy process goes well when it is finished it will
come back to a command prompt with no error messages.
#
If you get error messages you may have a corrupt file and bigger issues than I can deal with here.
Now that everything has been copied over we have to eliminate the old /usr directory. I copied all that to the new hard drive and so I
don't need it there anymore. I will expand the /var directory into the old /usr directory. Let me check to make sure everything copied:
# df -h   <---This the command
Filesystem    Size   Used  Avail Capacity  Mounted on <--Result
/dev/ad0s1a    97M    45M    44M    50%    /
/dev/ad0s1f   2.7G   2.0G   513M    80%    /usr
/dev/ad0s1e    19M    19M  -1.5M   108%    /var
procfs        4.0K   4.0K     0B   100%    /proc
/dev/ad1s1e   5.8G   2.2G   3.1G    41%    /newusr
I know I have typed in this df -h command before basically it is this:
df  display free disk space
-h  this switch basically allows for Human readable output. It means display 
it in a way a human can understand it.
Lets see what I have in the directory.
# ls /usr
 X11R6   compat  home    lib     libexec obj     sbin    src     tmp
 bin     games   include libdata local   ports   share   sup
 
That is the original directory. Now look at the new one:
# ls /newusr
 X11R6   compat  home    lib     libexec obj     sbin    src     tmp
 bin     games   include libdata local   ports   share   sup
 
 ls   is a list command. It displays files and directories.
 /var is the directory I want the contents of.
The sub directories match so everything seems pretty cool. Now I need to change the name of the /newusr directory to /usr and tell
the OS to look at the new one and not the old one.
# ee /etc/fstab
Lets understand what I am doing here: ee this opens easy editor. This is an editing program, kinda like notepad. No special features
nothing real fancy. There are a lot of other editors out there from pico to vi. Right now I am keeping things simple. They will get more
complicated as time goes by.
/etc/  The directory where the file is kept.
fstab  This takes those mount points and mounts them. In a way it is a kinda startup folder 
for directories.This is going to mount the directory for the swap ,/var, /usr, and others 
I mentioned earlier.

I want to tell it to go to the new hard drive and tell it that /usr is there now.
fstab

I am changing this line:

/dev/ad0s1f             /usr            ufs     rw              2       2
So that it looks like this:

/dev/ad1s1e             /usr            ufs     rw              2       2
fstab edited

Now I exit out of ee by pressing ESC. Choose leave editor.

exit ee

And save the changes.

save changes

Basically now I have told the OS to rename /newusr to /usr and look for it on the second hard drive. Now comes the scary part.
Back Home Next Page Deleting the directory

Valid HTML 4.0!