Getting started

Amir Goldstein edited this page May 29, 2016 · 2 revisions

Table of Contents

Install next3

This section contains instructions for installing the next3 kernel module and utils.

The next3-1.0.13 package was tested on Ubuntu 9.10-10.10 distributions and on x86 and x86_64 machines, but should work on any distribution with kernel version between 2.6.31 and 2.6.35 and on any machine.

Support for other kernel versions will be provided later on or per demand.

Download and build next3 kernel module and utils

Download the next3 package from the next3 project download page.

The next3 kernel module has to match the kernel version on your system, so the next3 Makefile detects your kernel version and tries to download matching patches from the next3 website.

Pre-compiled binaries (for x86) of the patched e2fsprogs utils are included in the next3 package. If those binaries fail to execute, the Makefile will build the utils for your system.

To build the next3 kernel module and optionally the next3 utils, run:

# tar xfz next3-1.0.12.tar.gz
# cd next3-1.0.12
# make
downloading next3 patches for kernel 2.6.29.3...
...
make -C /lib/modules/2.6.29.3/build M=/home/amir/next3-1.0.12/next3 modules
...
  LD [M]  /home/amir/next3-1.0.12/next3/next3.ko
make[1]: Leaving directory `/usr/src/kernels/linux-2.6.29.3'
bin/mkfs.next3 -V || make e2fsprogs
mke2fs 1.41.9-next3-1.0.12 (25-Jul-2010)
        Using EXT2FS Library version 1.41.9-next3-1.0.12
bin/fsck.next3 -V
e2fsck 1.41.9-next3-1.0.12 (25-Jul-2010)
        Using EXT2FS Library version 1.41.9-next3-1.0.12, 25-Jul-2010

Test next3 snapshots

At this point, you can test next3 snapshots without installing the module and utils on your system. To create a next3 filesystem on an image file and test snapshots, run:

# sudo make test
grep next3 /proc/modules || /sbin/insmod next3/next3.ko
(test -f test.img && (bin/tunefs.next3 -l test.img | grep UUID)) || ( touch test.img ; yes | bin/mkfs.next3 test.img 1048576 )
mke2fs 1.41.9-next3-1.0.12 (25-Jul-2010)
...
Running snapshot test 1:
------------------------
...

Install next3 kernel module and utils

To install the next3 kernel module and utils on your system, run:

# sudo make install
mkdir -p /lib/modules/2.6.29.3/fs/next3
install -m 644 next3/next3.ko /lib/modules/2.6.29.3/fs/next3
/sbin/depmod -a
/sbin/modprobe next3
install bin/next3 /sbin
install bin/fsck.next3 /sbin
install bin/mkfs.next3 /sbin
install bin/tunefs.next3 /sbin
install bin/lsattr.next3 /sbin
install bin/chattr.next3 /sbin

Getting started with snapshots

Please follow the steps below to setup a next3 filesystem and start using snapshots.

Setup a next3 filesystem

Run the "next3 mkfs" command to create a new next3 filesystem.

Example:

# next3 mkfs /dev/1/vol1
mke2fs 1.41.9-next3-1.0.12 (25-Jul-2010)
...
next3 filesystem created on /dev/1/vol1
.
# mount -t next3 /dev/1/vol1 /var/vol/1

The format will fail if the filesystem is smaller than 4G.

Alternatively, run the "next3 on" command to convert an existing ext3 filesystem to next3.

Example:

# umount /var/vol/1
# next3 on /dev/1/vol1
tune2fs 1.41.9-next3-1.0.12 (25-Jul-2010)
...
snapshot feature added to /dev/1/vol1
.
# mount -t next3 /dev/1/vol1 /var/vol/1

The conversion will fail if the filesystem is smaller than 4G or if the existing ext3 filesystem has a block size other than 4K. It is recommended to remove the journal before converting to next3.

Take a snapshot

To take a snapshot named 'Monday', use the command "next3 take Monday". To view the status of current snapshots, use the command "next3 stat".

Example:

# next3 take Monday
snapshot /var/vol/1@Monday was created
.
# next3 stat
Mounted next3 filesystem and snapshots:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/1/vol1          480713424    203016 456091492   0% /var/vol/1
.
Snapshots list:
id inode attributes disk-usage mtime filename
---------------------------------------------
1 21184514 Sna---o- 172.0K Feb 9 18:51 /var/vol/1/.snapshots/Monday
.

Mount a snapshot

To mount snapshot 'Monday', use the command "next3 mount Monday". The snapshot will be mounted at "NEXT3_ROOT@Monday" with read-only access.

# next3 stat
Mounted next3 filesystem and snapshots:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/1/vol1          480713424    203020 456091488   0% /var/vol/1
.
Snapshots list:
id inode attributes disk-usage mtime filename
---------------------------------------------
1 21184514 S-a----- 176.0K Feb 9 18:51 /var/vol/1/.snapshots/Monday
.
# next3 mount Monday
snapshot /var/vol/1@Monday is mounted
.
# next3 stat
Mounted next3 filesystem and snapshots:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/1/vol1          480713424    203020 456091488   0% /var/vol/1
/var/vol/1/.snapshots/Monday
                     480713424    203016 456091492   0% /var/vol/1@Monday
.
Snapshots list:
id inode attributes disk-usage mtime filename
---------------------------------------------
1 21184514 Sna---o- 176.0K Feb 9 18:51 /var/vol/1/.snapshots/Monday
.

Delete a snapshot

Finally, to delete snapshot 'Monday', use the command "next3 delete Monday".

# next3 delete Monday
snapshot /var/vol/1@Monday was unmounted
.
snapshot /var/vol/1@Monday is deleted
.
# next3 stat
Mounted next3 filesystem and snapshots:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/1/vol1          480713424    202844 456091664   0% /var/vol/1
.
Snapshots list:
id inode attributes disk-usage mtime filename
---------------------------------------------
1 21184514 ----s--- 0 Feb 9 18:51 /var/vol/1/.snapshots/Monday
.

What else?

A few more useful commands:

  • "next3 help CMD" - display help on next3 commands.
  • "next3 debug N" - set next3 debug level (default=1).
  • "next3 tests" - runs a few simple sanity tests.