e6e37ee289b0ab4bcc5d5abf5a071b122705687e
compute/storage.md
| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | +<!-- TITLE: Storage Stuff --> |
|
| 2 | +<!-- SUBTITLE: The z in zfs stands for not losing your data --> |
|
| 3 | + |
|
| 4 | +## Replace a zpool with minimal downtime |
|
| 5 | +### Create new pool |
|
| 6 | +``` |
|
| 7 | +zpool create newpool raidz3 sdX sdY sdZ .... |
|
| 8 | +``` |
|
| 9 | + |
|
| 10 | +### Send the data |
|
| 11 | +``` |
|
| 12 | +zfs snapshot livepool@1 |
|
| 13 | +zfs send -R livepool@1 | zfs receive -F newpool |
|
| 14 | +``` |
|
| 15 | + |
|
| 16 | +### Re-sync data that's changed since the initial snapshot |
|
| 17 | +``` |
|
| 18 | +zfs snapshot livepool@2 |
|
| 19 | +zfs send -IR livepool@1 livepool@2 | zfs receive -F newpool |
|
| 20 | +``` |
|
| 21 | +Repeat this step if it took longer than you want - increment the @ snapshot numbers each time. |
|
| 22 | + |
|
| 23 | +### Flip the pools |
|
| 24 | +Shut down the apps. Check `lsof` and/or `fuser` to make sure nothing's using the FS. 'X' here is |
|
| 25 | +``` |
|
| 26 | +zpool export livepool |
|
| 27 | +zpool import livepool livepool.old |
|
| 28 | +zpool export livepool.old |
|
| 29 | +zpool export newpool |
|
| 30 | +zpool import newpool livepool |
|
| 31 | +``` |
|
| 32 | +Should be good to go to restart the apps. Destroy any snapshots when you're ready. |
|
| ... | ... | \ No newline at end of file |
compute/zfs.md
| ... | ... | @@ -1,32 +0,0 @@ |
| 1 | -<!-- TITLE: Storage Stuff --> |
|
| 2 | -<!-- SUBTITLE: The z in zfs stands for not losing your data --> |
|
| 3 | - |
|
| 4 | -## Replace a zpool with minimal downtime |
|
| 5 | -### Create new pool |
|
| 6 | -``` |
|
| 7 | -zpool create newpool raidz3 sdX sdY sdZ .... |
|
| 8 | -``` |
|
| 9 | - |
|
| 10 | -### Send the data |
|
| 11 | -``` |
|
| 12 | -zfs snapshot livepool@1 |
|
| 13 | -zfs send -R livepool@1 | zfs receive -F newpool |
|
| 14 | -``` |
|
| 15 | - |
|
| 16 | -### Re-sync data that's changed since the initial snapshot |
|
| 17 | -``` |
|
| 18 | -zfs snapshot livepool@2 |
|
| 19 | -zfs send -IR livepool@1 livepool@2 | zfs receive -F newpool |
|
| 20 | -``` |
|
| 21 | -Repeat this step if it took longer than you want - increment the @ snapshot numbers each time. |
|
| 22 | - |
|
| 23 | -### Flip the pools |
|
| 24 | -Shut down the apps. Check `lsof` and/or `fuser` to make sure nothing's using the FS. 'X' here is |
|
| 25 | -``` |
|
| 26 | -zpool export livepool |
|
| 27 | -zpool import livepool livepool.old |
|
| 28 | -zpool export livepool.old |
|
| 29 | -zpool export newpool |
|
| 30 | -zpool import newpool livepool |
|
| 31 | -``` |
|
| 32 | -Should be good to go to restart the apps. Destroy any snapshots when you're ready. |
|
| ... | ... | \ No newline at end of file |