Part 1
1、创建一个2G的文件系统,块大小为2048byte,预留1%可用空间,文件系统ext4,卷标为TEST,要求此分区开机后自动挂载至/test目录,且默认有acl挂载选项
[root@kezai ~]
[root@kezai ~]
alias scandisk='echo '\''- - -'\'' > /sys/class/scsi_host/host0/scan;echo '\''- - -'\'' > /sys/class/scsi_host/host1/scan;echo '\''- - -'\'' > /sys/class/scsi_host/host2/scan'
[root@kezai ~]
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 100G 0 part /
├─sda3 8:3 0 2G 0 part [SWAP]
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 50G 0 part /data
sdb 8:16 0 20G 0 disk
├─sdb1 8:17 0 1G 0 part
├─sdb2 8:18 0 2G 0 part
└─sdb3 8:19 0 1K 0 part
sdc 8:32 0 10G 0 disk
sr0 11:0 1 6.7G 0 rom
[root@kezai ~]
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x41eae9c9.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-20971519, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-20971519, default 20971519): +2G
Created a new partition 1 of type 'Linux' and of size 2 GiB.
Command (m for help): p
Disk /dev/sdc: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x41eae9c9
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 4196351 4194304 2G 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@kezai ~]
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 100G 0 part /
├─sda3 8:3 0 2G 0 part [SWAP]
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 50G 0 part /data
sdb 8:16 0 20G 0 disk
├─sdb1 8:17 0 1G 0 part
├─sdb2 8:18 0 2G 0 part
└─sdb3 8:19 0 1K 0 part
sdc 8:32 0 10G 0 disk
└─sdc1 8:33 0 2G 0 part
sr0 11:0 1 6.7G 0 rom
[root@kezai ~]
[root@kezai ~]
tune2fs 1.45.6 (20-Mar-2020)
Filesystem volume name: TEST
Last mounted on: <not available>
Filesystem UUID: 1ff433a7-cbd8-42b4-ad6d-eced5c8827fc
Filesystem magic number: 0xEF53
Filesystem revision
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 131072
Block count: 1048576
Reserved block count: 10485
Free blocks: 1011035
Free inodes: 131061
First block: 0
Block size: 2048
Fragment size: 2048
Group descriptor size: 64
Reserved GDT blocks: 512
Blocks per group: 16384
Fragments per group: 16384
Inodes per group: 2048
Inode blocks per group: 256
Flex block group size: 16
Filesystem created: Mon May 23 18:23:10 2022
Last mount time: n/a
Last write time: Mon May 23 18:23:10 2022
Mount count: 0
Maximum mount count: -1
Last checked: Mon May 23 18:23:10 2022
Check interval: 0 (<none>)
Lifetime writes: 1058 kB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 1e350d41-6d95-41fd-9ab2-5699015f3491
Journal backup: inode blocks
Checksum type: crc32c
Checksum: 0x6fb9bb85
[root@kezai ~]
[root@kezai ~]
/dev/sdc1: PARTUUID="41eae9c9-01"
[root@kezai ~]
/dev/sdc1: LABEL="TEST" UUID="1ff433a7-cbd8-42b4-ad6d-eced5c8827fc" TYPE="ext4" PARTUUID="41eae9c9-01"
[root@kezai ~]
[root@kezai ~]