Whamcloud - gitweb
LU-8726 osd-ldiskfs: bypass read for benchmarking
[fs/lustre-release.git] / lustre / doc / ldev.8
1 .TH ldev 8 Lustre ldev ldev
2 .SH NAME
3 ldev \- lustre device utility
4 .SH SYNOPSIS
5 .B "ldev [OPTIONS]"
6 .br
7 .SH DESCRIPTION
8 .B ldev
9 can be used to query information about lustre devices configured in
10 /etc/ldev.conf.  It is used by the lustre init script.
11 .SH OPTIONS
12 .B ldev
13 accepts the following options:
14 .TP
15 .I "-h, --help"
16 Display help message.
17 .TP
18 .I "-c, --config FILE"
19 Set path to config file.
20 .TP
21 .I "-H, --hostname NAME"
22 Use NAME instead of local hostname for queries.
23 .TP
24 .I "-p, --partner"
25 Print hostname of failover partner.
26 .TP
27 .I "-l, --local"
28 Print labels for local devices.
29 .TP
30 .I "-f, --foreign"
31 Print labels for foreign devices.
32 .TP
33 .I "-a, --all"
34 Print labels for local and foreign devices.
35 .TP
36 .I "-F, --filesys NAME"
37 Print labels for file system NAME.
38 .TP
39 .I "-s, --sanity"
40 Sanity check config on this node.
41 If any expected local or foreign devices are not present, print an error.
42 If devices do not contain the expected labels, print an error.
43 .TP
44 .I "-d, --device LABEL"
45 Print storage device of label.
46 .TP
47 .I "-j, --journal LABEL"
48 Print journal device corresponding to label if defined.
49 .TP
50 .I "-r, --raidtab LABEL"
51 Print Linux software raid configuration file or ZFS cache file associated with
52 LABEL, if any.  Using non-default names for these files may help prevent arrays
53 from being automatically started by the system.  This is important in failover
54 configurations where the timing of device initialization must be strictly
55 controlled.
56 .TP
57 .I "-t, --type LABEL"
58 Print device type of LABEL, i.e. "zfs" or "md".
59 .TP
60 .I "-z, --zpool LABEL"
61 Print zpool containing LABEL.
62 .TP
63 .I "-R, --role ROLE"
64 Filter output based on role, i.e. mdt, ost, mgs.
65 .TP
66 .I "CMD [ARGS...]"
67 Run one instance of \fICMD [ARGS]\fR for each label in parallel.
68 Only the local labels are used by default, but foreign, all, or file system
69 labels may be selected by adding the \fI--foreign\fR, \fI--all\fR, or
70 \fI--filesys\fR options.
71 The following substitutions are made:
72 %f=fsname, %d=device, %j=journal, %i=index, %I=hex-index, %t=type, %l=label,
73 %n=nid, %N=failnid, %m=mgsnid, %H=hostname, %b=backing-fs.  On failure of
74 any child processes, \fBldev\fR will return a non-zero exit code.
75 .LP
76 It is an error if %n, %N, or %m is used in a command and /etc/nids does not
77 contain appropriate host to NID mappings.
78 .SH EXAMPLES
79 To run a preen check on all devices in a cluster in parallel:
80 .IP
81 .nf
82 pdsh -S -g ost ldev fsck.ldiskfs -p %d
83 .fi
84 .LP
85 To re-format an entire file system:
86 .IP
87 .nf
88 #!/bin/bash -xe
89 export FANOUT=64
90
91 # MDTs
92 pdsh -S -g mds service lustre stop
93 pdsh -S -g mds ldev "yes \\| mkfs.ldiskfs -q -b4096 \\
94          -Ojournal_dev %j"
95 pdsh -S -g mds ldev dd if=/dev/zero of=%d count=8
96 pdsh -S -g mds ldev mkfs.lustre --mdt --mgs --fsname=%f \\
97          --index=%i --mkfsoptions=-Jdevice=%j \\
98          --mkfsoptions=-i2048 \\
99          --mountfsoptions=errors=panic,iopen_nopriv,user_xattr,\\
100                           maxdirsize=20000000 %d
101 pdsh -S -g mds ldev tune.ldiskfs -i0 -m0 -c0 %d
102
103 # OSTs
104 mgs=172.16.2.200@tcp0
105 pdsh -S -g ost service heartbeat stop
106 pdsh -S -g ost service lustre stop
107 pdsh -S -g ost ldev dd if=/dev/zero of=%d count=8
108 pdsh -S -g ost ldev mkfs.lustre --ost --mgsnode=$mgs --fsname=%f \\
109          --index=%i --param=lov.stripecount=2 --failnode=%N \\
110          --mountfsoptions=errors=panic,extents,mballoc %d
111 pdsh -S -g ost ldev tune.ldiskfs -epanic -i0 -m0 -c0 %d
112 .fi
113 .SH FILES
114 /etc/ldev.conf
115 .br
116 /etc/nids
117 .SH "SEE ALSO"
118 .BR ldev.conf (5)
119 .BR nids (5)