Tuesday, December 21, 2010

Veritas Storage – How to create DG, Volumes and Filesystem

In this article I will show some RAID level types as well as how to create Disk Groups, Volumes and Filesystems on Veritas Storage Foundation.
RAID is an acronym of Redundant Array of Independent Disks. RAID is an storage propose to manage an array of disks.
RAID configuration types are classified according to the RAID level, which is defined numbers of Disks, the way data is spanned across the disks and redundancy method.
RAID LEVELS
- DISK SPANNING (RAID 0)
It is the technique to combine in one logical point space from many physical disks. There are two method for Disk Spanning:
– Concatenation: It is a linear data allocation across two or more disks.
– Example:
The volume is composed by 2 disks (A and B) using concatenation layout. Then you will write data     sequentially across the disks. System will start to write data in disk A and it will go to disk B as soon as disk A is full.
– Stripping: It is an alternating equal-size data allocation across multiple disks.
- Example:
The volume is composed by 2 disks (A and B) using stripping layout. System spreads data across multiple disks.
- DATA REDUNDANCY (RAID 1)
RAID 1 type is focused to protect data against disk failure.

- Mirroring: It is the method to have two or more copies of data in different physical disks.
- RESILIENCE
Resilient volume combines two layout to build a volume.
- RAID 0 + 1: It is a combination of Level 0  (Stripping) and Level 1 (Mirroring)
- RAID 1 + 0: It is a combination of Level 1 (Mirroring) and Level 0 (Stripping).
*There are more RAID Levels that were not mentioned here.

I am going to show how to create a mirroring volume and a stripping volume on Veritas Storage Foundation.(I am going to use Veritas SF 5.0 running on Solaris 10).
The first step is to check quantity of disks you have available on the server. A simple way to check this on solaris is using format utility:
bash-3.00# format
Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <DEFAULT cyl 4092 alt 2 hd 128 sec 32>
/pci@0,0/pci15ad,1976@10/sd@0,0
1. c1t1d0 <DEFAULT cyl 7 alt 2 hd 64 sec 32>
/pci@0,0/pci15ad,1976@10/sd@1,0
2. c1t2d0 <DEFAULT cyl 7 alt 2 hd 64 sec 32>
/pci@0,0/pci15ad,1976@10/sd@2,0
3. c1t3d0 <DEFAULT cyl 2 alt 2 hd 64 sec 32>
/pci@0,0/pci15ad,1976@10/sd@3,0
Also, you can check disks available to Veritas Storage Foundation using vxdisk command:
bash-3.00# vxdisk -o alldgs list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:none – – online invalid
c1t1d0s2 auto:none – – online invalid
c1t2d0s2 auto:none – – online invalid
c1t3d0s2 auto:none – – online invalid
You can see above that there are 4 disks on the server that are available to Veritas but they have not yet been initialized by Veritas (invalid status). To use a disk on Veritas SF you need to initialize this using Veritas utilities.
NOTE: If you are going to use a disk on Veritas, pay attention that you should give this whole disk to Veritas. Disk will be formatted and you will lose all data in the disk when you are allocating a disk to Veritas Storage.
In this example the only disk that is in use for O.S Solaris is the first one. (c1t0d0s2).
We can use those 3 others disks to add on Veritas Storage.
Caution: If for a mistake we add the first disk (c1t0d0s2) to Veritas Storage, it will format the disk and erase Solaris info. We need to pay attention to get the right disks.
Let’s start allocating (initializing) those 3 disks to solaris:
bash-3.00# vxdisksetup -i c1t1d0
bash-3.00# vxdisksetup -i c1t2d0
bash-3.00# vxdisksetup -i c1t3d0
NOTE: online status means that the disk was initialized and can be used on Veritas Storage Foundation.
We have those 3 disks initialized on Veritas, then the next step is to create a Disk Group.
Disk Group
Disk Group is a collection of disks. Disk Group is very useful for management and isolation purpose.
Lets create a DG using only the fist disk initialized on Veritas (c1t1d0). We are using DG1 for the name of Disk Group.
bash-3.00# vxdg init DG1 c1t1d0
Check if  DG1 was created successfully:
bash-3.00# vxdg list
NAME STATE ID
DG1 enabled,cds 1218633322.13.vrt2
Also, check if the disk is properly assigned to DG1:
bash-3.00# vxdisk -o alldgs list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:none – – online invalid
c1t1d0s2 auto:cdsdisk c1t1d0 DG1 online
c1t2d0s2 auto:cdsdisk – – online
c1t3d0s2 auto:cdsdisk – – online
Let’s add more 2 disks to DG1:
bash-3.00# vxdg -g DG1 adddisk c1t2d0s2 c1t3d0s2
Check if the disks are properly assigned to DG1:
bash-3.00# vxdisk -o alldgs list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:none – – online invalid
c1t1d0s2 auto:cdsdisk c1t1d0 DG1 online
c1t2d0s2 auto:cdsdisk c1t2d0s2 DG1 online
c1t3d0s2 auto:cdsdisk c1t3d0s2 DG1 online
At this point we have added 3 disks into Disk Group DG1.
Next step we will create 2 different volumes in the DG1.
Volumes
A volume is a virtual storage that is used as an physical disk. Volume can be composed by many disks and have many layouts.
In this example, we are going to create two Volumes:
Volume VolS – Stripping layout using c1t1d0 and c1t2d0 disks (RAID 0).
Volume VolM – Mirroring layout using c1t2d0 and c1t3d0 (RAID 1).
To create a Stripping Volume VolS (Size=10m):
bash-3.00# vxassist -g DG1 make VolS 10m layout=stripe c1t1d0 c1t2d0s2
To check if volume VolS was created successfully:
bash-3.00# vxprint -g DG1
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dg DG1 DG1 – – – – – -
dm c1t1d0 c1t1d0s2 – 159488 – – – -
dm c1t2d0s2 c1t2d0s2 – 159488 – – – -
dm c1t3d0s2 c1t3d0s2 – 159488 – – – -
v VolS fsgen ENABLED 20480 – ACTIVE – -
pl VolS-01 VolS ENABLED 20480 – ACTIVE – -
sd c1t1d0-01 VolS-01 ENABLED 10240 0 – – -
sd c1t2d0s2-01 VolS-01 ENABLED 10240 0 – – -
To create a Mirroring Volume VolM (Size=10m):
bash-3.00# vxassist -g DG1 make VolM 10m layout=mirror c1t2d0s2 c1t3d0s2
To check if Volume VolM was created successfully:
bash-3.00# vxprint -g DG1
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dg DG1 DG1 – – – – – -
dm c1t1d0 c1t1d0s2 – 159488 – – – -
dm c1t2d0s2 c1t2d0s2 – 159488 – – – -
dm c1t3d0s2 c1t3d0s2 – 159488 – – – -
v VolM fsgen ENABLED 20480 – ACTIVE – -
pl VolM-01 VolM ENABLED 20480 – ACTIVE – -
sd c1t3d0s2-01 VolM-01 ENABLED 20480 0 – – -
pl VolM-02 VolM ENABLED 20480 – ACTIVE – -
sd c1t2d0s2-02 VolM-02 ENABLED 20480 0 – – -
v VolS fsgen ENABLED 20480 – ACTIVE – -
pl VolS-01 VolS ENABLED 20480 – ACTIVE – -
sd c1t1d0-01 VolS-01 ENABLED 10240 0 – – -
sd c1t2d0s2-01 VolS-01 ENABLED 10240 0 – – -
Note: You can see above that both Volumes were created successfully. Also, you can note the difference between stripping and mirroring volume layouts.
VolM is using two different Plex in differente disks. This means that if you lose one disk (Plex) you still have the data in the other disk (other Plex). It is the main configuration of Mirroring Volumes.
VolS is using only one Plex divided in 2 disks. This means that the data will be split in those 2 disks. If you lose one disk you would lose the whole Plex, therefore you would lose the data. This is the main configuration of Stripping Volumes. It does not provide data protection but it is very useful for performance for purpose.
Also, you can add those 2 layouts in only one layout that provide data protection and better performance. It is the case of RAID 0 + 1 or RAID 1 + 0.
In the next step we will create 2 different Filesystem using those 2 Volumes.
Filesystem
In this example we will create two filesystem:
- Filesystem fsS will use VolS. It will be mounted at /stripe mount point.
- Filesystem fsM will use VolM. It will be mounted at /mirror mount point.
To create a VxFS filesystem:
bash-3.00# mkfs -F vxfs /dev/vx/rdsk/DG1/VolS
version 7 layout
20480 sectors, 10240 blocks of size 1024, log size 1024 blocks
largefiles supported
bash-3.00# mkfs -F vxfs /dev/vx/rdsk/DG1/VolM
version 7 layout
20480 sectors, 10240 blocks of size 1024, log size 1024 blocks
largefiles supported
To mount a VxFS filesystem:
bash-3.00# mount -F vxfs /dev/vx/dsk/DG1/VolS /stripe/
bash-3.00# mount -F vxfs /dev/vx/dsk/DG1/VolM /mirror/
Now there are 2 filesystems configured and you can use it at Solaris Mount Point level.
Any data written in /stripe directory will be written in the stripping VolS volume.
Any data written in /mirror directory will be written in the mirroring VolM volume.
I hope this help you to understand how to:
  • Initialize a disk on Veritas Storage Foundation.
  • Create a Disk Group.
  • Add disks to a Disk Group.
  • Create a Stripping Volume.
  • Create a Mirroring Volume.
  • Create a VxFS Filesystem.
  • Mount a VxFS Filesystem.
Reference: Veritas Storage Foundation 5.0 for UNIX: Fundamental – Training Book

No comments:

Post a Comment