User interaction with Lustre file systems6–2
6.1 Defining file stripe patterns
Lustre presents a POSIX API as the file system interface; this means that POSIX-conformant applications work
with Lustre.
There are occasions when a user who is creating a file may want to create a file with a defined stripe pattern
on a Lustre file system. This section describes two methods of doing this: the first method uses the
lfs executable (see Section 6.1.1), and the second method uses a C program (see Section 6.1.2).
It is also possible to set the stripe configuration on a subdirectory, so that all of the files created in the
subdirectory will inherit the stripe attributes of the subdirectory in preference to those of the file system. See
Section 6.1.3 for information on how to set the stripe configuration on a subdirectory.
6.1.1 Using the lfs executable
From the command line, the lfs executable can be used to determine information about user files. The
lfs getstripe command displays the striping information about a file and the lfs setstripe
command creates a file with the defined striping pattern. Detailed help on the lfs executable is available
from the lfs help menu.
This example creates a file with a stripe width of 4MB, where the system decides the starting OST service
and the number of stripes. It then shows the settings defined by the system.
The commands in the following example assume that the /mnt/lustre/mydirectory directory exists
and can be written to:
$ lfs setstripe /mnt/lustre/mydirectory/file 4194304 -1 0
$ lfs getstripe /mnt/lustre/mydirectory/file
OBDS:
0: ost1_UUID
1: ost2_UUID
./file
obdidx objid objid group
0 68 0x44 0
1 68 0x44 0
$ lfs find --verbose file
OBDS:
0: ost1_UUID
1: ost2_UUID
./file
lmm_magic: 0x0BD10BD0
lmm_object_gr: 0
lmm_object_id: 0x2c009
lmm_stripe_count: 2
lmm_stripe_size: 4194304
lmm_stripe_pattern: 1
obdidx objid objid group
0 68 0x44 0
1 68 0x44 0
The example output shows that the file resides on a file system that has two OST services, ost1_UUID and
ost2_UUID with OST indices 0 (zero) and 1 respectively. The file has a stripe count of 2 and so resides on
both OST services. The stripe size is 4MB. The additional information is for Lustre internal use.
The stripe size must be a multiple of the largest possible page size on any client node. The largest page size
supported on Lustre client nodes is 64KB (for ia64), so that any stripe size specified must be a multiple of
64KB.
The setstripe command prints the following warning if you attempt to set a file stripe size that does not
conform to this rule:
error: stripe_size must be an even multiple of 65536 bytes.
Note that this rule applies to individual files and not to default file system settings, which are described in
Chapter 5 of the HP StorageWorks Scalable File Share System User Guide.
Komentáře k této Příručce