Thursday May 03, 2007 Problem
In some cases, when a file is used as a virtual disk, the label of that virtual disk can be lost when rebinding a domain (ldm bind) using that file (or a copy of that file) as a virtual disk.
For example, if a domain uses a file as a virtual disk and the Solaris system gets installed on that virtual disk (using boot net) then all will be running without any problem while the domain is not unbound. If the domain is unbound (using ldm unbind) then the label on the file used as a virtual disk might be lost the next time a domain using that file is bound (using ldm bind). In such a situation, the newly bound domain will be unable to use the system installed on the virtual disk and it will fail to boot with an error like "the file does not appear to be bootable" or it might fail to mount the root filesystem with an error like "vfs_mountroot: cannot mount root".
This problem is referenced as bug 6544963 (vdisk can lose label when rebinding domain)
Workaround
To prevent this problem, you need to use the following script fcksum. This script will check if you are in the case where the label will not be correctly validated during the next "ldm bind", and if this is the case it will change the label and its checksum so that it can be correctly validated. The script should be run on any file that has been used as a virtual disk and for which the disk label or disk partitioning has been changed. The script should be run right after the domain using the virtual disk is unbound (ldm unbind) for the first time.
For example, if file filedisk is used by a domain as a virtual disk and if the Solaris system is being installed onto that virtual disk then you should run the script after doing the first "ldm unbind" on that domain. Note that the script should be run before doing any "ldm bind' otherwise you can loose the disk label.
The syntax to run the script is: ./fcksum filedisk
Note that the script will first backup the existing label of the file in a file named label.file.day_time.
Here is the output you will get if your label is updated:
$ ./fcksum rootdisk
Backing up original label in label.rootdisk.070314_201917
Changing checksum
0x1fe: 0xe456 = 0x6456
Changing dummy field
0x1b8: 0 = 0x8000
Label checksum has been updated
Otherwise if the label does not need to be updated, you will get:
$ ./fcksum rootdisk
Backing up original label in label.rootdisk.070314_201005
Label checksum is okay
Dowmnload the fcksum script (use the Save Link as... option of your browser)