Technical article 105825

Organizing UNIX filesystems for easy migration.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

Problem

I want to organize my filesystems so that I can easily port user files to a new operating system on a new platform, or back them up and restore them after installing a new operating system on my current system. How can I do this?

Cause

Migration can be difficult if user files exist in the root
filesystem.  The root filesystem contains the programs and
directories that make up the operating system. When restoring
an old system's files onto a new system, you may want to restore
user files that were in the root filesystem, but you cannot
restore the entire root filesystem since this would overwrite
the current operating system files. The process of extracting
only user files from the root filesystem can be tedious. If the
only backup you have is of the entire root filesystem, you will
need to selectively restore from the backup tape in order to
extract only user files. This process is also tedious. If this
is your current situation see TA105845, "How to selectively
restore user files from a backup of the root filesystem".
Follow the suggestions below to avoid this complication and
make migration and upgrading easier.

Solution

Your primary hard disk can be divided into several filesystems. Creating separate filesystems for your user's home directories and non-SCO applications will make your system run more efficiently, protect your data, and make maintenance and migration much easier. New filesystems can be specifically created (using the divvy(ADM) and mkdev(ADM) fs commands) then "attached" (mounted) and "detached" (unmounted) as needed. Separate filesystems are accessed in much the same way as a floppy disk or CD-ROM.

1. Create a separate filesystem for the user's home directories. Use the divvy command to create a new division on the hard disk (for example, /dev/homes). The divvy utility will automatically invoke the mkdev fs utility when you specify "Create" from the divvy menu. The mkdev fs utility is used for setting options for the new filesystem. The mkdev fs utility will also update /etc/default/filesys with an entry for the new filesystem.

2. Create a separate filesystem for non-SCO and user applications. Use the divvy utility to create a new division on your hard disk (for example, /dev/u). The divvy utility will automatically invoke mkdev fs when you specify "Create" from the divvy menu. The mkdev fs utility sets options for the new filesystem and updates the /etc/default/filesys file with an entry for the new filesystem.

3. Back up each filesystem separately using a new tape for each filesystem. The SCO Back-up Manager makes this easy by recognizing separate filesystems and allowing you to select one at a time when doing backups.

4. When restoring files onto a new system, do not restore the entire root filesystem onto a new system. If your filesystems are organized as described above, the only information you will need from the root filesystem is user account information. To transfer user account information from the old system, use the ap(ADM) command. The command:

# ap -dgv > /u/acct_info
will write account profile information for all users listed in the
password file to the file "/u/acct_info". The /u/acct_info file can
then be restored onto the new system.  Take care that this file also
contains admin users, including root, however, you can edit this file
using your favourite editor and ensure that the file only contains
true users.
Once it is there, the command:
# ap -ro -f /u/acct_info

will restore the user account information from the /u/acct_info file onto the new system.

When transferring the information you may wish to have configured /etc/hosts.equiv or /.rhosts so that you can use "rcp" to transfer files, for example, the user's $HOME directories or the Application and Database using:

# cd /homes
# find . -print | cpio -ovc | rcmd <new_server> "cd /homes ; cpio -ivdumc"

The reason why we use "rcmd" here rather than "rcp -r" to copy directories recursively is because "cpio" will retain the original ownerships, permissions and date stamps.

5. If you have any printers defined then from the old system you will need to run "/usr/lib/lpshut" to shutdown the lp subsystem, then from the old machine restore the following, after having backed up the original information first:

/etc/hosts
/usr/spool/lp/admins/lp/interfaces
/usr/spool/lp/admins/lp/printers
/usr/spool/lp/admins/lp/Systems (UnixWare Only)
For Remote Printers also include:
/usr/spool/lp/remote
/usr/spool/lp/.rhosts
/etc/printcap

If you have made changes to the original "lp" models then also:

/usr/spool/lp/model

To enable the restored printers, for each printer "enable" and "accept" them and to run "lpsched" to re-start the lp scheduler using:

# /usr/lib/lpsched
# cd /usr/spool/lp/admins/lp/printers
# for i in `ls`; do accept $i; enable $i; done

6. If you have any "cron" or regular scheduled jobs run then you should also include:

/usr/spool/cron/crontabs

7. If you have any mail configuration then you should also include:

For Sendmail:
/usr/lib/sendmail.cf
/usr/lib/mail
For MMDF:
/usr/mmdf/mmdftailor
/usr/mmdf/table/*.[dom|chn]

When making changes it is recommended to "su - mmdf" then "cd table" and run "./dmbuild -nv" to create a new MMDF database.

For UUCP:
/usr/lib/uucp
    [Systems|Dialcodes|Devices|Dialers|Permissions|dial.times]

8. This is really the basic information you need to transfer from the old root filesystem to the new. All device files should be reconfigured anew on the new system. See mkdev(ADM).

In addition, there would be a host of configuration files that may be
configured.  This document does not attempt to detail every possible
configuration option but care should be taken that any root /.* files
are copied, configuration in /etc such as DHCP, AAS, NTP, SSH,
IPFILTER, /etc/rc*.* application start-up scripts, etc.

See also

TA103399, "What files do various options of sysadmsh use for backups in UNIX?"

man pages: divvy(ADM), mkdev(ADM), ap(ADM), rcmd(TC), rcp(TC),
           cpio(C), lpsched(ADM), lpshut(ADM)

From the Xinuos technical article database, record 105825. Reproduced with permission. The original is at www.sco.com/ta/105825, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.