Here are my notes for a backup and restore test.
ZFS snapshots and send/receive for object backups.
This example is for combined mgs/mdt object, but the same would apply for an OST device-level backup. This example was run on on Redhat Enterprise Linux 6.2 and lustre 2.4.0.
Servers and filesystems in the example
luste2-8-25 - MGS/MDT server
lustre-meta/meta - Lustre ZFS MGS/MDT volume/filesystem on lustre2-8-25
lustre2-8-11 - OSS/OST server
lustre-ost0 - Lustre ZFS OST volume on lustre2-8-11
Backing up the object
Take a snapshot
"-r" means do a recursive snapshot, so this will include both the volume and the filesystem.
list existing snapshots
send and store on a remote ZFS/Lustre server:
note "-R" recursively sends the volume, filesystem, and preserves all properties. It is critical to preserve filesystem properties. If not using the "-R" flag, be sure to use "-p", we will show that during recovery.
Examine on remote side
Recovery from failure.
In testing, I first corrupted the filesystem with 'dd'. You could also simply reformat it for testing.
Create a new ZFS lustre volume/filesystem with the same name.
In my test case we have a raid 10:
Mount with "service start lustre"
This makes a volume called "lustre-meta" and filesystem "meta"
"mount" command shows:
Login into lustre2-8-11 (remote target where you stored the snapshot), and send the filesystem back.
Now I will only send the filesystem back, not the whole volume (why do a whole volume? Convenient if you have multiple datasets?)
-p = preserve attributes, important for the lustre filesystem to mount.
Back on On lustre2-8-11 (failed metadata server), rename the filesystem to make the snapshot active.
oops! That didn't work. You need to unmount the filesystem so it isn't busy.
Note, this doesn't mean stop the lustre service, if you do you can't access the zfs volume.
You should now be recovered.
The steps for backup ZFS backend var ZPL by 'tar':
1) Before umount the target (MDT or OST), please enable index backup on the target. For example:
Or you can write the proc interface on the target directly:
2) Umount the target.
3) Import the pool for the target if it is exported during the step 2). For example:
4) Enable "canmount" property on the target FS. For example:
You also can specify the "mountpoint" property. By default, it will be /${fsname}-mdt1/mdt1
5) Mount the target as 'zfs'. For example:
6) Backup the data. For example:
7) Umount the target and export the pool if you want.
Please save the /tmp/target.bz2 and /tmp/target.ea. If you want to migrate system from ZFS to ldiskfs, please backup the system as the same steps.