btrfs-progs: replace test_issubvolume() with btrfs_util_is_subvolume()
[platform/upstream/btrfs-progs.git] / Documentation / btrfs-replace.asciidoc
1 btrfs-replace(8)
2 ================
3
4 NAME
5 ----
6 btrfs-replace - replace devices managed by btrfs with other device.
7
8 SYNOPSIS
9 --------
10 *btrfs replace* <subcommand> <args>
11
12 DESCRIPTION
13 -----------
14 *btrfs replace* is used to replace btrfs managed devices with other device.
15
16 SUBCOMMAND
17 ----------
18 *cancel* <mount_point>::
19 Cancel a running device replace operation.
20
21 *start* [-Bfr] <srcdev>|<devid> <targetdev> <path>::
22 Replace device of a btrfs filesystem.
23 +
24 On a live filesystem, duplicate the data to the target device which
25 is currently stored on the source device.
26 If the source device is not available anymore, or if the -r option is set,
27 the data is built only using the RAID redundancy mechanisms.
28 After completion of the operation, the source device is removed from the
29 filesystem.
30 If the <srcdev> is a numerical value, it is assumed to be the device id
31 of the filesystem which is mounted at <path>, otherwise it is
32 the path to the source device. If the source device is disconnected,
33 from the system, you have to use the devid parameter format.
34 The <targetdev> needs to be same size or larger than the <srcdev>.
35 +
36 NOTE: the filesystem has to be resized to fully take advantage of a
37 larger target device; this can be achieved with
38 `btrfs filesystem resize <devid>:max /path`
39 +
40 `Options`
41 +
42 -r::::
43 only read from <srcdev> if no other zero-defect mirror exists.
44 (enable this if your drive has lots of read errors, the access would be very
45 slow)
46 -f::::
47 force using and overwriting <targetdev> even if it looks like
48 it contains a valid btrfs filesystem.
49 +
50 A valid filesystem is assumed if a btrfs superblock is found which contains a
51 correct checksum. Devices that are currently mounted are
52 never allowed to be used as the <targetdev>.
53 +
54 -B::::
55 no background replace.
56
57 *status* [-1] <mount_point>::
58 Print status and progress information of a running device replace operation.
59 +
60 `Options`
61 +
62 -1::::
63 print once instead of print continuously until the replace
64 operation finishes (or is cancelled)
65
66 EXIT STATUS
67 -----------
68 *btrfs replace* returns a zero exit status if it succeeds. Non zero is
69 returned in case of failure.
70
71 AVAILABILITY
72 ------------
73 *btrfs* is part of btrfs-progs.
74 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
75 further details.
76
77 SEE ALSO
78 --------
79 `mkfs.btrfs`(8),
80 `btrfs-device`(8),