Operating System - OpenVMS
1827851 Members
1675 Online
109969 Solutions
New Discussion

Re: how to change clustersize of systemdisk

 
SOLVED
Go to solution
Willem Grooters
Honored Contributor

how to change clustersize of systemdisk

"Changing clustersize" for a datadisk is (I hope) staight forward: Create a new disk with different clustersize and BACKUP (without /IMAGE) all required data onto this disk. Right?
How do you do this with the system disk ?Problem is that all files, residing on [VMS$COMMON] are actually 'Entered' (SET FILE/ENTER) into the systemroot ([SYS0], [SYS1] etc) will be copies as files - not as directroy entries.
One thing I tried is to backup each directory separately, but still I ran into this problem with the system root(s).
Is there an easy way without having to redo all installation, and without having to install all layered products again?
Willem Grooters
OpenVMS Developer & System Manager
22 REPLIES 22
Dieter Rossbach
Regular Advisor

Re: how to change clustersize of systemdisk

There is no easy way (my opinion only) and yes, the links are the problem.

My first try og an answer:

1. Image-Backup of the system disk to a second one
2. set file/remove on disk2:[sys0]syscommon.dir
and on disk2:[sys1] ....
3. Init the new disk with the desired cluster size
4. Backup (without /image ...) disk2 to the new one
5. set file/enter=newdisk:[sys0]syscommon.dir newdisk:vms$common.dir
6. mc writeboot (perhaps)

Regards

Dieter

Åge Rønning
Trusted Contributor

Re: how to change clustersize of systemdisk

Why don't you use image backup?
Backup/image
Init with required clustersize + other init parameters
Backup/image/NOINIT

The restore command will not take init information from the backup, But use what you just used in the init command.
VMS Forever
Lokesh_2
Esteemed Contributor

Re: how to change clustersize of systemdisk

Hi ,

I also think like Age:

1. Take standalone backup of system disk [ or backup/image/ingore=(interlock,nobackup)]
2. Initialize your system disk with required cluster size
3. Backup/image/noinit ..

Thanks & regards,
Lokesh

What would you do with your life if you knew you could not fail?
Dieter Rossbach
Regular Advisor

Re: how to change clustersize of systemdisk

I did a fast test:

$ init drb0: /struc=5/clu=26 newsys ! system disk is ods-5
$ mount /for drb0
$ backup/image/ignore=inter/noinit dra6: drb0:

and get:

%BACKUP-F-INVATTVAL, invalid attribute record value in save set

and yes: it works without /NOINIT .


Regards

Dieter



Lokesh_2
Esteemed Contributor

Re: how to change clustersize of systemdisk

Hi Dieter,

Please remove /struc=5 from the following command - init drb0: /struc=5/clu=26 newsys.

That is use the following command, and let us know the results:
$init drb0:/clus=26 newsys

Thanks & regards,
Lokesh
What would you do with your life if you knew you could not fail?
Hein van den Heuvel
Honored Contributor

Re: how to change clustersize of systemdisk


Why? What problem are you trying to solve?

Assuming I have extra disks I would like to keep my system disk clean and clear of any growing files through logical names. accountng, operator, sysuaf, rightslist,...

That way you basically do not have to make a backup of the system disk except for after major software changes.

fwiw,
Groetjes,
Hein.
Antoniov.
Honored Contributor

Re: how to change clustersize of systemdisk

Hi
when I read Willen question I thought me because no IMAGE (I've used in tha past to backup & restore system disk); so I opened my VMS and typed help BACK/IMAGE and I read:

Directs BACKUP to process an entire volume or volume set.
Using this qualifier produces a functionally equivalent copy of the original volume or volume set.
[...]
Specifying the /IMAGE qualifier without also specifying /NOALIAS can result in incomplete disk or file restoration operations.
[...]
/------------------------------------------\
|Beginning in OpenVMS Version 7.2, when you |use the BACKUP/IMAGE command to restore or |copy a volume, the BACKUP utility preserves
|the cluster factor.
\------------------------------------------/
Before V7.2 was possible (so I known) change cluster factor as hint by AGe & Lockesh.
I think this limitation was introduced with new ODS-5 format to avoid some trouble.
So unique solution mey be the Ditier's answer.
Bye
Antoniov

Antonio Maria Vigliotti
Dieter Rossbach
Regular Advisor

Re: how to change clustersize of systemdisk

@lokesh:

Backup/image won't work! I tried it, you get a "structure mismatch" error message! Remember: my system disk is ods-5,too.

Regards

Dieter
Willem Grooters
Honored Contributor

Re: how to change clustersize of systemdisk

Hein:
Why? Simply, when I first started with this system I had only one (9Gb) disk, it was initilized to clustersize of 18 installing VMS. Since it was the only disk, I had to put all on that one. Now, new (small, as I'm a small user) disks were added and I want to clean up the system disk (indeed) and put it on a smaller clustersize ((much) less unusable space). Purely a matter of efficiency....It could also reside on the second disk, doesn't have to be restored on the original (I expect it even is the only way to get it copied ;-)) And it is an ODS-5 disk; a requirement, since Tomcat is on that disk as well.
Dieter: without /NOINIT I will be stuck to the big clustersize, I guess. Not what I want...
Lokesh (and others that suggested): why not making an image_copy/image/noinit to the second disk? Would do, would it?
Willem Grooters
OpenVMS Developer & System Manager
Hein van den Heuvel
Honored Contributor

Re: how to change clustersize of systemdisk


Just for grins....

Here is a perl script to parse DFU output to help guestimate the effect of cluster size on wasted space. Note: the script does NOT deal with 'overallocated' files, that is files which have more than a single cluster between the registred eof and the allocated space.

Sample output:

$ pipe dfu search DRA4: | perl cluster_size.p

1667 (1667) Files with 1667 headers 1983560/2014925 1.56%

Cluster Waste
------- --------- -----
1 0 0.00%
2 906 0.04%
3 1912 0.09%
4 3040 0.15%
5 4125 0.20%
:
100 134840 6.69%

# This perl script will process an DFU search output file
# to analyze the effect of cluster size on wasted allocaed space.
# use a PIPE or: defi/user sys$output dfu.tmp, and DFU SEARCH disk00:
#
# system$disk00:[directory]filename,ext;vers 1/9
#Primary headers : 6168
#Files found : 6168, Size : 2918870/3293460
while (<>) {
if (/(\d+)\/(\d+)$/) {
$end=$1;
$all=$2;
if (/Files found : (\d+)/) {
print "\n$1 ($files) Files with $headers headers $end/$all";
printf (" %5.2f%%\n", ($all-$end)*100/$all);
} else {
$files++;
$file{$end}++;
}
}
$headers = $1 if (/headers : (\d+)/);
}

#foreach $end (sort {$a <=> $b} keys %file) {
# printf ("%6d %d\n", $file{$end}, $end);
# }

print "\nCluster Waste\n------- --------- -----\n";
while ($c++ < 100) {
$waste = 0;
foreach $end (keys %file) {
$w = $c * int(($end +$c -1) / $c) - $end;
$waste += $file{$end}*$w;
# print "$c, $file{$end}, $end, $w, $waste\n";
}
printf ("%7d %9d %5.2f%%\n", $c, $waste, $waste*100/$all);
}



Enjoy...

Hein.


Hein van den Heuvel
Honored Contributor

Re: how to change clustersize of systemdisk


Minor tweak on prior reply, now also reporting the number of files that would be mapped by a single cluster.

The script is in an attachment to avoid the forum sosftware from hosing the spaces.

Hein.

$ perl CLUSTER_SIZE.P < dfu.tmp

6168 (6168) Files with 6168 headers 2918870/3293460 11.37%

Cluster ____Waste _____ Single_Cluster
------- --------- ----- -------- -----
1 0 0.00% 1430 23.18%
2 3470 0.11% 1892 30.67%
3 7414 0.23% 2257 36.59%
4 10814 0.33% 2777 45.02%
5 14975 0.45% 3053 49.50%
6 18664 0.57% 3290 53.34%
7 22607 0.69% 3485 56.50%
8 27258 0.83% 3614 58.59%
9 31357 0.95% 3726 60.41%
:
99 508510 15.44% 5511 89.35%
100 513330 15.59% 5514 89.40%
Åge Rønning
Trusted Contributor
Solution

Re: how to change clustersize of systemdisk

I just did the following on my system and it all seems to work ok. My current system disk is ODS2, But i converted the backup to ods5 and backed that up with /NOINIT without problems too. I'm running V7.3-1 + update patch.

init/clust=3 dkb300: tst
mou/for dkb300:
backup/image/noinit/ignore=interl sys$sysdevice: dkb300:

That gave me an ODS2 disk with different clustersize. Now, convert the old disk to ODS5 and make sure to INIT the new disk with STRUCT=5!

set vol/struct=5 dkb300:
init/STRUCT=5/clus=9 dkb200:
mou/for dkb200:
backup/image/noinit dkb300: dkb200:

That gave me a new ODS5 system disk with different clustersize.

Some time ago I saw a note saying you had to do a SET VOL/VOL_CHAR=HARDLINKS after the init of the new disk and before the backup/image/noinit, But I didn't do that.
VMS Forever
Willem Grooters
Honored Contributor

Re: how to change clustersize of systemdisk

Age,
What if the original disk is ODS5? I cannot backup to an ODS2-disk since I woul need to reinstall java and Tomcat (both require ODS5).
For all: Just wait a while posting solutions, please! There's quite enough to look at for the moment, but too little time (as usual too much to do and nothing to spare ;(. I'll grant the points later on.
Willem Grooters
OpenVMS Developer & System Manager
Willem Grooters
Honored Contributor

Re: how to change clustersize of systemdisk

I tried Age's suggestion:

$ init dkb300/cluster=3 A
$ mount/foreign dkb300
$ backup/noinit/ignore=interlock dka0: dkb300:

This is going right, on the running system I get quite a lot of warnings that flaes are opeend by another user - but it concerns logfiles. I don't care for that. At end I got the message %BACKUP-I-BTCROUT, Routine ODS-5 RMS SYNTAX ERROR.

$ DISMOUNT DKB300
$ MOUNT/OVERRIDE=ID DKB300

and now I see it's clustersize is, indeed, 3.

Files however have been copied with the original allocated size, into a multiple of 3. That's to be expected, due to /IMAGE, I guess. So next stap: how to get this allocated space free? For now I've a lot of files that are actually 2 blocks in size but 18 alloacted....
Oh yes - points have been granted so far.
Willem Grooters
OpenVMS Developer & System Manager
Hein van den Heuvel
Honored Contributor

Re: how to change clustersize of systemdisk


For all the plain SEQUENTIAL files you can simple use SET FILE/TRUNCATE.

$ copy/all=100 tt: tmp.tmp
aap
noot
mies
$ dir/size=all tmp.tmp
TMP.TMP;3 1/108
$ set file/trun tmp.tmp
$ dir/size=all tmp.tmp
TMP.TMP;3 1/9
$ type tmp.tmp
aap
noot
mies
$
Hein van den Heuvel
Honored Contributor

Re: how to change clustersize of systemdisk

Arghh... that went out to quick.

I meant to add that this will ofcourse completely and utterly fragment you freespace. For a series of small files it will look like 3-used, 15 free, 3-used, 15 free,...
That would appear to be a good reason to defrag!

Hein.

Lokesh_2
Esteemed Contributor

Re: how to change clustersize of systemdisk

Hi,

You can use DFU too. See the below thread

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=262626

Thanks & regards,
Lokesh
What would you do with your life if you knew you could not fail?
Willem Grooters
Honored Contributor

Re: how to change clustersize of systemdisk

Hein,

>For all the plain SEQUENTIAL files you can simple use SET FILE/TRUNCATE.

Why this distinction? I mean: strictly sequential I can image clearly, but I don't understand why it wouldn't work with indexed and relative files. These have more allocated than used as well.
What about executables and libraries?
Willem Grooters
OpenVMS Developer & System Manager
Willem Grooters
Honored Contributor

Re: how to change clustersize of systemdisk

FYI: I was able to boot from DKA300; not that the system came up as it should, because a simple (stupid ;-)) reason: in some startup files there exists a hard-coded reference to DKA0: in stead of SYS$SYSDEVICE:. The disklabel wasn't changed by BACKUP either, so another thing to take in account...
Willem Grooters
OpenVMS Developer & System Manager
Hein van den Heuvel
Honored Contributor

Re: how to change clustersize of systemdisk

hein>> For all the plain SEQUENTIAL files you can simple use SET FILE/TRUNCATE.

willem> Why this distinction? I mean: strictly sequential I can image clearly, but I don't understand why it wouldn't work with indexed and relative files. These have more allocated than used as well.

Sorry... a bit late in replying. Well, basically the EOF for indexed files is not reliable and ignored by the RMS indexed file access code. It's just a hint, more or less maintained by convert and RMS. The truncate command knows this:
-SET-E-NOTRUNC, truncation not allowed for this file organization

I thought I remembered the EOF for relative file also to be sub-ordinate to a maximum record number, but SET FILE /TRUN does not complain for those. Still, I'd avoid mucking about with them. THey are pretty rarely used anyway no?


willem> What about executables and libraries?

No problem truncate as need be.


Hein.
Jan van den Ende
Honored Contributor

Re: how to change clustersize of systemdisk

The trouble with BACKUP/NOINIT creating over-allocated files, and thereafter with afragmented disk after SET FILE/END, can be avoided very simple, easier, and quicker:
in the BACKUP command add; /TRUNCATE
It just looks like a plain, simple, straightforward, old-fashioned VMS-solution; and that is exactly what it is
;<)
Don't rust yours pelled jacker to fine doll missed aches.
Willem Grooters
Honored Contributor

Re: how to change clustersize of systemdisk

Ok, might give a nice, unfragmented disk (if it works for indexed files as well). Keep that in mind.

BTW: How do I get rid of the scattered free space? DFU doesn't do defragmentation of free space. Just a matter of "COPY " and purge?

(bedankt Jan, had ik eerder moeten weten)
Willem Grooters
OpenVMS Developer & System Manager