This week I managed to create a RAID-Z pool of hard drives to begin using on the file server for the house.
Here’s a quick howto on how I accomplished this:
- Install NexentaCP. (You can use any Solaris flavor you’d like though. I chose Nexenta for it’s apt-get repository.)
- Run the ‘format’ command to determine which drives you’re going to add to the pool.
root@ufuk:~# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0d0 <default cyl 4862 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
1. c1d0 <st350064- 3PM0FS6-0001-465.76GB>
/pci@0,0/pci-ide@1f,1/ide@1/cmdk@0,0
2. c1d1 <default cyl 24790 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@1f,1/ide@1/cmdk@1,0
3. c2d0 <maxtor S- 5QG01BG-0001-465.76GB>
/pci@0,0/pci8086,244e@1e/pci-ide@3/ide@0/cmdk@0,0
4. c4d0 <maxtor S- 5QG01BM-0001-465.76GB>
/pci@0,0/pci8086,244e@1e/pci-ide@3/ide@1/cmdk@0,0
5. c5d0 <st350063- 9QG0QH4-0001-465.76GB>
/pci@0,0/pci8086,244e@1e/pci-ide@4/ide@0/cmdk@0,0
Specify disk (enter its number):
Do a Ctrl-C at ‘Specify disk’ to not actually use the ‘format’ command on a drive. The disks that I want to install on are c1d0, c2d0, and c4d0. This will give me ~1TB of storage.
- Create the pool by running, replace ‘shet’ with your name:
root@ufuk:~# zpool create shet raidz c1d0 c2d0 c4d0
Be sure to not include partitions/slices if you want to use the whole drive as part of the pool, write-caching will be disabled. Replace ‘raidz’ with ‘mirror’ if you prefer to mirror your drives.
- The pool is instantly mounted to ‘/shet’. You can check this by running:
root@ufuk:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
shet 212G 703G 212G /shet
syspool 2.73G 33.0G 24K none
syspool/rootfs 2.73G 33.0G 2.56G legacy
syspool/rootfs@default 178M - 648M -
You can check the status of a pool by running:
root@ufuk:~# zpool status
pool: shet
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
shet ONLINE 0 0 0
raidz1 ONLINE 0 0 0
c1d0 ONLINE 0 0 0
c2d0 ONLINE 0 0 0
c4d0 ONLINE 0 0 0
errors: No known data errors
pool: syspool
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
syspool ONLINE 0 0 0
c0d0s0 ONLINE 0 0 0
errors: No known data errors
That’s it! You can now use it as is or create new filesystems. Since I’m just using this as a media dump, I just left it alone.