Moving a subdirectory to another filesystem using symbolic links
Another way of expanding a filesystem is to use space located in another
filesystem. This can be accomplished using symbolic links.
For example, if you are running out of space on the root filesystem for
an application data files directory, you can use space located on a
secondary filesystem. As far as the application is concerned, the files
will still appear to reside in the root filesystem.
The procedure described here moves a subdirectory to another filesystem
and creates a symbolic link using this example:
Original location (path) of subdir tree:
New location (path) of subdir tree:
The original filesystem must be of type EAFS, HTFS,
The procedure is now complete. Whenever you change directory to
/usr/subdir, you will actually be in /d1/subdir
(assuming filesystem d1 is mounted).
Suspend operations on your system and bring it down to single-user mode.
Make a backup of your system, and verify the backup to make certain
it is valid.
Manually mount the secondary filesystem(s).
mount /dev/d1 /d1
Get current permissions of /usr/subdir:
ls -ld /usr/subdir
Create the new subdirectory in /d1:
Change destination directory owner, group,
permissions to match the original source:
chown owner /d1/subdir
chgrp group /d1/subdir
chmod permissions /d1/subdir
Copy /usr/subdir to /d1/subdir using these commands:
find . -depth -print | cpio -pdmv /d1/subdir
is used instead of a copy command to better retain permissions.
Verify that the copy is successful:
dircmp /usr/subdir /d1/subdir | tee /tmp/dirlog
Create the symbolic link:
ln -s /d1/subdir /usr/subdir
Utilities that deal with the filesystem directory structure may
not function as desired unless additional options are used.
These utilities include (but are not limited to):
cd, ls, pwd, find, cpio, and tar.
For example, if enter:
ls -ld /usr/subdir
you see the symbolic link that references the /d1/subdir
directory. To see the physical directory entry itself, with its owner,
group and permission information, include the -L option:
ls -ldL /usr/subdir
Maintaining filesystem efficiency
Adding disk space and restructuring filesystems
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003