+ <section xml:id="backup_fs_level">
+ <title>
+ <indexterm>
+ <primary>backup</primary>
+ <secondary>OST file system</secondary>
+ </indexterm>
+ <indexterm>
+ <primary>backup</primary>
+ <secondary>MDT file system</secondary>
+ </indexterm>Backing Up an OST or MDT (Backend File System Level)</title>
+ <para>This procedure provides an alternative to backup or migrate the data
+ of an OST or MDT at the file level. At the file-level, unused space is
+ omitted from the backup and the process may be completed quicker with a
+ smaller total backup size. Backing up a single OST device is not
+ necessarily the best way to perform backups of the Lustre file system,
+ since the files stored in the backup are not usable without metadata stored
+ on the MDT and additional file stripes that may be on other OSTs. However,
+ it is the preferred method for migration of OST devices, especially when it
+ is desirable to reformat the underlying file system with different
+ configuration options or to reduce fragmentation.</para>
+ <note><para>
+ <emphasis role="bold">Prior to Lustre software release 2.3</emphasis>, the
+ only successful way to perform an MDT backup and restore was to do a
+ device-level backup as described in
+ <xref linkend="dbdoclet.backup_device" />. The ability to do MDT
+ file-level backups is not available for Lustre software release 2.0
+ through 2.2, because restoration of the Object Index (OI) file does not
+ return the MDT to a functioning state.</para>
+ <para><emphasis role="bold">Since Lustre software release 2.3</emphasis>,
+ Object Index files are automatically rebuilt at first mount after a
+ restore is detected (see
+ <link xl:href="http://jira.hpdd.intel.com/browse/LU-957">LU-957</link>),
+ so file-level MDT restore is supported.</para></note>
+ <section xml:id="backup_fs_level.index_objects" condition="l2B">
+ <title>
+ <indexterm>
+ <primary>backup</primary>
+ <secondary>index objects</secondary>
+ </indexterm>Backing Up an OST or MDT (Backend File System Level)</title>
+ <para>Prior to Lustre software release 2.11.0, we can only do the backend
+ file system level backup and restore process for ldiskfs-based systems.
+ The ability to perform a zfs-based MDT/OST file system level backup and
+ restore is introduced beginning in Lustre software release 2.11.0.
+ Differing from an ldiskfs-based system, index objects must be backed up
+ before the unmount of the target (MDT or OST) in order to be able to
+ restore the file system successfully. To enable index backup on the
+ target, execute the following command on the target server:</para>
+ <screen># lctl set_param osd-zfs.${fsname}-${target}.index_backup=1</screen>
+ <para><replaceable>${target}</replaceable> is composed of the target type
+ (MDT or OST) plus the target index, such as <literal>MDT0000</literal>,
+ <literal>OST0001</literal>, and so on.</para>
+ <note><para>The index_backup is also valid for an ldiskfs-based system,
+ that will be used when migrating data between ldiskfs-based and
+ zfs-based systems as described in <xref linkend="migrate_backends"/>.
+ </para></note>
+ </section>
+ <section xml:id="backup_fs_level.ost_mdt">
+ <title>
+ <indexterm>
+ <primary>backup</primary>
+ <secondary>OST and MDT</secondary>
+ </indexterm>Backing Up an OST or MDT</title>
+ <para>For Lustre software release 2.3 and newer with MDT file-level backup
+ support, substitute <literal>mdt</literal> for <literal>ost</literal>
+ in the instructions below.</para>
+ <orderedlist>
+ <listitem>
+ <para><emphasis role="bold">Umount the target</emphasis></para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">Make a mountpoint for the file system.
+ </emphasis></para>
+ <screen>[oss]# mkdir -p /mnt/ost</screen>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">Mount the file system.</emphasis></para>
+ <para>For ldiskfs-based systems:</para>
+ <screen>[oss]# mount -t ldiskfs /dev/<emphasis>{ostdev}</emphasis> /mnt/ost</screen>
+ <para>For zfs-based systems:</para>
+ <orderedlist>
+ <listitem>
+ <para>Import the pool for the target if it is exported. For example:
+ <screen>[oss]# zpool import lustre-ost [-d ${ostdev_dir}]</screen>
+ </para>
+ </listitem>
+ <listitem>
+ <para>Enable the <literal>canmount</literal> property on the target
+ filesystem. For example:
+ <screen>[oss]# zfs set canmount=on ${fsname}-ost/ost</screen>
+ You also can specify the mountpoint property. By default, it will
+ be: <literal>/${fsname}-ost/ost</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>Mount the target as 'zfs'. For example:
+ <screen>[oss]# zfs mount ${fsname}-ost/ost</screen>
+ </para>
+ </listitem>
+ </orderedlist>