SUMMARY: usr filesystem

From: <71055.111_at_compuserve.com>
Date: Thu, 23 Apr 1998 12:08:52 -0400

Hello,

Thanks a lot for the answers, specially to:

Dr. Tom Blinn, 603-884-, INTERNET:tpb_at_zk3.dec.com
alan_at_nabeth.cxo, INTERNET:alan_at_nabeth.cxo.dec.com
John Seel, INTERNET:john.seel_at_totaltec.com
Girish Phadke, INTERNET:pgirish_at_binariang.maxisnet.com.my
"C.Ruhnke", INTERNET:i769646_at_smrs013a.mdc.com
Peter Stern, INTERNET:peter_at_wiscpa.weizmann.ac.il
Gernot Salzer, INTERNET:salzer_at_logic.at

I included here some of the answers,


***************************************************************************
******************************************
Dr. Tom Blinn, 603-884-, INTERNET:tpb_at_zk3.dec.com

That's the hard way. You can do it easier and faster. Here's how:

disklabel the new disk with the appropriate partition size; if it's the
whole disk (the "c" partition) then just put a new default label on the
disk, otherwise put on a default label, then use disklabel -e to edit
the label. You can do this while the system is running multiuser, but
to copy the file system, you need to shut down to single user mode.

Shut the system down to single-user mode. Then run bcheckrc to mount
all the local disks, use "update" to start the update process, you'll
already have swap enabled (but use swapon -a if you boot up to single
user mode from a halted system).

Use the mkfdmn command to make a new AdvFS file domain for use by the new
"/usr" file system. Call it something like "temp_domain" or something else
that isn't in use. Use mkfset to make a "usr" fileset in the new domain.
If your "usr" fileset is called something other than "usr", then use the
same name it's got presently.

Mount your new fileset on /mnt:

        # mount temp_domain#usr /mnt

Now use vdump and vrestore to copy your existing /usr fileset into the new
one:

        # vdump -b64 -0f - /usr | (cd /mnt ; vrestore -xf -)

This will take a while, but it's MUCH FASTER than restoring from backups.

Once the copy completes, use df to make sure the two filesets appear to be
the same size. If you're really paranoid, use find to get a list of the
files in the old fileset and separately for the new, and compare the two
lists; you can even get a list of checksums and compare them. Once you're
pretty sure you've got a good copy, just unmount your old /usr, move the
domain directories around a bit, and remount /usr and you're ready to go:

        # umount /usr
        # umount /mnt
        # cd /etc/fdmns
        # mv usr_domain usr_domain.old
        # mv temp_domain usr_domain
        # mount /usr
        # cd

and you should have your new /usr all mounted. Simpler and faster. If you
want to recycle the old /usr partition, then

        # rm -rf /etc/fdmns/usr_domain.old (or whatever you called it)

and then you can change the disklabel to no longer flag the partition as an
AdvFS file system.

Tom
***************************************************************************
**************************************
alan_at_nabeth.cxo, INTERNET:alan_at_nabeth.cxo.dec.com

        There are easier ways...

        1. If you have the AdvFS utilities, you can use the addvol
            and rmvol commands. Simply add the new partition to the
            domain and then remove the old partition. AdvFS will
            migrate the data for you.

        2. Merely shutdown to single user, so that nobody will be
            using /usr, create a new domain and fileset for the
            new /usr, then use vdump/vrestore across a pipe to move
            the data.

                mkfdmn special newusr
                mkfset newusr usr
                mount newusr#usr /mnt
                mount /usr

                vdump 0f - /usr | ( cd /mnt ; vrestore xf - )

            Then, either juggle the links or simply rename the two
            domains and reboot. Or, just change the domain#fileset
            in /etc/fstab.

        The /usr file system isn't particularly special as file
        systems go. You certainly don't need to boot the standalone
        system to move it and with the Utilities you don't need to
        shutdown at all.
***************************************************************************
****************************************
John Seel, INTERNET:john.seel_at_totaltec.com

There could be an easier way if you have the advfs advanced utility
"addvol" available. (This may require a license).

Simply use addvol to add the new disk partition and then use "rmvol" to
remove the old partition. ( see the man pages for both commands ). All
data will be automatically migrated to the new device. There is no need to
do any relinking or booting to single user.


If you do not have the addvol and rmvol commands available, see the man
pages for vdump and vrestore, there is a command line that uses a series of
pipes to get the data to the new device. Then you manually relink as you
said and reboot. (This is only a sketchy description of the the steps
required. Read the man pages carefully before doing it this way.)

Good luck.

John Seel
***************************************************************************
***********************************
Received on Thu Apr 23 1998 - 18:23:30 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT