manpagez: man pages & more
info gdbm
Home | html | info | man

File: gdbm.info,  Node: Filesystems supporting crash tolerance,  Next: Enabling crash tolerance,  Up: Crash Tolerance

17.1 Using Proper Filesystem
============================

Use a filesystem that supports reflink copying.  Currently XFS, BtrFS,
and OCFS2 support reflink.  You can create such a filesystem if you
don't have one already.  (Note that reflink support may require that
special options be specified at the time of filesystem creation; this is
true of XFS.) The most conventional way to create a filesystem is on a
dedicated storage device.  However it is also possible to create a
filesystem _within an ordinary file_ on some other filesystem.

   For example, the following commands, executed as root, will create a
smallish XFS filesystem inside a file on another filesystem:

     mkdir XFS
     cd XFS
     truncate --size 512m XFSfile
     mkfs -t xfs -m crc=1 -m reflink=1 XFSfile
     mkdir XFSmountpoint
     mount -o loop XFSfile XFSmountpoint

   The XFS filesystem is now available in directory 'XFSmountpoint'.
Now, create a directory where your unprivileged user account may create
and delete files:

     cd XFSmountpoint
     mkdir test
     chown USER:GROUP test

(where USER and GROUP are the user and group names of the unprivileged
account the application uses).

   Reflink copying via 'ioctl(FICLONE)' should work for files in and
below this directory.  You can test reflink copying using the GNU 'cp'
program:

     cp --reflink=always file1 file2

   *Note reflink: (coreutils)cp invocation.

   Your GNU dbm database file and two "snapshot" files described below
must all reside on the same reflink-capable filesystem.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.