The HyperTrap
Alexandre Chartre's Weblog
Archives
« May 2007 »
SunMonTueWedThuFriSat
  
1
2
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today
Links
All | General | LDoms
« Previous month (Apr 2007) | Main | Next month (Jun 2007) »
20070503 Thursday May 03, 2007
Some virtual disks can lose label when rebinding a domain
Logical Domains (LDoms) can export a file as a virtual disk. Unfortunately there is a case where the label of such a disk can be lost. This is a known problem which is already fixed in OpenSolaris and that will be fixed in the next update of Solaris 10. But in the meantime, you will have to be careful when using a file as a virtual disk and you should use the following procedure and script to avoid any problem.

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)


May 03 2007, 11:21:50 AM PDT Permalink