6253 F_GETLK doesn't always return lock owner
[illumos-gate.git] / usr / src / man / man1m / ramdiskadm.1m
blob0079dbf6e34d43a2a2fe6e43eacb1965e625dcb1
1 '\" te
2 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH RAMDISKADM 1M "Mar 25, 2003"
7 .SH NAME
8 ramdiskadm \- administer ramdisk pseudo device
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/sbin/ramdiskadm\fR \fB-a\fR \fIname\fR \fIsize\fR [g | m | k | b]
13 .fi
15 .LP
16 .nf
17 \fB/usr/sbin/ramdiskadm\fR \fB-d\fR \fIname\fR
18 .fi
20 .LP
21 .nf
22 \fB/usr/sbin/ramdiskadm\fR
23 .fi
25 .SH DESCRIPTION
26 .sp
27 .LP
28 The \fBramdiskadm\fR command administers \fBramdisk\fR(7D), the ramdisk driver.
29 Use \fBramdiskadm\fR to create a new named ramdisk device, delete an existing
30 named ramdisk, or list information about existing ramdisks.
31 .sp
32 .LP
33 Ramdisks created using \fBramdiskadm\fR are not persistent across reboots.
34 .SH OPTIONS
35 .sp
36 .LP
37 The following options are supported:
38 .sp
39 .ne 2
40 .na
41 \fB\fB-a\fR \fIname\fR \fIsize\fR\fR
42 .ad
43 .RS 16n
44 Create a ramdisk named \fIname\fR of size \fIsize\fR and its corresponding
45 block and character device nodes.
46 .sp
47 \fIname\fR must be composed only of the characters a-z, A-Z, 0-9, _ (underbar),
48 and - (hyphen), but it must not begin with a hyphen. It must be no more than 32
49 characters long. Ramdisk names must be unique.
50 .sp
51 The size can be a decimal number, or, when prefixed with \fB0x\fR, a
52 hexadecimal number, and can specify the size in bytes (no suffix), 512-byte
53 blocks (suffix \fBb\fR), kilobytes (suffix \fBk\fR), megabytes (suffix \fBm\fR)
54 or gigabytes (suffix \fBg\fR). The size of the ramdisk actually created might
55 be larger than that specified, depending on the hardware implementation.
56 .sp
57 If the named ramdisk is successfully created, its block device path is printed
58 on standard out.
59 .RE
61 .sp
62 .ne 2
63 .na
64 \fB\fB-d\fR \fIname\fR\fR
65 .ad
66 .RS 16n
67 Delete an existing ramdisk of the name \fIname\fR. This command succeeds only
68 when the named ramdisk is not open. The associated memory is freed and the
69 device nodes are removed.
70 .sp
71 You can delete only ramdisks created using \fBramdiskadm\fR. It is not possible
72 to delete a ramdisk that was created during the boot process.
73 .RE
75 .sp
76 .LP
77 Without options, \fBramdiskadm\fR lists any existing ramdisks, their sizes (in
78 decimal), and whether they can be removed by \fBramdiskadm\fR (see the
79 description of the \fB-d\fR option, above).
80 .SH EXAMPLES
81 .LP
82 \fBExample 1 \fRCreating a 2MB Ramdisk Named \fBmydisk\fR
83 .sp
84 .in +2
85 .nf
86 # ramdiskadm -a mydisk 2m
87 /dev/ramdisk/mydisk
88 .fi
89 .in -2
90 .sp
92 .LP
93 \fBExample 2 \fRListing All Ramdisks
94 .sp
95 .in +2
96 .nf
97 # ramdiskadm
98 Block Device                   Size  Removable
99 /dev/ramdisk/miniroot     134217728    No
100 /dev/ramdisk/certfs         1048576    No
101 /dev/ramdisk/mydisk         2097152    Yes
103 .in -2
106 .SH EXIT STATUS
109 \fBramdiskadm\fR returns the following exit values:
111 .ne 2
113 \fB\fB0\fR\fR
115 .RS 6n
116 Successful completion.
120 .ne 2
122 \fB\fB>0\fR\fR
124 .RS 6n
125 An error occurred.
128 .SH ATTRIBUTES
131 See \fBattributes\fR(5) for descriptions of the following attributes:
136 box;
137 c | c
138 l | l .
139 ATTRIBUTE TYPE  ATTRIBUTE VALUE
141 Interface Stability     Evolving
144 .SH SEE ALSO
147 \fBattributes\fR(5), \fBramdisk\fR(7D)
148 .SH NOTES
151 The abilities of \fBramdiskadm\fR and the privilege level of the person who
152 uses the utility are controlled by the permissions of \fB/dev/ramdiskctl\fR.
153 Read access allows query operations, for example, listing device information.
154 Write access is required to do any state-changing operations, for example,
155 creating or deleting ramdisks.
158 As shipped, \fB/dev/ramdiskctl\fR is owned by \fBroot\fR, in group \fBsys\fR,
159 and mode 0644, so all users can do query operations but only root can perform
160 state-changing operations. An administrator can give write access to
161 non-privileged users, allowing them to add or delete ramdisks. However,
162 granting such ability entails considerable risk; such privileges should be
163 given only to a trusted group.