Skip to content

Instantly share code, notes, and snippets.

View rlaager's full-sized avatar

Richard Laager rlaager

View GitHub Profile
System Memory:
Physical RAM: 49134 MB
Free Memory : 7062 MB
LotsFree: 767 MB
ZFS Tunables (/etc/system):
ARC Size:
Current Size: 36590 MB (arcsize)
Target Size (Adaptive): 36592 MB (c)
rlaager@fly:~$ zpool status data
pool: data
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scan: resilver in progress since Mon Nov 19 09:55:58 2012
332M scanned out of 717G at 2.44M/s, 83h21m to go
79.3M resilvered, 0.05% done
config:
@rlaager
rlaager / gist:4361027
Created December 22, 2012 20:54
Add c7t1d0 to an existing root pool named "rpool" created using the OpenIndiana installer on c7t0d0.
# Add a default partition map on the new drive.
fdisk -B c7t1d0p0
# Copy the disk label from the first disk to the second:
prtvtoc /dev/rdsk/c7t0d0s0 | fmthard -s - /dev/rdsk/c7t1d0s0
# Attach the second disk to the root pool:
zpool attach rpool c7t0d0s0 c7t1d0s0
# You will get an error about overlapping. If you get another error, stop. Otherwise:
zpool attach -f rpool c7t0d0s0 c7t1d0s0
hdparm -I /dev/sda
# Note that it is "not locked" and security is "not enabled".
# Set a password:
hdparm --user-master u --security-set-pass password /dev/sda
# From this point, until after the security erase, if something goes wrong,
# you must remove the password before rebooting.
hdparm -I /dev/sda'
$ xdpyinfo
name of display: :0.0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 11103000
X.Org version: 1.11.3
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
@rlaager
rlaager / gist:4111654
Created November 19, 2012 16:31
ZFS Resilvering Errors
For the c2t5000C5002623694Bd0 disk, we received a SMART predictive failure
(fault.io.disk.predictive-failure) warning as well as
fault.io.scsi.cmd.disk.dev.rqs.derr from fmadm.
We then set out to replace the disk.
Here is the zpool status before the replacement:
# zpool status data
pool: data
diff -r 10ae2f408c94 dice/dice.c
--- a/dice/dice.c Wed Jan 18 22:20:42 2012 -0600
+++ b/dice/dice.c Sun Jun 10 16:17:12 2012 -0500
@@ -30,6 +30,10 @@
#include <debug.h>
#include <plugin.h>
+#define PLUGIN_ID "core-plugin_pack-dice"
+#define PREFS_PREFIX "/plugins/core/" PLUGIN_ID
+#define PREFS_REMOTE_CMD PREFS_PREFIX "/remote_cmd"
ZFS on Linux Improvements
1. `zpool status` can output disk names which are under /dev/disk.
2. `zpool status` outputs the whole disk device for wholedisk pools,
but GRUB needs the partition device.
Before this can be accepted upstream, I am to merge it into the
existing /dev scanning code.
Index: grub/util/getroot.c
@rlaager
rlaager / zvol-size-16k.log
Created March 8, 2012 23:14
zvol size utilization
ashift=9 vdev=raidz1 disks=3
tank/foo 102M 1.84G 101M -
ashift=9 vdev=raidz1 disks=4
tank/foo 103M 2.80G 103M -
ashift=9 vdev=raidz1 disks=5
tank/foo 102M 3.76G 101M -
ashift=9 vdev=raidz1 disks=6
@rlaager
rlaager / test.c
Created February 23, 2012 17:13
Hole Punch Test
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <linux/falloc.h>
int main()