Operating System - OpenVMS
1752728 Members
5892 Online
108789 Solutions
New Discussion юеВ

Defragmenting using COPY or BACKUP

 
SOLVED
Go to solution
Douglass Anderson
Regular Advisor

Defragmenting using COPY or BACKUP

I want copy all data to new Disk.
what command should I use? I don't want to do a block by block transfer, so I was thinking copy /contiguous or backup /image

What way should I use, and what is the syntax?
8 REPLIES 8
Verne Britton
Regular Advisor

Re: Defragmenting using COPY or BACKUP

Yes, backup/image is a good way to do this...

you first must have the target disk (the new one) mounted /FOREIGN to you. then you simply (with enough priv's to read everything), do

backup/image disk1: disk2:

where disk1 is the old disk and disk2 is the one you just mounted with the /FOREIGN qualifier.

Naturally this will destroy (erase) anything already on the target disk.

Whenever I can, I will dismount the old disk first, and then remount it privately so it is completely under my control, so I feel that no one else will be making any changes to it as I'm copying it.

One way (on Alphas and newer Vaxes) to make sure you have all the disks to yourself, is to shut down the system and boot from the CDrom, then drop to the command prompt (DCL) and do all your Mount and Backup command there.

One other qualifier that often helps, especially if you cannot get the disk all to yourself, is /IGNOR=INTERLOCK to attempt to read files that may be in use by others...

Another qualifier that is available, but rarely needed, is /IGNOR=NOBACKUP. Some files, like the pagefile and swapfile, are marked NoBackup. This means the Backup program will only copy the file's header info (name, size, date) but not the actual contents. Backup will make the new file on your target disk (expand it to the proper size) but will not put any (old) data into it.

For the pagefile, this is OK, as that data will not mean anything later on. But some users or managers may mark a file NoBackup that does contain important data. This data would be lost when making your new disk.

So perhaps a better command would be:

backup/ignor=(nobackup,interlock) disk1: disk2:

VMS has a nice defrag program (the layered product Disk File Optimizer (DFO)), as well as other 3rd party products (is there a free one from DECUS too??) ... most of these will run in the backround on your running system and defrag your disk while it is in use by others ... eliminating the need to routinely copy/backup the disk in order to defrag it.

Of course your budget may not cover extra commerical software :-)
Doug Phillips
Trusted Contributor

Re: Defragmenting using COPY or BACKUP

Yes, use $backup/image. If this is just a data disk, or not the currently booted system disk, you can do this under a privileged login. However, if it's the booted system disk you should boot from the CD or Standalone. In order to get a clean copy, noone should be accessing the source disk, so like Verne said, mount the source disk privately (/noshare). Using /ignore=interlock will not yield a good copy of the source disk if anyone else is writing to it.

If you want to change any of the volume characteristics (cluster size, index file position, number of directories, etc: see $help init), initialize the target disk first and use the /noinit qualifier on the backup command.

Otherwise, backup will initialize the target disk to have the same characteristics as the source disk.

If the disks are the same size, and you just need to make a defragged copy, then let backup initialize the disk for you (default is /init).

Look at the examples in $help for the backup comand as well as other commands you might need.

-Doug
David B Sneddon
Honored Contributor
Solution

Re: Defragmenting using COPY or BACKUP

Douglass,

Is this question related to your other questions about DFO?

From your forum profile:

I have assigned points to 0 of 33 responses to my questions.

The following links may be of interest

hp support forums -- overview and FAQs
http://forums1.itrc.hp.com/service/forums/helptips.do?

Forums Etiquette
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=140137

How Do I Assign Points
http://forums1.itrc.hp.com/service/forums/helptips.do?#33

Regards
Dave
Jan van den Ende
Honored Contributor

Re: Defragmenting using COPY or BACKUP

Just a minor addendum:

Like Doug wrote: NOT specifying /NO
INIT will copy the current INIT settigs from the old disk.
But nowadays you REALLY will want to use the /LIMIT on your init, and if your source somehow stems form pre-V7.2, you want to specify /CLUST on your INIT. So USE what you now can!
(Use /CLUS=8 to be able to specify a 1 TB limit, and no higher if this is not a special, few-big-files, database disk)

fwiw,

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
comarow
Trusted Contributor

Re: Defragmenting using COPY or BACKUP

First of all Backup does error checking that copy doesn't.

As far as over the network, there is no differenc in performance of copy versus backup.

If you're going to a larger disk, initializing with a larger cluster size will improve performance. In fact if the is only use for backups, use a huge cluster size.

Finally, if the remote system has it's storage on a SAN ignore the old rules and keep DIOLM below 100 or much more so the san doesn't trash it's cache.


Bob C
Good luck.
Jan van den Ende
Honored Contributor

Re: Defragmenting using COPY or BACKUP

One more minor tip for using BACKUP, when the disk block cluster sizes ane NOT equal (and especially when going from pre-V7.2 originating disks, or when the target disk cluster size is not an exact muliple of the source, or if THAT has not been true some previous time):
Use /TRUNC on your Backup command. It only resets sequential files, but if you have been running 36 or 72 G disks under < 7.2, and you have many small files, this will save HUGE amounts of diskspace.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
comarow
Trusted Contributor

Re: Defragmenting using COPY or BACKUP

Your also missing a critical aspect.
Copy alone does not defragment a disk.

You can copy/contiguous a file, but copy does not defragment a disk. Only image/backups will, (or a fragmentor with exclusive access to the disk).

The only supported way to back up the system disk is to boot the cd or standalone backup. Yes, many people simply /ignore=interlock and it usually works.

$backup/image/ignore=(interlock,nobackup) oldisk: newdisk:

Now, you can leave out nobackup if you don't need those files backed up.

You can also preinitialize a disk with say a new cluster size or preallocate a larger indexf.sys /header = 60000 for example.
I recommend a header size larger than the current size of indexf.sys.

For example init/header=70000/cluster- =12/nohigh dka100: mydisk

Than
backup/image/ignore=interlock/noinit olddisk newdisk

We really need to know more about what you are trying to do, the data and how it will change to make the best decisions.

And don't forget that backup has some great error checking routines.

Highwatermarkings slow writes tremendously, since when you allocate space, it first writes a pattern of 0000s. If this is not necessary, it will perform much faster.


I think an interactive conversation with HP support would be appropriate to diagnose your load and objectives.

Bob
Douglass Anderson
Regular Advisor

Re: Defragmenting using COPY or BACKUP

solved