码迷,mamicode.com
首页 > 其他好文 > 详细

创建文件系统命令集

时间:2017-05-19 22:10:01      阅读:364      评论:0      收藏:0      [点我收藏+]

标签:linux

使用mkfs命令:

    mkfs.FS_TYPE /dev/DEVICE 

        ext4、xfs、btrfs、vfat

---------------------------------------

[root@localhost ~]# mkfs.ext4 /dev/sda5

mke2fs 1.42.9 (28-Dec-2013)

文件系统标签=

OS type: Linux

块大小=4096 (log=2)

分块大小=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

655360 inodes, 2621440 blocks

131072 blocks (5.00%) reserved for the super user

第一个数据块=0

Maximum filesystem blocks=2151677952

80 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks: 

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632


Allocating group tables: 完成                            

正在写入inode表: 完成                            

Creating journal (32768 blocks): 完成

Writing superblocks and filesystem accounting information: 完成 

----------------------------------------------------------------

mke2fs:ext系列文件系统专用管理工具

   

[root@localhost ~]# mke2fs -t ext4 -b 1024 -L mydate /dev/sda5

mke2fs 1.42.9 (28-Dec-2013)

文件系统标签=mydate

OS type: Linux

块大小=1024 (log=0)

分块大小=1024 (log=0)

Stride=0 blocks, Stripe width=0 blocks

655360 inodes, 10485760 blocks

524288 blocks (5.00%) reserved for the super user

第一个数据块=1

Maximum filesystem blocks=44040192

1280 block groups

8192 blocks per group, 8192 fragments per group

512 inodes per group

Superblock backups stored on blocks: 

8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553, 

1024001, 1990657, 2809857, 5120001, 5971969


Allocating group tables: 完成                            

正在写入inode表: 完成                            

Creating journal (32768 blocks): 完成

Writing superblocks and filesystem accounting information: 完成     


[root@localhost ~]# blkid /dev/sda5

/dev/sda5: LABEL="mydate" UUID="e1a7de97-a0cc-474d-9b6e-c8508f34bbb7" TYPE="ext4" 

[root@localhost ~]# 

----------------------------------------

e2label更改卷标

[root@localhost ~]# e2label /dev/sda5 test

[root@localhost ~]# e2label /dev/sda5

test

------------------------------

tune2fs:重新设定ext系列文件系统可调整参数的值

    -l:查看指定文件系统超级块信息;super block

    -L ‘LABEL‘:修改卷标

    -m #:修预留给管理员的空间百分比

    -j: 将ext2升级为ext3

    -O: 文件系统属性启用或禁用

    -o: 调整文件系统的默认挂载选项

    -U UUID: 修改UUID号

[root@localhost ~]# tune2fs -l /dev/sda5

tune2fs 1.42.9 (28-Dec-2013)

Filesystem volume name:   test

Last mounted on:          <not available>

Filesystem UUID:          e1a7de97-a0cc-474d-9b6e-c8508f34bbb7

Filesystem magic number:  0xEF53

Filesystem revision #:    1 (dynamic)

Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize

Filesystem flags:         signed_directory_hash 

Default mount options:    user_xattr acl

Filesystem state:         clean

Errors behavior:          Continue

Filesystem OS type:       Linux

Inode count:              655360

Block count:              10485760

Reserved block count:     524288   /*留给管理员的空间

Free blocks:              10281522

Free inodes:              655349

First block:              1

Block size:               1024  /*块信息

Fragment size:            1024

Group descriptor size:    64

Reserved GDT blocks:      256

Blocks per group:         8192

Fragments per group:      8192

Inodes per group:         512

Inode blocks per group:   128

Flex block group size:    16

Filesystem created:       Fri May 19 15:21:22 2017

Last mount time:          n/a

Last write time:          Fri May 19 15:24:56 2017

Mount count:              0

Maximum mount count:      -1

Last checked:             Fri May 19 15:21:22 2017

Check interval:           0 (<none>)

Lifetime writes:          33 MB

Reserved blocks uid:      0 (user root)

Reserved blocks gid:      0 (group root)

First inode:              11

Inode size:          256

Required extra isize:     28

Desired extra isize:      28

Journal inode:            8

Default directory hash:   half_md4

Directory Hash Seed:      38964e87-ab43-42e7-bc49-912f6492e112

Journal backup:           inode blocks

[root@localhost ~]# dumpe2fs -h /dev/sda5 /*查看超级块信息

----------------------------------------------

mkswap:创建swap分区

[root@localhost ~]# mkswap /dev/sda6

正在设置交换空间版本 1,大小 = 18352124 KiB

无标签,UUID=0269054d-b6dd-47ca-a7dd-0a7ac64da64c

注:前提:调整其分区的ID为82

--------------------------------------------------------

块设备属性信息查看 blkid

[root@localhost ~]# blkid

/dev/sr0: UUID="2015-12-09-23-14-10-00" LABEL="CentOS 7 x86_64" TYPE="iso9660" PTTYPE="dos" 

/dev/sda1: UUID="95a622dc-749c-4f9f-a4a4-19633c65b2f5" TYPE="xfs" 

/dev/sda2: UUID="A3sg32-6O7b-ArqF-Axdv-evpS-Iliy-egtf9z" TYPE="LVM2_member" 

/dev/sda5: UUID="8231e96c-3f20-444f-8d6e-060fe14bce1a" TYPE="ext4" 

通过UUID查到块设备

[root@localhost ~]# blkid -U 8231e96c-3f20-444f-8d6e-060fe14bce1a

/dev/sda5

通过卷标查到块设备

[root@localhost ~]# blkid -L Mydate 

/dev/sda5

-----------------------------


本文出自 “gogo” 博客,谢绝转载!

创建文件系统命令集

标签:linux

原文地址:http://809698552.blog.51cto.com/1685476/1927515

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!