You are here: Articles > UNIX > Solaris

 See more articles about "Solaris "

ZFS: Create a raidz filesystem

 

ZFS supports a type of RAID-5 redundancy called raidz. This redundancy works at the ZFS pool level and affects all created filesystems in that pool. According to the Sun docs, raidz offers 'better distribution of parity [than RAID-5] and eliminates the RAID-5 write hole (in which data and parity become inconsistent after a power loss).' Creating RAID volumes in most volume managers (like VeritasVM) requires learning a new language describing the various components involved. ZFS requires one wee command.

Creating a raidz pool is similar to creating a normal pool. Only the addition of the 'raidz' keyword is required:



zpool create rex raidz c1t0d3 c1t0d4 c1t0d5 c1t0d6



This command creates a raidz pool named 'rex' consisting of four disks. One thing that's a little different in a ZFS raidz pool versus other RAID-5 filesystems is that the reported available disk space doesn't subtract the space required by parity. Consider the following 'zfs list' output before and after creating a 10G file in a raidz filesystem.



# zfs list

NAME                   USED  AVAIL  REFER  MOUNTPOINT

rex                    219K  76.8G    49K  /rex

# cd /rex

# mkfile 10g bigfile

# zfs list

NAME                   USED  AVAIL  REFER  MOUNTPOINT

rex                   13.4G  63.4G  13.4G  /rex



Although the file added only 10G to the filesystem, the change in the used space is 13.4G, so the parity is reflected in the usage. Just an important thing to keep in mind as you monitor your filesystem.

 

Also see ...

Display Solaris swap information
H3Having an appropriate amount of swap space is important for optimal system performance. Simple commands allow monitoring swap space utilization./H3PTo get a summary of total system swap space, use the span style="font weight: bold"swap/span command: br / br /div class="code"swap

Create a basic Solaris runtime control script
H3Runtime control scripts start and stop services when the system changes run levels. Well constructed rc scripts handle at least start and stop as command line arguments./H3PRuntime control scripts are just regular shell scripts and anything that is valid for the shell that executes it is va

Disable Solaris Registration program
H3Disable the registration from coming up when you log in (without registering). /H3Ptouch ~/.solregis/.disable/P

Read BootPROM settings from the Solaris command line
H3The ability to view BootPROM settings from the command line with eeprom prevents the need to boot to run level 0 just to check those environment variables./H3PTo read all BootPROM variables and their current settings, run: br / br /div class="code"eepromP br /To view a specif

Add a user from the command line in Solaris
H3How to use useradd in Solaris to add a user/H3PYou must be root (superuser) to add a user. An easy way to remember the syntax of the useradd command in Solaris is to run it with no options. Follow the resulting usage information including the parts that you require. Important options are: