Skip to content

Instantly share code, notes, and snippets.

@danielb2
Created April 10, 2017 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielb2/af0b9771b2fbd83424951b8df170bc69 to your computer and use it in GitHub Desktop.
Save danielb2/af0b9771b2fbd83424951b8df170bc69 to your computer and use it in GitHub Desktop.
``` bash
[~/tmp]$ ls -lh j1 j2 z1 z2
-rw-r--r-- 1 daniel daniel 174M Apr 10 13:11 j1
-rw-r--r-- 1 daniel daniel 174M Apr 10 13:11 j2
-rw-r--r-- 1 daniel daniel 731M Apr 10 13:10 z1
-rw-r--r-- 1 daniel daniel 731M Apr 10 13:10 z2
$ sudo zpool create ztest mirror (pwd)/j1 (pwd)/j2
$ sudo zpool set autoexpand=on ztest
[~/tmp]$ zpool status ztest
pool: ztest
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
ztest ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
/usr/home/daniel/tmp/j1 ONLINE 0 0 0
/usr/home/daniel/tmp/j2 ONLINE 0 0 0
errors: No known data errors
[~/tmp]$ zfs list ztest
NAME USED AVAIL REFER MOUNTPOINT
ztest 74.5K 128M 19K /ztest
[~/tmp]$ sudo zpool replace -f ztest (pwd)/j2 (pwd)/z2
[~/tmp]$ sudo zpool replace -f ztest (pwd)/j1 (pwd)/z1
[~/tmp]$ zfs list ztest
NAME USED AVAIL REFER MOUNTPOINT
ztest 86.5K 688M 19K /ztest
@danielb2
Copy link
Author

can create your own files with dd if=/dev/random of=j2 bs=1m count=1 for example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment