3. iSCSICli Mappings and Flags
The iSCSICli utility requires a number of special mappings and flags. A mapping
provides the means for the iSCSICli utility to make a connection
between a physical device and its information within the operating
system. In this case, the actual mapping is the Logical Unit Number
(LUN). In addition, many of the arguments support specific flag values. A
flag is a
bit position or specific value that determines how iSCSICli reacts in a
given situation. The following list describes the mappings and flags
used by iSCSICli.
Target Mappings
Determines how the iSCSI initiator accesses a particular LUN or the techniques used to expose the LUN.
TargetLun
Defines the LUN value the target uses to expose the LUN. You must provide this value in the form 0x0123456789abcdef.
OSBus
Defines the bus number that the operating system should use to access the LUN.
OSTarget
Defines the target number the operating system should use to access the LUN.
OSLUN
Defines the LUN number the operating system should use to access the LUN.
Payload Id Type
Defines the technique used to provide an address for the payload.
ID_IPV4_ADDR
1—Id format is 1.2.3.4
ID_FQDN
2—Id format is ComputerName
ID_IPV6_ADDR
5—Id format is IPv6 Address
Security Flags
Specifies the technique used to authenticate requests and responses.
TunnelMode
0x00000040
TransportMode
0x00000020
PFS Enabled
0x00000010
Aggressive Mode
0x00000008
Main Mode
0x00000004
IPSec/IKE Enabled
0x00000002
Valid Flags
0x00000001
Login Flags
Determines the method used to log into the iSNS server.
ISCSI_LOGIN_FLAG_REQUIRE_IPSEC
0x00000001 (Requires IPSec for the operation.)
ISCSI_LOGIN_FLAG_MULTIPATH_ENABLED
0x00000002 (Enables multipathing for the target on this initiator.)
AuthType
Defines the authentication type.
ISCSI_NO_AUTH_TYPE
0 (Disables iSCSI in-band authentication.)
ISCSI_CHAP_AUTH_TYPE
1 (Relies on one-way CHAP, where the target authenticates the iSCSI initiator.)
ISCSI_MUTUAL_CHAP_AUTH_TYPE
2 (Relies on mutual CHAP, where the target and the iSCSI initiator authenticate each other.)
Target Flags
Determines the visibility of the target on the local system.
ISCSI_TARGET_FLAG_HIDE_STATIC_TARGET
0x00000002 (The local system doesn't see the target unless it also discovers the target dynamically.)
ISCSI_TARGET_FLAG_MERGE_TARGET_INFORMATION
0x00000004
(The local system receives target information. The operating system
merges this information with any existing statically configured
information for the target.)
4. Managing Volume Labels with the Label Utility
The Label utility
creates, deletes, or changes the volume label for a drive. The volume
label appears at the top of the hierarchy in applications such as
Windows Explorer and helps the user identify the drive. In addition to
standard drives, this utility also works with mount points . This utility uses the following syntax:
LABEL [drive:][label]
LABEL [/MP] [volume] [label]
The following list describes each of the command line arguments.
drive:
Specifies the letter of the drive to change.
label
Defines the new
volume label. If you leave the volume label blank, then the Label
utility queries you for a volume label. Pressing Enter deletes any
existing label. Type a new value and press Enter to change the volume
label. Press Ctrl+C to abort the action without changing the label.
Volume labels for FAT-formatted drives can only have 11 characters,
while NTFS-formatted drives can have volume labels up to 32 characters.
You can't use these characters in a label for a FAT-formatted drive: * ? / \ | . , ; : + = [ ] < > ".
/MP
Specifies that the drive specification is a mount point or a volume, rather than a drive.
volume
Defines the mount point or volume name. If you specify a volume name, then you don't need to provide the /MP command line switch.
5. Creating Directories with the MD and MkDir Commands
The MD and MkDir
commands are equivalent. Both of these commands create a new directory
from the command line. Windows automatically recognizes the new
directory, and you can see it within Windows Explorer and use it from
applications. One of the more interesting ways to use this command is
within a batch file to create a directory structure for some task or to
set up a new user. This utility uses the following syntax:
MKDIR [drive:]path
MD [drive:]path
The following list describes each of the command line arguments.
drive
The drive to use when creating the new directory. The default is to use the current drive.
path
The absolute
or relative path to use when creating the new directory. The default is
to create the new directory as a subdirectory of the current directory.
However, you can specify an absolute or relative path as needed. See the
"Understanding Absolute and Relative Paths" side-bar for additional
details. These commands create all of the directories required to
provide the full path in the specification, so you might create multiple
directories when specifying a long path.
Some people get confused by the term path
at the command line. The path is simply the list of directories from
the root (topmost) directory to the current directory. The current
directory is the one that you're working in at any given time.
The command line specifies the root directory with a simple backslash (\).
When you go down a level, you add the directory name to the list. For
example, if you move to the MyDir directory, then the path becomes \MyDir\.
You can expand this list to any level of detail required to describe
the current directory. For example, when you move to the SubDir
directory from the MyDir directory, then the path becomes \MyDir\SubDir\.
Many commands and
utilities require path information. Most of them can use either an
absolute or relative path. An absolute path always expresses the full
path from the root directory to the current directory. For example, when
you're in the SubDir directory, the absolute path is \MyDir\SubDir.
The relative path describes the hierarchy in reference to the current
directory. Consequently, the relative path for SubDir is SubDir. Notice that you don't begin a relative path with a backslash.
When working with
directories using commands, you often need to specify a destination
using either an absolute or a relative path. For example, if you want to
create a new subdirectory in the SubDir directory, you could type MD NewDir. This form of the command uses a relative path. The same command using an absolute path would appear as MD \MyDir\SubDir\NewDir.
You might think the absolute path form wastes time, but it's always
more accurate than using a relative path and eliminates the possibility
of creating a directory where you didn't expect it.
The command window
also provides support for two special relative paths. The first is the
current directory, which is specified as a single period (.).
The second is the parent directory (the one directly above the current
directory in the directory hierarchy), which is specified as a double
period (..). Many commands and utilities, such as the CD, benefit from this current directory and parent directory shortcut terminology.