RAID 0 in Solaris (Concate)

A Redundant Array of Independent Disks (RAID) configuration enables you to expand the characteristics od a storage volume beyond the physical limitations of a single disk. You can use a RAID configuration to increase disk capacity as well as to improve disk performance and fault tolerance.


The Solaris Volume Manager software provides a graphical user interface (GUI) tool to simplify system administration tasks on storage devices. But I'm not gonna use GUI to perform the task. RAID is a classification of methods to back up and to store data on multiple disk drives. There are six levels of RAID as well as a non-redundant array of independent disks (RAID 0).


The Solaris Volume Manager software uses metadevices, which are product-specific definitions of logical storage volumes, to implement RAID 0, RADI 1 and RAID 5 :
> RAID 0 : Non-redundant disk array (concatenation and striping)
> RAID 1 : Mirrored disk array
> RAID 5 : Block-interleaved distributed-parity

RAID-0 volumes, including both stripes and concatenations, are composed of slices and let you expand disk storage capacity. You can either use RAID-0 volumes directly or use the volumes as the building blocks for RAID-1 volume (mirrors). RAID-0 volumes allow you to expand disk storage capacity efficiently. These volumes do not provide data redundancy. If a single slice fails on a RAID-0 volume, there is a loss of data.There are two types of RAID-0 volumes:

> Concatenated volumes (or concatenations)
A concatenated volume writes data to the first available slice. When the first slice
is full, the volume writes data to the next available slice.
> Striped volumes (or stripes)
A stripe distributes data equally across all slices in the stripe

I've written a tutorial on how to implement RAID 1 (Mirrored disk array) and now I'm gonna show you how to implement RAID 0 (in this case, the concatenation)

Hardware specification:
1. SUN Fire V240
2. 4 x Disk (@ 72 GB)

As you can see, I have a box along with 4 internal disks. On disk No. 1 I'll install the Operating System, and on the other disks, I'm gonna "unite" it logically so the system will read it as a one physical disk. One more thing, since we're using the Solaris Volume Manager, don't forget to spare some space in any slice (usually slice-7) to store the metadb file. Just around 128 Mb.

1. Create initial state database replica.
root@fileserver # metadb -a -f c1t0d0s7

2. Verify the creation
root@fileserver # metadb
flags first blk block count
a u 16 8192 /dev/dsk/c1t0d0s7


3. Configure the metadevice
root@fileserver # metainit d10 3 1 c1t1d0s2 1 c1t2d0s2 1 c1t3d0s2
d10: Concat/Stripe is setup

- d10 is just the name
- 3 means that we're gonna make it using 3 slices
- 1 (from) c1t1d0s2, 1 (from) c1t2d0s2 and 1 (from) c1t3d0s2
- we use the slice 2 because we want to use all the three physical disks read as one logical disk.

4. Don't forget to create a new file-system on the concatenated disk.
root@fileserver # newfs /dev/md/rdsk/d10
/dev/md/rdsk/d10: Unable to find Media type. Proceeding with system determined parameters.
newfs: /dev/md/rdsk/d10 last mounted as /data
newfs: construct a new file system /dev/md/rdsk/d10: (y/n)? y
/dev/md/rdsk/d10: Unable to find Media type. Proceeding with system determined parameters.
Warning: 3264 sector(s) in last cylinder unallocated
/dev/md/rdsk/d10: 430027584 sectors in 69992 cylinders of 48 tracks, 128 sectors
209974.4MB in 4375 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
...............................................................................
........
super-block backups for last 10 cylinder groups at:
429098656, 429197088, 429295520, 429393952, 429492384, 429590816, 429689248,
429787680, 429886112, 429984544


5. Check the filesystem
root@fileserver # fsck /dev/md/rdsk/d10
** /dev/md/rdsk/d10
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
2 files, 9 used, 211758698 free (10 frags, 26469836 blocks, 0.0% fragmentation)


6. See the information about the disk
root@fileserver # df -h
Filesystem size used avail capacity Mounted on
/dev/dsk/c1t0d0s0 53G 667M 52G 2% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 3.2G 1.6M 3.2G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/dev/dsk/c1t0d0s4 4.8G 3.5G 1.2G 75% /usr
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
53G 667M 52G 2% /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
53G 667M 52G 2% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd
swap 3.2G 0K 3.2G 0% /tmp
swap 3.2G 48K 3.2G 1% /var/run
/dev/dsk/c1t0d0s5 4.8G 435M 4.3G 9% /opt
/dev/dsk/c1t0d0s6 4.8G 4.9M 4.8G 1% /export/home
/dev/md/dsk/d10 202G 64M 200G 1% /data


You can see the concatenated disk is 202Gb

PS: Don't forget to edit the /etc/vfstab

No comments:

Post a Comment