Technical article 105185

How to mirror my /u filesystem to a second disk using the Virtual Disk Manager.

OpenServer 5.0.0

Written · Last revised

Problem

I have already mirrored my root, boot and swap to my second disk but I do not know how to mirror my /u to my second disk.

Solution

Since you have successfully mirrored root, swap and boot, this article assumes that the parity drive has been added to the system correctly. That is, using mkdev hd and fdisk, the parity disk has the same size root partition as the root disk and does not contain any divisions or valid timestamps. In other words, when adding a second drive, you should have gone into fdisk, partitioned the drive correctly and chose 'q' to quit or 'n' to avoid going into divvy. This article also assumes that the Virtual Disk Manager Release Supplement 1.1.0 has been installed. Its main feature is to allow you to boot off the mirrored drive, should your root drive fail. Two 525 meg drives were used for this configuration.

In order for you to utilize your /u in a Virtual Disk array you must first convert it to a type "simple" using the Virtual Disk Manager.

IMPORTANT NOTE: Before you can do that you must back up your data
                and verify your backups. The following instructions
                will *NOTE* the proper steps in saving your data
                if you have put data in your /u filesystem. An
                incorrect keystroke can and will destroy your data
                so it is strongly recommended you back it up. When
                the backups are done make sure the system is in
                multiuser mode, unmount the filesystem you want to
                convert to simple, and bring up the Virtual Disk
                Manager.

Bring up the Virtual Disk Manager by clicking on the System Administration==>Filesystems ==>Virtual Disk Manager.

You will see:
+----------------------------------------------------------------+
|       Disk   Piece   Database   Boot   View   Options          |
|                                                                |
+----------------------------------------------------------------+
|                                                                |
|                                                                |
|   Virtual disks on <system name>                               |
|  +-----------------------------------------------------------+ |
|  |vdisk1: 2 piece-mirror 703084 blks, cluster 32             | |
|  |                                                           | |
|  |vdisk2: 2 piece-mirror 98000 blks, cluster 32              | |
|  |                                                           | |
|  |vdisk3: 2 piece-mirror 30000 blks, cluster 32              | |
|  +-----------------------------------------------------------+ |
|                                                                |
+----------------------------------------------------------------+

Click on 'Disk' and a list will appear. Click on 'New'. This will bring up the following window:

+----------------------------------------------------------------+
|                                                                |
|   Select the virtual disk type and device name                 |
|                                                                |
|   Virtual type:   +--------------+                             |
|                   | Raid  5      |                             |
|                   +--------------+                             |
|         Device:   +--------------+                             |
|                   | vdisk 4      |                             |
|                   +--------------+                             |
|   +---Vdisk parameters------------------------------------+    |
|   |                                                       |    |
|   |   Number of data pieces:   +-----------+              |    |
|   |                            | 3         |              |    |
|   |                            +-----------+              |    |
|   |   Size of disk cluster :   +-----------+              |    |
|   |                            | 32        |              |    |
|   |                            +-----------+              |    |
|   |   Include a hot spare  :   +-----------+              |    |
|   |                            | y    n    |              |    |
|   |                            +-----------+              |    |
|   +-------------------------------------------------------+    |
+----------------------------------------------------------------+

Note: This is the window that comes up by default. You must choose the arrow down key to get more choices. After doing this, choose simple and then click on continue.

Note: vdisk4. Assuming the Release Supplement has been installed, "vdisk4" will show in device if this is the first array configured since mirroring boot, root, and swap.

Click 'continue' after making any necessary modifications.

+------------------------------------------------------------------+
|                       New: Simple                                |
|   +---Vdisk parameters---------------------------------------+   |
|   |                                                          |   |
|   |   Type: Simple                                           |   |
|   |                                                          |   |
|   |   Virtual Device: /dev/dsk/vdisk4                        |   |
|   +----------------------------------------------------------+   |
|                                                                  |
|                                                                  |
|   Select a piece to allocate                                     |
|                                                                  |
|   +----------------------------------------------------------+   |
|   |                                                          |   |
|   |Piece 1: Not Allocated                                    |   |
|   |                                                          |   |
|   +----------------------------------------------------------+   |
|                                                                  |
|   +-----------------+                                            |
|   |Allocate piece   |                                            |
|   +-----------------+                                            |
|                                                                  |
|   +--------------+          +--------------+      +--------+     |
|   | Create       |          | Cancel       |      | Help   |     |
|   +--------------+          +--------------+      +--------+     |
+------------------------------------------------------------------+
Click on 'Allocate piece'.
+------------------------------------------------------------------+
|                 vdisk4: Simple   piece 1 of 1                    |
+------------------------------------------------------------------+
|                                                                  |
|   Select the device this piece will reside on and then           |
|   enter the offset and length of this piece:                     |
|                                                                  |
|   Device       Disk       Partition       Length                 |
|   +-------------------------------------------------+            |
|   |/dev/dsk/0s1  0          1             1073120   |            |
|   |                                                 |            |
|   |/dev/dsk/1s1  1          1             1073120   |            |
|   +-------------------------------------------------+            |
|                                                                  |
|   offset: see note                    Disk map                   |
|                                       --------                   |
|   Length: see note                    see note                   |
|                                                                  |
|                                                                  |
|                                                                  |
|   OK                  CANCEL               HELP                  |
+------------------------------------------------------------------+
Note:         /dev/dsk/0s1 is highlighted when the window comes
              up; this is where the /u filesystem is.
Note: Offset  This space is used by the Virtual Disk Manager for
              protecting the Fdisk table and for bookkeeping.
              When this window comes up the offset value is
              blank.
Note: Length  This will also be blank when the window comes up.
Note:         The Disk Map is a layout of the 0s1 drive when
              /dev/dsk/0s1 is highlighted and you do want this
              one highlighted. Since it could not be included
              in the above diagram (due to size) it will be shown
              by itself below. Keep in mind that divvy shows almost
              the same thing but in 1K blocks. The disk map
              shows it in 512 byte blocks. In our example the
              /u is filesystem number 3 and if we were to bring
              up divvy it would show it as filesystem number 3.
                  Disk Map
+------------------------------------------------------+
|     0...............2015 reserved                    |
|  2016..............32015 vdisk3.1                    |
| 32016.............130015 vdisk2.1                    |
|130016.............833099 vdisk1.1                    |
|833100............1073099 3:-    click here for /u    |
|1073100...........1073119 6:-                         |
+------------------------------------------------------+

IMPORTANT NOTICE: Do NOT choose anything other than /u or you will lose the data for the filesystem chosen. So, if root is chosen, you will be restoring from backups or reinstalling.

After clicking on '/u' in the disk map, the offset and length fields become populated. Now click on 'OK'.

+------------------------------------------------------------------+
|                       New: Simple                                |
|   +---Vdisk parameters---------------------------------------+   |
|   |                                                          |   |
|   |   Type: Simple                                           |   |
|   |                                                          |   |
|   |   Virtual Device: /dev/dsk/vdisk4                        |   |
|   +----------------------------------------------------------+   |
|                                                                  |
|                                                                  |
|   Select a piece to allocate                                     |
|                                                                  |
|   +----------------------------------------------------------+   |
|   |                                                          |   |
|   |Piece 1: /dev/dsk/0s1 offset: 833100 Length:240000        |   |
|   |                                                          |   |
|   +----------------------------------------------------------+   |
|                                                                  |
|   +-----------------+                                            |
|   |Allocate piece   |                                            |
|   +-----------------+                                            |
|                                                                  |
|   +--------------+          +--------------+      +--------+     |
|   | Create       |          | Cancel       |      | Help   |     |
|   +--------------+          +--------------+      +--------+     |
+------------------------------------------------------------------+
Click on 'Create'.
+------------------------------------------------------------------+
|                         Information                              |
+------------------------------------------------------------------+
|                                                                  |
|   Successfully created virtual disk /dev/dsk/vdisk4              |
|                                                                  |
|                                                                  |
|                           OK                                     |
+------------------------------------------------------------------+

*NOTE* Click 'OK'. This will bring up another window entitled 'Create Filesystem'. It will also include a warning that a filesystem already exists. If you have data on your /u you must choose 'CANCEL'. In fact, you have already created a filesystem on /u when you installed so choose 'CANCEL'.

Now mirror the /u that has been converted to Simple.
Go back to the Virtual Manager Main screen.  After all
have been allocated, click on 'CREATE' to create the virtual
disk.
You will see:
+----------------------------------------------------------------+
|       Disk   Piece   Database   Boot   View   Options          |
|                                                                |
+----------------------------------------------------------------+
|                                                                |
|                                                                |
|   Virtual disks on <system name>                               |
|  +-----------------------------------------------------------+ |
|  |vdisk1: 2 piece-mirror 703084 blks, cluster 32             | |
|  |                                                           | |
|  |vdisk2: 2 piece-mirror 98000 blks, cluster 32              | |
|  |                                                           | |
|  |vdisk3: 2 piece-mirror 30000 blks, cluster 32              | |
|  |                                                           | |
|  |vdisk4: Simple 240000 blks                                 | |
|  +-----------------------------------------------------------+ |
|                                                                |
+----------------------------------------------------------------+

Click on 'Disk' and a list will appear. Click on 'New'. This will bring up the following window:

+----------------------------------------------------------------+
|                                                                |
|   Select the virtual disk type and device name                 |
|                                                                |
|   Virtual type:   +--------------+                             |
|                   | Raid  5      |                             |
|                   +--------------+                             |
|         Device:   +--------------+                             |
|                   | vdisk 4      |                             |
|                   +--------------+                             |
|   +---Vdisk parameters------------------------------------+    |
|   |                                                       |    |
|   |   Number of data pieces:   +-----------+              |    |
|   |                            | 3         |              |    |
|   |                            +-----------+              |    |
|   |   Size of disk cluster :   +-----------+              |    |
|   |                            | 32        |              |    |
|   |                            +-----------+              |    |
|   |   Include a hot spare  :   +-----------+              |    |
|   |                            | y    n    |              |    |
|   |                            +-----------+              |    |
|   +-------------------------------------------------------+    |
+----------------------------------------------------------------+

Click the arrow down key on 'Raid 5' to get more choices and choose 'Mirror'. The device should read "vdisk5". Click on 'Continue'.

+------------------------------------------------------------------+
|                       New: Mirror                                |
|   +---Vdisk parameters---------------------------------------+   |
|   |                                                          |   |
|   |   Type: Mirror                                           |   |
|   |                                                          |   |
|   |   Virtual Device: /dev/dsk/vdisk5                        |   |
|   +----------------------------------------------------------+   |
|                                                                  |
|                                                                  |
|   Select a piece to allocate                                     |
|                                                                  |
|   +----------------------------------------------------------+   |
|   |                                                          |   |
|   |Piece 1: Not Allocated           highlighted              |   |
|   |                                                          |   |
|   |Piece 1: Not Allocated                                    |   |
|   |                                                          |   |
|   +----------------------------------------------------------+   |
|                                                                  |
|   +-----------------+                                            |
|   |Allocate piece   |                                            |
|   +-----------------+                                            |
|                                                                  |
|   +--------------+          +--------------+      +--------+     |
|   | Create       |          | Cancel       |      | Help   |     |
|   +--------------+          +--------------+      +--------+     |
+------------------------------------------------------------------+
Click on 'Allocate Piece'.
+------------------------------------------------------------------+
|                 vdisk5: Mirror   piece 1 of 2                    |
+------------------------------------------------------------------+
|                                                                  |
|   Select the device this piece will reside on and then           |
|   enter the offset and length of this piece:                     |
|                                                                  |
|   Device          Disk       Partition       Length              |
|   +-------------------------------------------------+            |
|   |/dev/dsk/1s1    1          1             1073120 |            |
|   |                                                 |            |
|   |/dev/dsk/vdisk4 simple                    240000 |            |
|   |                                                 |            |
|   |/dev/dsk/vdisk1 mirror                    703084 |            |
|   |                                                 |            |
|   |/dev/dsk/vdisk2 mirror                     98000 |            |
|   |                                                 |            |
|   |/dev/dsk/vdisk3 mirror                    30000  |            |
|   |                                                 |            |
|   |                                                 |            |
|   +-------------------------------------------------+            |
|                                                                  |
|   offset: 833100                      Disk map                   |
|                                       --------                   |
|   Length: 24000                                                  |
|                                                                  |
|                                                                  |
|                                                                  |
|   OK                  CANCEL               HELP                  |
+------------------------------------------------------------------+
Click on '/dev/dsk/vdisk4' as this is the first piece to
allocate. This will populate the offset and length to values
shown. Now click on 'OK'. This will bring up the same window
you saw previously but with "piece2", not "allocated",
highlighted.  Click on 'allocate piece' once again.
+------------------------------------------------------------------+
|                 vdisk5: Mirror   piece 2 of 2                    |
+------------------------------------------------------------------+
|                                                                  |
|   Select the device this piece will reside on and then           |
|   enter the offset and length of this piece:                     |
|                                                                  |
|   Device          Disk       Partition       Length              |
|   +-------------------------------------------------+            |
|   |/dev/dsk/1s1    1          1             1073120 |            |
|   |                                                 |            |
|   +-------------------------------------------------+            |
|                                                                  |
|   offset: 833100                      Disk map                   |
|                                       --------                   |
|   Length: <shaded out>                                           |
|                                                                  |
|                                                                  |
|                                                                  |
|   OK                  CANCEL               HELP                  |
+------------------------------------------------------------------+
Click 'OK'.
+------------------------------------------------------------------+
|                       New: Mirror                                |
|   +---Vdisk parameters---------------------------------------+   |
|   |                                                          |   |
|   |   Type: Mirror                       Cluster size: 32    |   |
|   |                                                          |   |
|   |   Virtual Device: /dev/dsk/vdisk5                        |   |
|   +----------------------------------------------------------+   |
|                                                                  |
|                                                                  |
|   Select a piece to allocate                                     |
|                                                                  |
|   +----------------------------------------------------------+   |
|   |                                                          |   |
|   |Piece 1: /dev/dsk/vdisk4 offset 0 Length 240000           |   |
|   |                                                          |   |
|   |Piece 2: /dev/dsk/1s1 offset 833100 Length 240000 parity  |   |
|   |                                                          |   |
|   +----------------------------------------------------------+   |
|                                                                  |
|   +-----------------+                                            |
|   |Allocate piece   |                                            |
|   +-----------------+                                            |
|                                                                  |
|   +--------------+          +--------------+      +--------+     |
|   | Create       |          | Cancel       |      | Help   |     |
|   +--------------+          +--------------+      +--------+     |
+------------------------------------------------------------------+
Click on 'Create'. You will get an information window telling
you it has successfully created the virtual disk and that
parity needs to be restored before it can be used. Do this now?
Choose 'YES'.  This will give you a percentage completed screen.
Wait for it to complete. You will then get "Successfully restored
/dev/dsk/vdisk5".  Click 'OK'.

*NOTE* You will then get a menu to create a filesystem with a warning that one already exists, and by creating one your data will be destroyed. To preserve your data on /u choose 'CANCEL'. In fact you have already created a filesystem on /u upon installation so there is no need to choose anything other than 'CANCEL'.

*NOTE* If prior to taking steps to mirror /u, mkdev fs was run to mount the /u filesystem, some preliminary steps must be taken before going into the Filesystem Manager so you can access your data. You should run mkdev fs again and remove the filesystem so the entry in /etc/default/filesys is deleted for /u. Also make sure /u is not mounted. If it is unmount it.

You must now bring up the Filesystem Manager so you can mount the filesystem and access the data. You can do this on the Desktop by clicking on System Administration==>Filesystems==>Filesystem Manager, which brings you to the following screen:

+------------------------------------------------------------------+
|         Mount   Status of filesystems on <machine name>          |
|                                                                  |
|   [  /dev/boot            /stand           read-only             |
|                                                                  |
|   [  /dev/root           /stand            read-write            |
|                                                                  |
+------------------------------------------------------------------+

Note: There may be other filesystems listed, depending on your system.

Click on 'Mount--->Add Mount Configuration--->Local'.
+-----------------------------------------------------------------+
|                                                                 |
|   Device File: /dev/dsk/vdisk5                                  |
|                                                                 |
|   Mount Point: /u                                              |
|                                                                 |
|   Description optional:                                         |
|                                                                 |
|   +----------------------------------+  +--Mount Options------+ |
|   |   Filesystem Type   HTFS         |  | Check and Repair    | |
|   |                                  |  |                     | |
|   |   Access Mode:  Read-Write       |  | Advanced Options    | |
|   |                                  |  |                     | |
|   |   Can user mount?                |  | When to mount       | |
|   |                                  |  |                     | |
|   |                                  |  | [] Now              | |
|   |                                  |  | [] At system startup| |
|   +----------------------------------+  +---------------------+ |
|                                                                 |
|   OK                    CANCEL                 HELP             |
+-----------------------------------------------------------------+

Note: In our example I chose /u as my mount point. So, to access data I would cd to /u. To fsck my filesystem however, I would umount by typing umount /u and type:

fsck /dev/dsk/vdisk5

After making any necessary modifications click 'OK'.

You will see a message adding mount configuration. A window will come up showing this new filesystem added. You can now cd to /u to access the filesystem.

IMPORTANT NOTICE:  It is ESSENTIAL that good reliable backups
                   of the filesystem exist. If either the root
                   or parity drive should fail, see the Virtual
                   Disk Manager Release 1.1 Release Notes. Refer
                   to the section entitled "Replacing a Mirrored
                   Root or Parity Disk."

See also

SCO OpenServer 5.0 System Administration Guide, Chapter 8 and the Virtual Disk Manager Release 1.1 Release Notes.

From the Xinuos technical article database, record 105185. Reproduced with permission. The original is at www.sco.com/ta/105185, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.