Linux XFS File System description Observation and Disk command explanation

Source: Internet
Author: User
Tags add numbers disk usage

XFS description Data observation of file system

EXT Family dumpe2fs , while the XFS family uses xfs_info to observe

[email protected] ~]# Xfs_info mount point | device file name

[[email protected] ~]# DF--T/boot

Filesystem Type 1k-blocks used Available use% mounted on

/dev/vda2 xfs 1038336 133704 904632 13%/boot

That's right! It can be seen that the XFS file system! Take a look at the content!

[Email protected] ~]# xfs_info/dev/vda2

1 meta-data=/dev/vda2 isize=256 agcount=4, agsize=65536 blks

2 = sectsz=512 attr=2, projid32bit=1

3 = crc=0 finobt=0

4 data = bsize=4096 blocks=262144, imaxpct=25

5 = sunit=0 swidth=0 blks

6 naming= version 2 bsize=4096 ascii-ci=0 ftype=0

7 log = internal bsize=4096 blocks=2560, version=2

8 = sectsz=512 sunit=0 Blks, lazy-count=1

9 Realtime =none extsz=4096 blocks=0, rtextents=0

    • The isize in line 1th refers to the capacity of the inode, each of which is 256bytes so large. As for Agcount, the number of storage group groups (allocation group) mentioned earlier, a total of 4, agsize refers to each storage area group has 65,536 blocks. The block with the 4th line is set to 4K, so the entire file system capacity should be 4*65536*4k so big!
    • The 2nd line of Sectsz refers to the logical magnetic region (sector) capacity set to 512bytes so big meaning.
    • The bsize in line 4th refers to the capacity of block, each block is 4K meaning, a total of 262,144 blocks in this file system.
    • The Sunit and Swidth in line 5th are highly correlated with the stripe of the disk array. We will give an example to illustrate this part when we format it below.
    • The internal in line 7th refers to the location of the login area within the file system, not the meaning of the external device. and takes up 4K * 2,560 blocks with a total capacity of about 10M.
    • The Realtime area in line 9th contains a extent capacity of 4K. But it is not currently used.

Disk-to-directory capacity

? DF : Lists the overall disk usage of the file system;

[ [email protected] ~]# DF [--ahikhtm] [ directory or file name]]

Options and Parameters:

-A : List all file systems, including system-specific/proc and other file systems;

- k : Display the file system in the capacity of Kbytes;

- M : Display the file system in the capacity of MBytes;

- H : GBytes, MBytes, Kbytes and other formats are displayed by people who are easier to read;

- H : replacing m=1024k with m=1000k;

- T : Together with the filesystem name of the partition (e.g. XFS);

- I. : does not use disk capacity and is displayed as the number of Inode

du : Evaluate the disk usage of the file system (commonly used in the estimated capacity of the catalog)

[ email protected] ~]# du [--AHSKM] file or directory name

Options and Parameters:

-A : Lists all files and directory capacity, because the default is only the number of files under the directory.

- H : Displayed in a more readable capacity format (g/m);

- S : Lists the total, not the capacity of each directory;

- S : Does not include totals under subdirectories, and is somewhat different from-S.

- k : List capacity display with Kbytes;

- M : List capacity display with MBytes;

parted lists the partition table type and partition information for the disk

[Email protected] ~]# Parted/dev/vda Print

Model:virtio block Device (virtblk) # Disk module name (vendor)

DISK/DEV/VDA:42.9GB # Total capacity of the disk

Sector Size (logical/physical): 512b/512b # Each logical/physical sector capacity of the disk

Partition table: GPT # partition Table format (MBR/GPT) small 4K Max 1G

Blkid list parameters such as UUID of the device

lsblk lists the systems on which the have a list of disks

[Email protected] ~]# lsblk [--dfimpt] [device]

Options and Parameters:

- D : Only the disk itself is listed, and the partition data for that disk is not listed

- F : Also lists the file system names in the disk

- I. : Use ASCII segment output, do not use complex coding (which is useful in some environments)

- M : Outputs the device at the same time / Dev permission data at the bottom (rwx data)

- P : Lists the full file name of the appliance! Instead of just listing the last name.

- T : Lists detailed data for the disk device, including the disk queue mechanism, the amount of pre-read and written data, etc.

The default output information is detailed:

NAME : That's the name of the device! the/ dev and other leading directories will be omitted!

Maj:min : In fact, the core knowledge of the device is through the two code to be familiar with! The main: Secondary device code, respectively!

RM : Removable unit (removabledevice) , such as CDs, USB disks, etc.

SIZE : Of course it's the volume!

? RO : Is the meaning of the read-only device

? TYPE : Is disk , Partition slots (partition) or read-only memory (rom) equal output

Moutpoint : The mount point mentioned in the previous chapter!

using parted command to distinguish the partition table type, the MBR partition table using Fdisk Partitioning, GPT partition table using Gdisk Partition! "

[email protected] ~]# Gdisk Appliance Name concrete look at the downside

[email protected] ~]# Gdisk/dev/vda <== look carefully, do not add numbers Oh!

Command (? For help):?

Omitted in front of ...

d te a partition # Delete a partition

Middle omitted ...

n Add a new partition # Add a partition

Omit a row

p Print the partition table # Print partition table ( Common)

Q quit without saving changes # leave gdisk without storing partitions

Omit part ...

W Write table to disk and exit # leave Gdisk after storage partition operation

No matter what action you take, just leave Gdisk and press " Q ", then all the actions" will not take effect! Conversely, pressing "w" means that the action takes effect.

Use "Appliance filename" do not add numbers, because partition is for "whole disk device" and not some partition!

Linux XFS System formatting Commands

[[email protected] ~]# MKFS.XFS [--B bsize] [--D parms] [--I parms] [[--L parms] [--L label] [--f] \ \

[[---R Parms] device name

Options and Parameters:

About units: The bottom as long as the "value", no unit is bytes value, you can use k,m,g,t,p (lowercase) and so on to explain

The more special is the s this unit, it refers to the sector "number" Oh!

- B : next to block capacity, can be from 64k, but the maximum capacity is limited to Linux 4k Oh!

- D : followed by important data section related parameter values, the main values are:

Agcount= value: Set the meaning of several storage groups (AG), usually related to CPU

agsize= value: Each AG is set to the meaning of how much capacity, usually agcount/agsize only one setting can be selected

file: Refers to the "formatted device is a document rather than a device" means! (such as virtual disks)

size= value: The capacity of thedata section, meaning that you can not run out of all the device capacity

su= value: When there is a RAID , the meaning of that stripe value is used with the SW below

SW= value: The number of disks used to store data when a RAID is available (the backup disc and the spare disk must be deducted)

Sunit= value: Equivalent to su , but the unit uses "a few sector(512bytes size)" meaning

swidth= value: Is the value of SU*SW , but is set by "several sector(512bytes size)"

- F : If the device already has a file system, you will need to use this- F to force the format of the line!

-I: With the inode has more relevant settings, the main setting values are:

size= value: The minimum is 256bytes max is 2k, the general retention of the large enough to use!

Internal=[0|1] : is the log device built-in? Preset to 1 built-in, if you want to use the external device, using the bottom setting

Logdev=device : Log device for the rear connection of the device above the meaning, need to set internal=0 !

size= numeric: Specifies the capacity of this login area, usually with a minimum of one block, about 2M or more!

- L : next to the header name of this filesystem is the meaning of label name!

- R : Specifies the relevant setting value for the Realtime section, which is common:

extsize= value: That is the important extent value, usually not set, but when there is RAID ,

The best setting is the same value as swidth ! Example one: List data about a/DEV/VDA disk

Linux XFS File System description Observation and Disk command explanation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.