Module 2 - What is File System
Module 2 - What is File System
Files are stored on disk or other storage and do not disappear when a user logs
off.
Files have names and are associated with access permission that permits
controlled sharing.
Files could be arranged or more complex structures to reflect the relationship
between them.
File structure
A File Structure needs to be predefined format in such a way that an operating system
understands. It has an exclusively defined structure, which is based on its type.
File Type
It refers to the ability of the operating system to differentiate various types of files like
text files, binary, and source files. However, Operating systems like MS_DOS and UNIX
has the following type of files:
Ordinary files
Directory Files
Directory contains files and other related information about those files. Its
basically a folder to hold and organize multiple files.
Special Files
These files are also called device files. It represents physical devices like
printers, disks, networks, flash drive, etc.
Functions of File
Create file, find space on disk, and make an entry in the directory.
Write to file, requires positioning within the file
Read from file involves positioning within the file
Delete directory entry, regain disk space.
Reposition: move read/write position.
Field:
This element stores a single value, which can be static or variable length.
DATABASE:
Collection of related data is called a database. Relationships among elements of data
are explicit.
FILES:
Files is the collection of similar record which is treated as a single entity.
RECORD:
A Record type is a complex data type that allows the programmer to create a new data
type with the desired column structure. Its groups one or more columns to form a new
data type. These columns will have their own names and data type.
Sequential access
Direct random access
Index sequential access
Sequential Access
In this type of file access method, records are accessed in a certain pre-defined
sequence. In the sequential access method, information stored in the file is also
processed one by one. Most compilers access files using this access method.
Random Access
The random access method is also called direct random access. This method allow
accessing the record directly. Each record has its own address on which can be directly
accessed for reading and writing.
Sequential Access
This type of accessing method is based on simple sequential access. In this access
method, an index is built for every file, with a direct pointer to different memory blocks.
In this method, the Index is searched sequentially, and its pointer can access the file
directly. Multiple levels of indexing can be used to offer greater efficiency in access. It
also reduces the time needed to access a single record.
Space Allocation
In the Operating system, files are always allocated disk spaces.
Linked Allocation
Indexed Allocation
Contiguous Allocation
Contiguous Allocation
In this method,
Linked Allocation
In this method,
Indexed Allocation
In this method,
File Directories
A single directory may or may not contain multiple files. It can also have sub-directories
inside the main directory. Information about files is maintained by Directories. In
Windows OS, it is called folders.
Host
Procedure
1. Under Storage, select File > File Systems.
2. Select the Add icon.
3. On the Protocol window, select the Linux/Unix Shares (NFS). Then select the
associated NAS server.
4. Continue following the steps in the wizard while noting the following:
o On the Storage page, the Thin checkbox is selected by default. If you do
not want to create a thin file system, remove the checkmark from
the Thin checkbox. Removing the checkmark also disables the Data
Reduction option.
o On the Storage page, select the Data Reduction checkbox to enable
data reduction on the file system. Data reduction is applied on all new
incoming writes. Data that already exists on the file system does not have
data reduction applied. Data reduction can be enabled only on thin file
systems that reside in All-Flash pools, and only for thin file systems
created on Unity systems running OE version 4.2.x or later.
o On the Shares page, optionally, configure the initial share for the file
system.
o You can configure host access and a snapshot schedule for the file
system when you create the file system, or you can do this at a later time.
Procedure
1. Under Storage, select File > File Systems.
2. Select the relevant file system, and then select the Edit icon.
3. On the General tab:
o You can change the description of the file system and the file system
size.
o You can view the file system capacity, including used space and free
space, on this tab.
o If a thin file system was created on a Unity system running OE version
4.1, you can also change the minimum allocation size. You cannot reduce
the storage size lower than the current allocation.
o You can enable data reduction for thin file systems created on a Unity
system running OE version 4.2.x or later. As data reduction is applied to
all new incoming writes to a file system, data reduction statistics (such as
data reduction ratio) display on the Properties page.
If data reduction is enabled and then subsequently disabled, existing data
in the file system will remain as is, but newly-written data will not have
data reduction applied.
Setting Description
Local The path to the file system storage resource on the storage system. This path
path specifies the unique location of the share on the storage system.
NFS shares
Each NFS share must have a unique local path. Unisphere automatically
assigns this path to the initial share created within a new file system. The local
path name is based on the file system name.
Before you can create additional shares within an NFS file system, you must
create a directory to share from a Linux/UNIX host that is connected to the file
system. Then, you can create a share from Unisphere and set access
permissions accordingly.
Export The path used by the host to connect to the share. Unisphere creates the share
path export path based on the name of the share and the name of the file system where it
resides. Hosts use either the file name or the export path to mount or map to the
share from a network host.
This behavior is enabled by using NFS aliases for shares.
Procedure
1. Under Storage, select File > File Systems.
2. Select the file system for which you want to add a share, and then select More
Actions > Create an NFS share (NFS export).
3. On the File System page, specify whether the share is for the selected file
system or for a snapshot of the selected file system.
4. On the Name & Path page, enter the relevant information, noting the following:
o The value specified in the Share Name field, along with the NAS server
name, constitutes the alias by which hosts can access the share.
o Share names must be unique at the NAS server level per protocol.
However, you can specify the same name for an SMB and NFS share.
o Local Path must correspond to an existing folder name within the file
system that was created from the host-side.
Note: A given file system path can only be shared once using the NFS protocol.
o By default, users can set bit s in the execute portion of the owner or group
permissions of a file. Users can then set the setuid and setgid Unix
permission bits. This allows users to run the executable with the privileges
of the file's owner (such as root). De-select Allow SUID if you do not want
users to have this ability.
o Optionally change the default anonymous UID and GID for the share. If
the permission of a host is read-only or read-write (without allowing root
access), and the UID of the client is 0 (which is typically the UID of the
root account), then the UID is mapped to the anonymous UID on the NAS
server. By default, the values of the anonymous UID and anonymous GID
are 4294967294, which is typically associated with the nobody user.
5. On the Access page, optionally specify the name of the hosts that can access
the share, along with their access privileges. In the Default Access field, select
the access setting you want all hosts to have for the share. In the Customize
access for the following hosts section do either of the following:
o Change the access privileges for existing hosts.
o Add new hosts and specify individual access privileges for those hosts.
Procedure
1. Under Storage, select File > NFS Shares.
2. Select the relevant NFS share, and then click the Edit icon.
3. On the General tab, change the share description.
4. On the Host Access tab, configure or add host access to the NFS share.
Managing quotas
You can track and limit drive space consumption by configuring quotas for file systems
at the file system or directory level. You can enable or disable quotas at any time, but it
is recommended that you enable or disable them during non-peak production hours to
avoid impacting file system operations.
Quota configurations
The storage system supports three types of quota configurations:
Quota Description
configuration
User quota on a file Limits the amount of storage consumed by an individual user storing data
system on the file system.
Quota on a Limits the total amount of storage consumed on the directory. You can use
directory (called a quota trees to:
quota tree once a
Set storage limits on a project basis. For example, you can
quota is applied)
establish quota trees for a project directory that has multiple users
sharing and creating files in it.
Track directory usage by setting the tree quota's hard and soft
limits to 0 (zero).
Note: If you change the limits for a quota tree, the
changes take effect immediately, without disrupting file
system operations.
User quota on a Limits the amount of storage consumed by an individual user storing data
quota tree on the quota tree.
Soft and hard limits
A quota can have a soft limit, hard limit, or both.
A soft limit is a preferred limit on storage usage. The system issues a warning
when a soft limit is reached.
You can set a grace period for a file system or a quota tree, which counts down
time once the soft limit is met. If the grace period expires, users cannot write to
the file system or quota tree until more space becomes available, even if the hard
limit has not been met.
Note: If you update the grace period value, the new value affects only the quota or
quotas which will exceed the soft limit after the update is performed. Any existing
quotas which have been counting down using the older grace period value will not be
affected.
It is recommended that you configure quotas before the storage system becomes active
in a production environment, and that you follow this basic procedure:
Quota policies
Before enabling and defining quotas, ensure that the file system is configured to use the
quota policy that best suits the client environment:
File Size policy (default): Calculates drive usage in terms of logical file sizes, and
ignores the size of directories and symbolic links. Use this policy where file sizes
are critical to quotas, such as where user usage is based on the size of the files
created, and exceeding the size limit is unacceptable.
Blocks policy: Calculates drive usage in terms of file system blocks (8 KB units),
and includes drive usage by directories and symbolic links in the calculations.
With this policy, any operation resulting in allocating or removing blocks, such as
creating, expanding, or deleting a directory; writing or deleting files; or creating or
deleting symbolic links changes block usage. Block usage depends solely on the
number of bytes added to or removed from the file.
Note: When using the Blocks policy, a user can create a sparse file whose size is
larger than the file size, but that uses fewer blocks on the drive.
The policy and grace period to use depend on which behavior (of the two described
above) is preferred or the number of each type of client in your environment. If the grace
period is set to 0, warnings will be generated when soft quotas are reached, but neither
client will get quota exceeded errors until the hard limit is exceeded. If the use of default
soft quotas is required, set the specific grace periods you desire, or keep the default
grace period of one week.
Note: If you update a grace period value, the new value affects only the quota or quotas
which will exceed the soft limit after the update is performed. Any existing quotas which
have been counting down using the older grace period value will not be affected.
Procedure
1. Under Storage, select File > File Systems.
2. Select the file system, and then select the Edit icon.
3. On the Quota tab, select the Quota Tree sub-tab.
4. Do either of the following:
o To enforce user quotas, locate the quota tree, and select the No link in
the Enforce User Quotas column. Then select Enforce User Quotas.
o To disable the enforcement of user quotas, locate the quota tree, and
select the Yes link in the Enforce User Quotas column. Then
clear Enforce User Quotas.
Enabling or disabling the enforcement of user quotas on a file system impacts system
performance, but does not disrupt file system operations. It is recommended that you
perform these operations only during non-peak production hours. Once user quota
enforcement is enabled, you can change quota settings without impacting performance.
Note: When you enable user quotas, you can also set default user quota limits and a
default grace period. Explicit user quotas will override these defaults.
Procedure
1. Under Storage, select File > File Systems.
2. Select the file system, and then select the Edit icon.
3. On the Quota tab, select the File System sub-tab.
4. Select Manage Quota Settings.
5. Select or clear Enforce User Quotas.
6. If you are enabling user quotas, optionally do the following:
o Change the quota policy for the file system.
o Change the default quota limits and grace period. These limits apply to all
file system users who do not have explicit user quotas defined. A value of
0 indicates no limit.
Create a user quota on a file system to limit or track the amount of storage space that
individual users consume on that file system. When you create or modify user quotas,
you have the option to use default hard and soft limits that are set at the file-system
level.
Procedure
1. Under Storage, select File > File Systems.
2. Select the file system, and then select the Edit icon.
3. On the Quota tab, select the File System sub-tab.
4. Select the Add icon.
5. In the Create User Quota wizard, select the Add icon, and then provide the
requested information. To track space consumption without setting limits,
set Soft Limit and Hard Limit to 0, which indicates no limit.
Create a quota tree at the directory level of a file system to limit or track the total
storage space consumed for that directory.
Procedure
1. Under Storage, select File > File Systems.
2. Select the file system, and then select the Edit icon.
3. On the Quota tab, select the Quota Tree sub-tab.
4. Select the Add icon.
5. Follow the steps in the wizard. To track space consumption without setting limits,
set the Soft Limit and Hard Limit fields to 0, which indicates no limit.
Create a user quota on a quota tree to limit or track the amount of storage space that
individual users consume on that tree. When you create user quotas, you have the
option to use the default hard and soft limits that are set at the quota-tree level.
Procedure
1. Under Storage, select File > File Systems.
2. Select the file system, and then select the Edit icon.
3. On the Quota tab, select the Quota Tree sub-tab.
4. Select the quota tree, and then select the Edit icon.
5. On the User Quotas tab, be sure that Enforce User Quotas is selected, and
provide the limits information. To track space consumption without setting limits,
set the Soft Limit and Hard Limit fields to 0, which indicates no limit.
Procedure
1. Under Storage, select File > File Systems.
2. Select the file system, and then click the Edit icon.
3. Select the Quota tab to view the User Quota Report.
View quota tree storage space usage
You can view total quota tree storage space usage or quota tree space usage by user.
Procedure
1. Under Storage, select File > File Systems.
2. Select the file system, and then click the Edit icon.
3. On the Quota tab, select the Quota Tree sub-tab.
The system displays the total storage space usage by quota tree.
4. To view quota tree storage space usage by user, select the quota tree, select
the Edit icon, and then select the User Quotas tab.
Procedure
1. Under Storage, select File > File Systems.
2. Select the relevant file system, and then select the Edit icon.
3. On the Quota tab, select the File System sub-tab.
4. Change the limit settings for a user quota by selecting the quota and then
selecting the Edit icon.
5. Select Manage Quota Settings, and do any of the following:
o Change the quota policy for the file system.
o Enforce user quotas on the file system.
o Change the default soft limit, hard limit, and grace period for new user
quotas on the file system. You can change these values for individual user
quotas when you create them or when you modify their properties.
Note: If you update the grace period value, the new value affects only the quota o
quotas which will exceed the soft limit after the update is performed. Any existing
quotas which have been counting down using the older grace period value will not
be affected.
Procedure
1. Under Storage, select File > File Systems.
2. Select the relevant file system, and then select the Edit icon.
3. On the Quota tab, select the Quota Tree sub-tab.
4. Select the relevant quota tree, and then select the Edit icon.
5. On the General tab, do any of the following:
o Select Use Default Limits to keep the file system's default limits and
grace period on the quota tree.
o Clear Use Default Limits to override the file system's default limits and
grace period.
o Change the hard limit, soft limit, and grace period settings for the quota
tree.
o
Note: If you update the grace period value, the new value affects only the quota or
quotas which will exceed the soft limit after the update is performed. Any existing
quotas which have been counting down using the older grace period value will not
be affected.
o If you enable the enforcement of user quotas on the quota tree, you can
specify the soft and hard limits for those quotas. (You can override these
values when you create individual quotas.)
o Create a new user quota on the quota tree.
o Edit properties for existing user quotas.
Changing the quota policy for a file system can impact system performance, because it
causes a system rescan. Therefore, it is recommended that you perform this action
during off-peak hours.
Procedure
1. Under Storage, select File > File Systems.
2. Select the file system, and then select the Edit icon.
3. On the Quota tab, select Manage Quota Settings.
4. Change the quota policy, as desired.