I just needed a small shell (bash) script to synchronize the zfs snapshots of the dataset pool1/gesichert on two different PCs (PC1 and PC2) to be run on PC2. I asked Grok (MechaHitler), here is what it came up with: [bash] #!/bin/bash # Get latest snapshot on PC2 PC2_LATEST=$(zfs list -t snapshot -o name -s … Continue reading Using Grok to create a shell script
Category: zfs
Destroying multiple ZFS snapshots
Note to self: Sometimes it is necessary to destroy not just a single but multiple ZFS snapshots. This can be done with some command line magic, but the zfs destroy subcommand has built in functionality too. Given a dataset pool1/dataset1 with 5 snapshots: snapshot1 snapshot2 snapshot3 snapshot4 snapshot5 [bash]zfs destroy pool1/dataset1@snapshot1,snapshot2,snapshot4[/bash] will destroy snapshot1, snapshot2 … Continue reading Destroying multiple ZFS snapshots
ZFS Snapshots und Samba Shadow Copy [German only]
Ich bin seit einiger Zeit ein großer Fan von ZFS und sammle immer wieder mal Links zu dem Thema. Es gibt einen Blog-Post ZFS Snapshots und Samba Shadow Copy (auf Deutsch) von Manfred Larcher, den ich gerade gefunden habe, und den ich hiermit erwähnen will, so dass ich ihn später auch wieder finde.
Preventing accidental data loss with ZFS
I have recently converted the file system of some of our Samba servers from ext4 to ZFS. The idea was to use ZFS's compression feature to reduce the space some excessingly large files consume which can be easily compressed to take less than 1/10 the space. This works fine. Today we found that a directory … Continue reading Preventing accidental data loss with ZFS
Replacing a failed drive in a zfs pool
So I can look it up later: When a drive that is part of a zfs pool fails and has already been physicall replaced in the server. zpool status looks like this: [bash] user@server:~$ zpool status pool: main state: DEGRADED status: One or more devices could not be used because the label is missing or … Continue reading Replacing a failed drive in a zfs pool