Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to parse the SOLARIS UFS file system

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

In this issue, the editor will bring you about how to parse the SOLARIS UFS file system. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Every regular file under the Solaris operating system must contain a file name and associated inode (Information Node), the relevant information of the file (such as the owner, permission and size of the file, etc.) stored in the inode, and the pointer to the data block associated with the file. Therefore, the number of inode determines the number of files allowed to be created by an UFS file system.

When a UFS file system is created, the maximum number of indoe allowed is fixed. When there are a large number of small files (tens of millions or even hundreds of millions) in the file system, the number of inode may not be enough. Because files need to use inode to store metadata (MetaData), the excess number of inode will cause new files to be created, although the actual storage space is far from the limit at this time. So you need to take this into account when creating such a file system.

Formula for calculating inode number:

Inode_number= file system size / nbpi

Nbpi:The number of bytes per inode, the number of bytes per inode, is the determining factor in the number of file system inode.

When creating a file system, unless otherwise specified, Solaris will use different nbpi values to determine the density of inode depending on the size of the file system, as shown in the table below.

File system size (GB) default nbpi size (byte)

≤ 1 2048

one

two

three

≥ 1024 (i.e. 1T) 1048576 (i.e. 1m)

According to the above table, by default, for a 1G file system (under Solaris 9, the available space is about 961m), get the theoretical number of inode that the file system has:

1024 * 1024 / 2 ≌ 500000

For a 1T file system, the number of inode available will be much lower than that of files slightly less than 1T (such as 900G) (because the nbpi value has increased several times):

900,1024,1024Universe 8 = 117964800

1024 ≌ 1000000 (1 million)

For a created file system, you can get the number of inode available for that file system with the following command, thus obtaining the maximum number of files that can be created under the file system (regardless of the actual physical space constraints, the theoretical value may deviate from the actual value, but can be used as a reference):

# df-F ufs-oi

Experiment:

Step1. Create a 1G UFS file system (nbpi=2048) by default and attach it to the / tmp/mnt directory. The actual available space is 961m:

# df-h / tmp/mnt

Filesystem size used avail capacity Mounted on

/ dev/vx/dsk/oradg/lv_simon

961m 1.0m 903m 1% / tmp/mnt

# mkfs-m / dev/vx/dsk/oradg/lv_simon

Mkfs-F ufs

-o nsect=64,ntrack=32,bsize=8192,fragsize=1024,cgsize=32,free=6,rps=120,nbpi=2054

Opt=t,apc=0,gap=0,nrpos=8,maxcontig=128 / dev/vx/dsk/oradg/lv_simon 2097152

# df-oi / tmp/mnt

Filesystem iused ifree iused Mounted on

/ dev/vx/dsk/oradg/lv_simon

4 507900 / tmp/mnt

Without considering the actual physical space limitations, the theoretical value of the maximum number of regular files allowed to be created by the file system is 507900.

Attached: cylindrical group structure of UFS file system

When you create a UFS file system, the disk is divided into several cylindrical groups. The cylinder group consists of one or more consecutive disk cylinders. The cylindrical group is further divided into a number of addressable blocks to control and organize the structure of the files in the cylindrical group. In a file system, each type of block has a specific function. The UFS file system has the following four types of blocks, which are the foundation of the UFS file system.

The above is the editor for you to share how to parse the SOLARIS UFS file system, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report