initial commit
This commit is contained in:
129
mint/sys/share/man/man8/ifconfig
Normal file
129
mint/sys/share/man/man8/ifconfig
Normal file
@@ -0,0 +1,129 @@
|
||||
.TH ifconfig 8 MintNet
|
||||
.SH NAME
|
||||
ifconfig \- network interface configuration
|
||||
.SH SYNOPSIS
|
||||
.B "ifconfig [-a|-v] [-f <filename>] [interface options]"
|
||||
.SH DESCRIPTION
|
||||
.I Ifconfig
|
||||
is used to set and show the addresses, flags and options
|
||||
of network interfaces.
|
||||
.PP
|
||||
When
|
||||
.I ifconfig
|
||||
is invoked without arguments,
|
||||
it shows a table of all running network interfaces, their addresses
|
||||
and flags in a human readable form.
|
||||
The option
|
||||
.B "-a"
|
||||
forces
|
||||
.I ifconfig
|
||||
to display all interfaces in the system, no
|
||||
matter if they are running or not. The option
|
||||
.B "-f <filename>"
|
||||
passes driver specific options to
|
||||
.I ifconfig
|
||||
. You will find descriptions for these specific options in the
|
||||
README files of every driver that supports this.
|
||||
.PP
|
||||
When a single argument (the name of a network interface) is given,
|
||||
.I ifconfig
|
||||
just shows the status of this interface.
|
||||
.PP
|
||||
.I ifconfig
|
||||
sets flags and addresses of the interface named as the first
|
||||
argument when additional options are given.
|
||||
.SH OPTIONS
|
||||
.TP 15
|
||||
.SM interface
|
||||
The name of the interface to deal with.
|
||||
.BR lo0 ,
|
||||
and
|
||||
.B sl0
|
||||
are valid names for the loopback interface and the SLIP interface
|
||||
(channel 0) respectively.
|
||||
.TP
|
||||
.SM "addr \fBinetaddr\fP"
|
||||
This option causes
|
||||
.I ifconfig
|
||||
to set the local IP address of the interface to
|
||||
.BR inetaddr .
|
||||
This is the address your machine can be reached at over this interface.
|
||||
.B inetaddr
|
||||
can be in standard IP address dot notation or can be a symbolic name
|
||||
which is resolved into an IP address.
|
||||
NOTE that you must not use a symbolic name when setting up the loopback
|
||||
interface, because symbolic names cannot be resolved before the loopback
|
||||
interface is set up.
|
||||
.TP
|
||||
.SM "dstaddr \fBinetaddr\fP"
|
||||
Set the point to point destination address of the interface to
|
||||
.BR inetaddr ,
|
||||
which
|
||||
can be an IP address or a symbolic name.
|
||||
This option will only work on point to point interfaces, like the
|
||||
.B sl?
|
||||
ones.
|
||||
.TP
|
||||
.SM "broadaddr \fBaa.bb.cc.dd\fP"
|
||||
Set the broadcast address of the interface to
|
||||
.BR "aa.bb.cc.dd" .
|
||||
This defaults to the net broadcast address of the attached network, but
|
||||
can be set to any valid IP address.
|
||||
This option will only work on interfaces that support broadcasting, like
|
||||
the
|
||||
.B lo0
|
||||
interface.
|
||||
.TP
|
||||
.SM "netmask \fBaa.bb.cc.dd\fP"
|
||||
Set the subnet mask of the interface to
|
||||
.BR "aa.bb.cc.dd" .
|
||||
This is by default the class A, B or C netmask of the local address
|
||||
of the interface set with the
|
||||
.B "addr"
|
||||
option.
|
||||
It can be used to split a large network into many small subnetworks.
|
||||
.TP
|
||||
.SM up
|
||||
This sets the UP flag on the interface. This is used to activate the
|
||||
interface.
|
||||
.TP
|
||||
.SM down
|
||||
This clears the UP flags on the interface. This is used to shut down
|
||||
the interface.
|
||||
.TP
|
||||
.SM [-]arp
|
||||
(De)activate usage of the ARP (address resolution protocol) protocol
|
||||
for resolving IP addresses into hardware addresses.
|
||||
.TP
|
||||
.SM [-]trailers
|
||||
(De)activate usage of trailer encapsulation for this interface.
|
||||
.TP
|
||||
.SM [-]debug
|
||||
(De)activate debugging for this interface. Debugging is currently
|
||||
a no-op.
|
||||
.TP
|
||||
.SM mtu NN
|
||||
Set the mtu (maximum transmission unit) of the interface to NN bytes.
|
||||
Better make it large enough as long as fragmentation is not implemented.
|
||||
.TP
|
||||
.SM metric NN
|
||||
Set the metric of the interface to NN. This value is currently not used.
|
||||
.TP
|
||||
.SM [-]linkNN
|
||||
This option sets (clears) the bit with number NN in the link level flag
|
||||
word of the interface.
|
||||
The flag word is 16 bits wide, so [-]link0 through [-]link15 are valid.
|
||||
Bit 0 is the least significant, bit 15 the most significant bit.
|
||||
.br
|
||||
Link level flags are interface type specific. Thats why
|
||||
.I ifconfig
|
||||
only uses bit numbers instead of meaningful names for them.
|
||||
Currently only SLIP interfaces support link level flags.
|
||||
Bit 3 turns auto compression on: if set and a VJ compressed SLIP
|
||||
frame is received the interface enables compression for outgoing frames.
|
||||
Bit 4 is the compression bit: if set VJ header compression is enabled.
|
||||
.SH AUTHOR
|
||||
Kay Roemer <roemer@rbi.informatik.uni-frankfurt.de>
|
||||
Torsten Lang <Torsten@Lang.net>
|
||||
.SH SEE ALSO
|
||||
.IR route(8).
|
||||
113
mint/sys/share/man/man8/mount
Normal file
113
mint/sys/share/man/man8/mount
Normal file
@@ -0,0 +1,113 @@
|
||||
|
||||
|
||||
|
||||
MOUNT(8) MAINTENANCE COMMANDS MOUNT(8)
|
||||
|
||||
|
||||
|
||||
NAME
|
||||
mount, umount - mount and unmount file systems
|
||||
|
||||
SYNOPSIS
|
||||
/usr/etc/mount [ -fnrv ] [ -t _t_y_p_e ] [ -o _o_p_t_i_o_n_s ] _f_i_l_e_s_y_s_-
|
||||
_t_e_m _d_i_r_e_c_t_o_r_y
|
||||
/usr/etc/umount [ -v ] _f_i_l_e_s_y_s_t_e_m|_d_i_r_e_c_t_o_r_y ...
|
||||
|
||||
DESCRIPTION
|
||||
mount attaches a named _f_i_l_e_s_y_s_t_e_m to the file system hierar-
|
||||
chy at the pathname location _d_i_r_e_c_t_o_r_y, which must already
|
||||
exist. If _d_i_r_e_c_t_o_r_y has any contents prior to the mount
|
||||
operation, these remain hidden until the _f_i_l_e_s_y_s_t_e_m is once
|
||||
again unmounted. If _f_i_l_e_s_y_s_t_e_m is of the form
|
||||
_h_o_s_t:_p_a_t_h_n_a_m_e, it is assumed to be an NFS file system (type
|
||||
nfs).
|
||||
|
||||
umount unmounts a currently mounted file system, which can
|
||||
be specified either as a _d_i_r_e_c_t_o_r_y or a _f_i_l_e_s_y_s_t_e_m.
|
||||
|
||||
mount and umount maintain a table of mounted file systems in
|
||||
/etc/mtab, described in fstab(5). If invoked without an
|
||||
argument, mount displays the contents of this table.
|
||||
|
||||
OPTIONS
|
||||
mount
|
||||
-f Fake an /etc/mtab entry, but do not actually mount any
|
||||
file systems.
|
||||
|
||||
-n Mount the file system without making an entry in
|
||||
/etc/mtab.
|
||||
|
||||
-v Verbose. Display a message indicating each file system
|
||||
being mounted.
|
||||
|
||||
-r Mount the specified file system read-only, even if the
|
||||
entry in /etc/fstab specifies that it is to be mounted
|
||||
read-write.
|
||||
|
||||
Physically write-protected and magnetic-tape file sys-
|
||||
tems must be mounted read-only. Otherwise errors occur
|
||||
when the system attempts to update access times, even
|
||||
if no write operation is attempted.
|
||||
|
||||
-o _o_p_t_i_o_n_s
|
||||
Specify file system _o_p_t_i_o_n_s, a comma-separated list of
|
||||
words from the list below. Some options are valid for
|
||||
all file system types, while others apply to a specific
|
||||
type only.
|
||||
|
||||
_o_p_t_i_o_n_s valid on _a_l_l file systems:
|
||||
|
||||
rw|ro Read/write or read-only.
|
||||
suid|nosuid Setuid execution allowed or disal-
|
||||
lowed.
|
||||
|
||||
The default is `rw,suid'.
|
||||
|
||||
_o_p_t_i_o_n_s specific to nfs (NFS) file systems:
|
||||
|
||||
rsize=_n Set the read buffer size to _n bytes.
|
||||
wsize=_n Set the write buffer size to _n
|
||||
bytes.
|
||||
timeo=_n Set the NFS timeout to _n tenths of a
|
||||
second.
|
||||
retrans=_n The number of NFS retransmissions.
|
||||
port=_n The server IP port number.
|
||||
acregmin=_n Hold cached attributes for at least
|
||||
_n seconds after file modification.
|
||||
acregmax=_n Hold cached attributes for no more
|
||||
than _n seconds after file modifica-
|
||||
tion.
|
||||
acdirmin=_n Hold cached attributes for at least
|
||||
_n seconds after directory update.
|
||||
acdirmax=_n Hold cached attributes for no more
|
||||
than _n seconds after directory
|
||||
update.
|
||||
actimeo=_n Set _m_i_n and _m_a_x times for regular
|
||||
files and directories to _n seconds.
|
||||
|
||||
actimeo has no default; it sets acregmin, acreg-
|
||||
max, acdirmin and acdirmax
|
||||
|
||||
Defaults for rsize and wsize are set internally by
|
||||
the system kernel.
|
||||
|
||||
umount
|
||||
-v Verbose. Display a message indicating each file system
|
||||
being unmounted.
|
||||
|
||||
EXAMPLES
|
||||
To mount a remote file system:
|
||||
mount serv:/usr/src /usr/src
|
||||
To mount a remote file system read-only:
|
||||
mount -o ro serv:/usr/src /usr/src
|
||||
|
||||
FILES
|
||||
/etc/mtab table of mounted file systems
|
||||
|
||||
SEE ALSO
|
||||
mkdir(2V), open(2V), fstab(5), mtab(5), automount(8),
|
||||
mountd(8C), nfsd(8)
|
||||
|
||||
BUGS
|
||||
As for now, it is only possible to mount a remote file system in
|
||||
/nfs.
|
||||
140
mint/sys/share/man/man8/netstat
Normal file
140
mint/sys/share/man/man8/netstat
Normal file
@@ -0,0 +1,140 @@
|
||||
.TH netstat 8 MiNT-Net
|
||||
.SH NAME
|
||||
netstat \- show active network connections
|
||||
.SH SYNOPSIS
|
||||
.B "netstat [-f domain]"
|
||||
.SH DESCRIPTION
|
||||
.I Netstat
|
||||
is used to display infomation about active communication
|
||||
endpoints in either the
|
||||
.B unix
|
||||
or
|
||||
.B inet
|
||||
communication domain or both of them.
|
||||
If invoked without arguments it shows only
|
||||
.B unix
|
||||
domain sockets.
|
||||
You can specify the domain to deal with with the -f option.
|
||||
.sp
|
||||
For the unix domain the output of netstat consists of one line for
|
||||
each socket in the system,
|
||||
which contains the following entries:
|
||||
.TP 15
|
||||
.SM "Proto"
|
||||
The protocol used by the socket, this can be one of:
|
||||
.RS 15
|
||||
.TP 15
|
||||
.SM "unix"
|
||||
This is the one and only protocol for unix sockets.
|
||||
.TP
|
||||
.SM "unknown"
|
||||
The protocol is unknown, should never happen.
|
||||
.RE
|
||||
.TP 15
|
||||
.SM "Flags"
|
||||
These are the flags set on the socket. The output for this entry
|
||||
consists of a space-separated list of tree-letter flag values.
|
||||
Possible flags are:
|
||||
.RS 15
|
||||
.TP 15
|
||||
.SM "ACC"
|
||||
The socket is listening for incoming connections.
|
||||
This applies only to stream sockets.
|
||||
.TP
|
||||
.SM "RCV"
|
||||
The socket is shut down for receiving after a call to
|
||||
.IR shutdown (3),
|
||||
ie the socket cannot receive any messages.
|
||||
.TP
|
||||
.SM "SND"
|
||||
The socket is shut down for sending after a call to
|
||||
.IR shutdown (3),
|
||||
ie it is impossible to send messages on the socket.
|
||||
.TP
|
||||
.SM "MRK"
|
||||
If out-of-band data is handled inline, "receiving is at mark", ie
|
||||
all data before the out of band data has been read.
|
||||
.RE
|
||||
.TP 15
|
||||
.SM "State"
|
||||
This field is the internal state of the socket,
|
||||
the following values are possible:
|
||||
.RS 15
|
||||
.TP 15
|
||||
.SM "VIRGIN"
|
||||
The socket has just been created,
|
||||
but has not been assigned a communication domain and type.
|
||||
.TP
|
||||
.SM "UNCONNECTED"
|
||||
The socket is not connected to a peer.
|
||||
.TP
|
||||
.SM "CONNECTING"
|
||||
The socket is about to connect to another one.
|
||||
.TP
|
||||
.SM "CONNECTED"
|
||||
The socket is connected to another one.
|
||||
.TP
|
||||
.SM "DISONNECTING"
|
||||
The socket is about to finish the connection to its peer.
|
||||
.TP
|
||||
.SM "DISCONNECTED"
|
||||
The socket has finished a connection and is again unconnected.
|
||||
.TP
|
||||
.SM "UNKNOWN"
|
||||
This should never happen.
|
||||
.RE
|
||||
.TP 15
|
||||
.SM "Type"
|
||||
This is the communication style the socket uses.
|
||||
Possible values are:
|
||||
.RS 15
|
||||
.TP 15
|
||||
.SM "STREAM"
|
||||
The socket uses connection-oriented byte stream communication,
|
||||
just like pipes do.
|
||||
.TP
|
||||
.SM "DGRAM"
|
||||
The socket uses connectionless, unrelyable,
|
||||
datagram oriented communication.
|
||||
.TP
|
||||
.SM "RAW"
|
||||
This is a raw socket.
|
||||
.TP
|
||||
.SM "RDM"
|
||||
Just like
|
||||
.SM "DGRAM\c"
|
||||
, except that you can rely on the packets to be delivered successfully.
|
||||
.TP
|
||||
.SM "SEQPACKET"
|
||||
This is like
|
||||
.SM "RDM\c"
|
||||
, except that the receiver is guaranteed to get the packets in the
|
||||
same order the sender sends them.
|
||||
.TP
|
||||
.SM "UNKNOWN"
|
||||
This type should never happen.
|
||||
.RE
|
||||
.TP 15
|
||||
.SM "Recv-Q"
|
||||
The size of the next unread message for datagram oriented sockets,
|
||||
and the number of unread bytes for stream oriented ones.
|
||||
.TP
|
||||
.SM "Address"
|
||||
The local address of the socket, if
|
||||
.IR bind (3)
|
||||
was done on it.
|
||||
This is a filename for the unix domain.
|
||||
.SH OPTIONS
|
||||
.TP 15
|
||||
-f domain
|
||||
Display information for active sockets in domain
|
||||
.IR domain ,
|
||||
overriding the default domain.
|
||||
.SH FILES
|
||||
.TP 15
|
||||
/dev/unix
|
||||
Unix domain information
|
||||
.SH BUGS
|
||||
Only unix domain implemented.
|
||||
.SH AUTHOR
|
||||
Kay Roemer <roemer@hera.rbi.informatik.uni-frankfurt.de>
|
||||
76
mint/sys/share/man/man8/route
Normal file
76
mint/sys/share/man/man8/route
Normal file
@@ -0,0 +1,76 @@
|
||||
.TH route 8 MintNet
|
||||
.SH NAME
|
||||
route \- display and modify system routing table
|
||||
.SH SYNOPSIS
|
||||
.B "route [-v]"
|
||||
.br
|
||||
.B "route add dstaddr interface [metric NN] [gw gateway]"
|
||||
.br
|
||||
.B "route del dstaddr"
|
||||
.SH DESCRIPTION
|
||||
.I Route
|
||||
is used to display and modify MintNet's routing table. You can add
|
||||
an delete routes.
|
||||
The whole routing table of the system is displayed (in the format
|
||||
.I netstat
|
||||
uses when invoked with the
|
||||
.B -rn
|
||||
option)
|
||||
when
|
||||
.I route
|
||||
is invoked without arguments.
|
||||
.SH OPTIONS
|
||||
.TP 15
|
||||
.SM "add \fBdstaddr\fP"
|
||||
This option causes route to add a new route to the systems routing table
|
||||
for the destination address
|
||||
.BR dstaddr ,
|
||||
which can be given in standard dot notation or can be a symbolic name which
|
||||
is resolved into an IP address.
|
||||
A special case for
|
||||
.B dstaddr
|
||||
is the name
|
||||
.BR default .
|
||||
This name causes
|
||||
.I route
|
||||
to add a default route (used when no other route matches the destination
|
||||
address of a packet). This special destination address can only be used
|
||||
in conjunction with the
|
||||
.B gw
|
||||
option.
|
||||
.B dstaddr
|
||||
can be either the address of a network (thats the case when the host portion
|
||||
of the given IP address is zero) or the address of a host (when the host
|
||||
portion of the given IP address is non zero).
|
||||
Based on the type of the address
|
||||
.B route
|
||||
will add a route to a network or a route to a host.
|
||||
.TP
|
||||
.SM "metric NN"
|
||||
This option can only be used with the
|
||||
.B add
|
||||
command and sets the distance metric for the route to the specified
|
||||
destination address. The distance metric is a measurement for how good
|
||||
the route is. The metric is the number of `hops' (that is the number of
|
||||
edges on the route when you imagine the network as a graph with the
|
||||
hosts at the vertices) between the source and the destination. The metric
|
||||
value is only useful for gateway routes.
|
||||
.TP
|
||||
.SM "gw \fBaddr\fP"
|
||||
This option can only be used with the
|
||||
.B add
|
||||
command and tells
|
||||
.B route
|
||||
that this route goes over a gateway host which forwards packets
|
||||
to the destination address of the route for you.
|
||||
.B addr
|
||||
is the address of the gateway and must be the address of a host.
|
||||
.TP
|
||||
.SM interface
|
||||
This is the name of the network interface over which outgoing packets
|
||||
to the specified destination address should be sent.
|
||||
.SH AUTHOR
|
||||
Kay Roemer <roemer@rbi.informatik.uni-frankfurt.de>
|
||||
.SH SEE ALSO
|
||||
.IR ifconfig (8),
|
||||
.IR netstat (8).
|
||||
497
mint/sys/share/man/man8/sfdisk
Normal file
497
mint/sys/share/man/man8/sfdisk
Normal file
@@ -0,0 +1,497 @@
|
||||
.\" Copyright 1995 Andries E. Brouwer (aeb@cwi.nl)
|
||||
.\" May be distributed under the GNU General Public License
|
||||
.\" The `DOS 6.x Warning' was taken from the old fdisk.8, which says
|
||||
.\" -- Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
|
||||
.\" -- May be distributed under the GNU General Public License
|
||||
.\" The `DRDOS Warning' was taken from a net post by Stephen Tweedie.
|
||||
.\"
|
||||
.TH SFDISK 8 "1 September 1995" "Linux 1.3.23" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
sfdisk \- Partition table manipulator for Linux
|
||||
.SH SYNOPSIS
|
||||
.BR sfdisk " [options] device"
|
||||
.br
|
||||
.BR "sfdisk \-s " [partition]
|
||||
.SH DESCRIPTION
|
||||
.B sfdisk
|
||||
has four (main) uses: list the size of a partition, list the partitions
|
||||
on a device, check the partitions on a device, and - very dangerous -
|
||||
repartition a device.
|
||||
|
||||
.SS "List Sizes"
|
||||
.BI "sfdisk \-s " partition
|
||||
gives the size of
|
||||
.I partition
|
||||
in blocks. This may be useful in connection with programs like
|
||||
.B mkswap
|
||||
or so. Here
|
||||
.I partition
|
||||
is usually something like
|
||||
.I /dev/hda1
|
||||
or
|
||||
.IR /dev/sdb12 ,
|
||||
but may also be an entire disk, like
|
||||
.IR /dev/xda .
|
||||
.br
|
||||
.RS
|
||||
.nf
|
||||
.if t .ft CW
|
||||
% sfdisk \-s /dev/hda9
|
||||
81599
|
||||
%
|
||||
.if t .ft R
|
||||
.fi
|
||||
.RE
|
||||
If the partition argument is omitted,
|
||||
.B sfdisk
|
||||
will list the sizes of all disks, and the total:
|
||||
.br
|
||||
.RS
|
||||
.nf
|
||||
.if t .ft CW
|
||||
% sfdisk \-s
|
||||
/dev/hda: 208896
|
||||
/dev/hdb: 1025136
|
||||
/dev/hdc: 1031063
|
||||
/dev/sda: 8877895
|
||||
/dev/sdb: 1758927
|
||||
total: 12901917 blocks
|
||||
%
|
||||
.if t .ft R
|
||||
.fi
|
||||
.RE
|
||||
|
||||
.SS "List Partitions"
|
||||
The second type of invocation:
|
||||
.BI "sfdisk \-l " "[options] device"
|
||||
will list the partitions on this device.
|
||||
If the device argument is omitted, the partitions on all hard disks
|
||||
are listed.
|
||||
.br
|
||||
.nf
|
||||
.if t .ft CW
|
||||
% sfdisk \-l /dev/hdc
|
||||
|
||||
Disk /dev/hdc: 16 heads, 63 sectors, 2045 cylinders
|
||||
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0
|
||||
|
||||
Device Boot Start End #cyls #blocks Id System
|
||||
/dev/hdc1 0+ 406 407\- 205096+ 83 Linux native
|
||||
/dev/hdc2 407 813 407 205128 83 Linux native
|
||||
/dev/hdc3 814 2044 1231 620424 83 Linux native
|
||||
/dev/hdc4 0 \- 0 0 0 Empty
|
||||
%
|
||||
.if t .ft R
|
||||
.fi
|
||||
The trailing \- and + signs indicate that rounding has taken place,
|
||||
and that the actual value is slightly less (more).
|
||||
To see the exact values, ask for a listing with sectors as unit.
|
||||
|
||||
.SS "Check partitions"
|
||||
The third type of invocation:
|
||||
.BI "sfdisk \-V " device
|
||||
will apply various consistency checks to the partition tables on
|
||||
.IR device .
|
||||
It prints `OK' or complains. The \-V option can be used together
|
||||
with \-l. In a shell script one might use
|
||||
.BI "sfdisk \-V \-q " device
|
||||
which only returns a status.
|
||||
|
||||
.SS "Create partitions"
|
||||
The fourth type of invocation:
|
||||
.BI "sfdisk " device
|
||||
will cause
|
||||
.B sfdisk
|
||||
to read the specification for the desired partitioning of
|
||||
.I device
|
||||
from its standard input, and then to change the partition tables
|
||||
on that disk. Thus, it is possible to use
|
||||
.B sfdisk
|
||||
from a shell script. When
|
||||
.B sfdisk
|
||||
determines that its standard input is a terminal, it will be
|
||||
conversational; otherwise it will abort on any error.
|
||||
.LP
|
||||
BE EXTREMELY CAREFUL - ONE TYPING MISTAKE AND ALL YOUR DATA IS LOST
|
||||
.LP
|
||||
As a precaution, one can save the sectors changed by
|
||||
.BR sfdisk :
|
||||
.RS
|
||||
.nf
|
||||
.if t .ft CW
|
||||
% sfdisk /dev/hdd \-O hdd-partition-sectors.save
|
||||
%
|
||||
.if t .ft R
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
Then, if you discover that you did something stupid before anything
|
||||
else has been written to disk, it may be possible to recover
|
||||
the old situation with
|
||||
.RS
|
||||
.nf
|
||||
.if t .ft CW
|
||||
% sfdisk /dev/hdd \-I hdd-partition-sectors.save
|
||||
%
|
||||
.if t .ft R
|
||||
.fi
|
||||
.RE
|
||||
|
||||
There are many options.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR \-v " or " \-\-version
|
||||
Print version number of
|
||||
.B sfdisk
|
||||
and exit immediately.
|
||||
.TP
|
||||
.BR \-? " or " \-\-help
|
||||
Print a usage message and exit immediately.
|
||||
.TP
|
||||
.BR \-T " or " \-\-list-types
|
||||
Print the recognized types (system Id's).
|
||||
.TP
|
||||
.BR \-s " or " \-\-show\-size
|
||||
List the size of a partition.
|
||||
.TP
|
||||
.BR \-g " or " \-\-show\-geometry
|
||||
List the kernel's idea of the geometry of the indicated disk(s).
|
||||
.TP
|
||||
.BR \-l " or " \-\-list
|
||||
List the partitions of a device.
|
||||
.TP
|
||||
.BR \-d
|
||||
Dump the partitions of a device in a format useful as input
|
||||
to sfdisk. For example,
|
||||
.br
|
||||
.nf
|
||||
.if t .ft CW
|
||||
% sfdisk -d /dev/hda > hda.out
|
||||
% sfdisk /dev/hda < hda.out
|
||||
.if t .ft R
|
||||
.fi
|
||||
will correct the bad last extended partition that the OS/2
|
||||
sfdisk creates.
|
||||
.TP
|
||||
.BR \-V " or " \-\-verify
|
||||
Test whether partitions seem correct. (See above.)
|
||||
.TP
|
||||
.BR \-i " or " \-\-increment
|
||||
Number cylinders etc. starting from 1 instead of 0.
|
||||
.TP
|
||||
.BI \-N " number"
|
||||
Change only the single partition indicated. For example:
|
||||
.br
|
||||
.nf
|
||||
.if t .ft CW
|
||||
% sfdisk /dev/hdb \-N5
|
||||
,,,*
|
||||
%
|
||||
.if t .ft R
|
||||
.fi
|
||||
will make the fifth partition on /dev/hdb bootable (`active')
|
||||
and change nothing else. (Probably this fifth partition
|
||||
is called /dev/hdb5, but you are free to call it something else,
|
||||
like `/my_equipment/disks/2/5' or so).
|
||||
.TP
|
||||
.BI \-A " number"
|
||||
Make the indicated partition(s) active, and all others inactive.
|
||||
.TP
|
||||
.BI \-c " or " \-\-id " number [Id]"
|
||||
If no Id argument given: print the partition Id of the indicated
|
||||
partition. If an Id argument is present: change the type (Id) of
|
||||
the indicated partition to the given value.
|
||||
This option has the two very long forms \-\-print\-id and \-\-change\-id.
|
||||
For example:
|
||||
.br
|
||||
.nf
|
||||
.if t .ft CW
|
||||
% sfdisk --print-id /dev/hdb 5
|
||||
6
|
||||
% sfdisk --change-id /dev/hdb 5 83
|
||||
OK
|
||||
.if t .ft R
|
||||
.fi
|
||||
first reports that /dev/hdb5 has Id 6, and then changes that into 83.
|
||||
.TP
|
||||
.BR \-uS " or " \-uB " or " \-uC " or " \-uM
|
||||
Accept or report in units of sectors (blocks, cylinders, megabytes,
|
||||
respectively). The default is cylinders, at least when the geometry
|
||||
is known.
|
||||
.TP
|
||||
.BR \-x " or " \-\-show\-extended
|
||||
Also list non-primary extended partitions on output,
|
||||
and expect descriptors for them on input.
|
||||
.TP
|
||||
.BI \-C " cylinders"
|
||||
Specify the number of cylinders, possibly overriding what the kernel thinks.
|
||||
.TP
|
||||
.BI \-H " heads"
|
||||
Specify the number of heads, possibly overriding what the kernel thinks.
|
||||
.TP
|
||||
.BI \-S " sectors"
|
||||
Specify the number of sectors, possibly overriding what the kernel thinks.
|
||||
.TP
|
||||
.BR \-f " or " \-\-force
|
||||
Do what I say, even if it is stupid.
|
||||
.TP
|
||||
.BR \-q " or " \-\-quiet
|
||||
Suppress warning messages.
|
||||
.TP
|
||||
.BR \-L " or " \-\-Linux
|
||||
Do not complain about things irrelevant for Linux.
|
||||
.TP
|
||||
.BR \-D " or " \-\-DOS
|
||||
For DOS-compatibility: waste a little space.
|
||||
(More precisely: if a partition cannot contain sector 0,
|
||||
e.g. because that is the MBR of the device, or contains
|
||||
the partition table of an extended partition, then
|
||||
.B sfdisk
|
||||
would make it start the next sector. However, when this
|
||||
option is given it skips to the start of the next track,
|
||||
wasting for example 33 sectors (in case of 34 sectors/track),
|
||||
just like certain versions of DOS do.)
|
||||
Certain Disk Managers and boot loaders (such as OSBS, but not
|
||||
LILO or the OS/2 Boot Manager) also live in this empty space,
|
||||
so maybe you want this option if you use one.
|
||||
.TP
|
||||
.BR \-\-IBM " or " \-\-leave\-last
|
||||
Certain IBM diagnostic programs assume that they can use the
|
||||
last cylinder on a disk for disk-testing purposes. If you think
|
||||
you might ever run such programs, use this option to tell
|
||||
.B sfdisk
|
||||
that it should not allocate the last cylinder.
|
||||
Sometimes the last cylinder contains a bad sector table.
|
||||
.TP
|
||||
.B \-n
|
||||
Go through all the motions, but do not actually write to disk.
|
||||
.TP
|
||||
.B \-R
|
||||
Only execute the BLKRRPART ioctl (to make the kernel re-read
|
||||
the partition table). This can be useful for checking in advance
|
||||
that the final BLKRRPART will be successful, and also when you
|
||||
changed the partition table `by hand' (e.g., using dd from a backup).
|
||||
If the kernel complains (`device busy for revalidation (usage = 2)')
|
||||
then something still uses the device, and you still have to unmount
|
||||
some file system, or say swapoff to some swap partition.
|
||||
.TP
|
||||
.B \-\-no\-reread
|
||||
When starting a repartitioning of a disk, sfdisk checks that this disk
|
||||
is not mounted, or in use as a swap device, and refuses to continue
|
||||
if it is. This option suppresses the test. (On the other hand, the \-f
|
||||
option would force sfdisk to continue even when this test fails.)
|
||||
.TP
|
||||
.BI \-O " file"
|
||||
Just before writing the new partition, output the sectors
|
||||
that are going to be overwritten to
|
||||
.I file
|
||||
(where hopefully
|
||||
.I file
|
||||
resides on another disk, or on a floppy).
|
||||
.TP
|
||||
.BI \-I " file"
|
||||
After destroying your filesystems with an unfortunate
|
||||
.B sfdisk
|
||||
command, you would have been able to restore the old situation
|
||||
if only you had preserved it using the \-O flag.
|
||||
|
||||
.SH THEORY
|
||||
Block 0 of a disk (the Master Boot Record) contains among
|
||||
other things four partition descriptors. The partitions
|
||||
described here are called
|
||||
.I primary
|
||||
partitions.
|
||||
.LP
|
||||
A partition descriptor has 6 fields:
|
||||
.br
|
||||
.nf
|
||||
.RS
|
||||
struct partition {
|
||||
unsigned char bootable; /* 0 or 0x80 */
|
||||
hsc begin_hsc;
|
||||
unsigned char id;
|
||||
hsc end_hsc;
|
||||
unsigned int starting_sector;
|
||||
unsigned int nr_of_sectors;
|
||||
}
|
||||
.RE
|
||||
.fi
|
||||
.LP
|
||||
The two hsc fields indicate head, sector and cylinder of the
|
||||
begin and the end of the partition. Since each hsc field only
|
||||
takes 3 bytes, only 24 bits are available, which does not
|
||||
suffice for big disks (say > 8GB). In fact, due to the wasteful
|
||||
representation (that uses a byte for the number of heads, which
|
||||
is typically 16), problems already start with 0.5GB.
|
||||
However Linux does not use these fields, and problems can arise
|
||||
only at boot time, before Linux has been started. For more
|
||||
details, see the
|
||||
.B lilo
|
||||
documentation.
|
||||
.LP
|
||||
Each partition has a type, its `Id', and if this type is 5
|
||||
.IR "" "(`" "extended partition" "')"
|
||||
the starting sector of the partition
|
||||
again contains 4 partition descriptors. MSDOS only uses the
|
||||
first two of these: the first one an actual data partition,
|
||||
and the second one again an extended partition (or empty).
|
||||
In this way one gets a chain of extended partitions.
|
||||
Other operating systems have slightly different conventions.
|
||||
Linux also accepts type 85 as equivalent to 5 - this can be
|
||||
useful if one wants to have extended partitions under Linux past
|
||||
the 1024 cylinder boundary, without DOS FDISK hanging.
|
||||
(If there is no good reason, you should just use 5, which is
|
||||
understood by other systems.)
|
||||
.LP
|
||||
Partitions that are not primary or extended are called
|
||||
.IR logical .
|
||||
Often, one cannot boot from logical partitions (because the
|
||||
process of finding them is more involved than just looking
|
||||
at the MBR).
|
||||
Note that of an extended partition only the Id and the start
|
||||
are used. There are various conventions about what to write
|
||||
in the other fields. One should not try to use extended partitions
|
||||
for data storage or swap.
|
||||
|
||||
.SH "INPUT FORMAT"
|
||||
.B sfdisk
|
||||
reads lines of the form
|
||||
.br
|
||||
.RS
|
||||
<start> <size> <id> <bootable> <c,h,s> <c,h,s>
|
||||
.RE
|
||||
where each line fills one partition descriptor.
|
||||
.LP
|
||||
Fields are separated by whitespace, or comma or semicolon possibly
|
||||
followed by whitespace; initial and trailing whitespace is ignored.
|
||||
Numbers can be octal, decimal or hexadecimal, decimal is default.
|
||||
When a field is absent or empty, a default value is used.
|
||||
.LP
|
||||
The <c,h,s> parts can (and probably should) be omitted -
|
||||
.B sfdisk
|
||||
computes them from <start> and <size> and the disk geometry
|
||||
as given by the kernel or specified using the \-H, \-S, \-C flags.
|
||||
.LP
|
||||
Bootable is specified as [*|\-], with as default not-bootable.
|
||||
(The value of this field is irrelevant for Linux - when Linux
|
||||
runs it has been booted already - but might play a role for
|
||||
certain boot loaders and for other operating systems.
|
||||
For example, when there are several primary DOS partitions,
|
||||
DOS assigns C: to the first among these that is bootable.)
|
||||
.LP
|
||||
Id is given in hex, without the 0x prefix, or is [E|S|L|X], where
|
||||
L (LINUX_NATIVE (83)) is the default, S is LINUX_SWAP (82), E
|
||||
is EXTENDED_PARTITION (5), and X is LINUX_EXTENDED (85).
|
||||
.LP
|
||||
The default value of start is the first nonassigned sector/cylinder/...
|
||||
.LP
|
||||
The default value of size is as much as possible (until next
|
||||
partition or end-of-disk).
|
||||
.LP
|
||||
However, for the four partitions inside an extended partition,
|
||||
the defaults are: Linux partition, Extended partition, Empty, Empty.
|
||||
.LP
|
||||
But when the \-N option (change a single partition only) is given,
|
||||
the default for each field is its previous value.
|
||||
|
||||
.SH EXAMPLE
|
||||
The command
|
||||
.RS
|
||||
.nf
|
||||
.if t .ft CW
|
||||
sfdisk /dev/hdc << EOF
|
||||
0,407
|
||||
,407
|
||||
;
|
||||
;
|
||||
EOF
|
||||
.if t .ft R
|
||||
.fi
|
||||
.RE
|
||||
will partition /dev/hdc just as indicated above.
|
||||
|
||||
With the \-x option, the number of input lines must be a multiple of 4:
|
||||
you have to list the two empty partitions that you never want
|
||||
using two blank lines. Without the \-x option, you give one line
|
||||
for the partitions inside a extended partition, instead of four,
|
||||
and terminate with end-of-file (^D).
|
||||
(And
|
||||
.B sfdisk
|
||||
will assume that your input line represents the first of four,
|
||||
that the second one is extended, and the 3rd and 4th are empty.)
|
||||
|
||||
.SH "DOS 6.x WARNING"
|
||||
|
||||
The DOS 6.x FORMAT command looks for some information in the first
|
||||
sector of the data area of the partition, and treats this information
|
||||
as more reliable than the information in the partition table. DOS
|
||||
FORMAT expects DOS FDISK to clear the first 512 bytes of the data area
|
||||
of a partition whenever a size change occurs. DOS FORMAT will look at
|
||||
this extra information even if the /U flag is given -- we consider
|
||||
this a bug in DOS FORMAT and DOS FDISK.
|
||||
.LP
|
||||
The bottom line is that if you use sfdisk to change the size of a
|
||||
DOS partition table entry, then you must also use
|
||||
.B dd
|
||||
to zero the first 512 bytes of that partition before using DOS FORMAT to
|
||||
format the partition. For example, if you were using sfdisk to make a DOS
|
||||
partition table entry for /dev/hda1, then (after exiting sfdisk and
|
||||
rebooting Linux so that the partition table information is valid) you
|
||||
would use the command "dd if=/dev/zero of=/dev/hda1 bs=512 count=1" to zero
|
||||
the first 512 bytes of the partition.
|
||||
.B BE EXTREMELY CAREFUL
|
||||
if you use the
|
||||
.B dd
|
||||
command, since a small typo can make all of the data on your disk useless.
|
||||
|
||||
For best results, you should always use an OS-specific partition table
|
||||
program. For example, you should make DOS partitions with the DOS FDISK
|
||||
program and Linux partitions with the Linux sfdisk program.
|
||||
|
||||
.SH "DRDOS WARNINGS"
|
||||
|
||||
Stephen Tweedie reported (930515): `Most reports of superblock
|
||||
corruption turn out to be due to bad partitioning, with one filesystem
|
||||
overrunning the start of the next and corrupting its superblock.
|
||||
I have even had this problem with the supposedly-reliable DRDOS. This
|
||||
was quite possibly due to DRDOS-6.0's FDISK command. Unless I created
|
||||
a blank track or cylinder between the DRDOS partition and the
|
||||
immediately following one, DRDOS would happily stamp all over the
|
||||
start of the next partition. Mind you, as long as I keep a little
|
||||
free disk space after any DRDOS partition, I don't have any other
|
||||
problems with the two coexisting on the one drive.'
|
||||
|
||||
A. V. Le Blanc writes in README.esfdisk: `Dr. DOS 5.0 and 6.0 has been
|
||||
reported to have problems cooperating with Linux, and with this version
|
||||
of efdisk in particular. This efdisk sets the system type
|
||||
to hexadecimal 81. Dr. DOS seems to confuse
|
||||
this with hexadecimal 1, a DOS code. If you use Dr. DOS, use the
|
||||
efdisk command 't' to change the system code of any Linux partitions
|
||||
to some number less than hexadecimal 80; I suggest 41 and 42 for
|
||||
the moment.'
|
||||
|
||||
A. V. Le Blanc writes in his README.fdisk: `DR-DOS 5.0 and 6.0
|
||||
are reported to have difficulties with partition ID codes of 80 or more.
|
||||
The Linux `fdisk' used to set the system type
|
||||
of new partitions to hexadecimal 81. DR-DOS seems to confuse this with
|
||||
hexadecimal 1, a DOS code. The values 82 for swap and 83 for file
|
||||
systems should not cause problems with DR-DOS. If they do, you may use
|
||||
the `fdisk' command `t' to change the system code of any Linux
|
||||
partitions to some number less than hexadecimal 80; I suggest 42 and 43
|
||||
for the moment.'
|
||||
|
||||
In fact, it seems that only 4 bits are significant for the DRDOS FDISK,
|
||||
so that for example 11 and 21 are listed as DOS 2.0. However, DRDOS
|
||||
itself seems to use the full byte. I have not been able to reproduce
|
||||
any corruption with DRDOS or its fdisk.
|
||||
|
||||
.SH BUGS
|
||||
A corresponding interactive
|
||||
.B cfdisk
|
||||
(with curses interface) is still lacking.
|
||||
.LP
|
||||
There are too many options.
|
||||
|
||||
.SH AUTHOR
|
||||
A. E. Brouwer (aeb@cwi.nl)
|
||||
Reference in New Issue
Block a user