Linux System Management 2-File system Management

Source: Internet
Author: User
Tags uuid

Theory: 1. Common file Systems
    Linux文件系统: ext2, ext3, ext4, xfs, btrfs, reiserfs, jfs, swap(交换分区)iso9660(光盘)    Windows:fat32, ntfs    Unix: FFS, UFS, JFS2    网络文件系统:NFS, CIFS    集群文件系统:GFS2, OCFS2    分布式文件系统:ceph, moosefs, mogilefs, GlusterFS, Lustre    在centos7上,查看支持的文件系统:cat /proc/filesystems  其中没写nodev的为正在使用的文件系统
2. According to whether it supports the "journal" (log) function classification:
    日志型文件系统: ext3, ext4, xfs, ...    非日志型文件系统: ext2, vfat
3. Components of the file system:
    内核中的模块:ext4, xfs, vfat    用户空间的管理工具:mkfs.ext4, mkfs.xfs, mkfs.vfat    说明:用户空间的管理工具调用内核中的模块,来实现文件系统的管理功能。
4.Linux virtual file system: VFS
    为了方便开发人员面对那么多文件系统开发,统一了接口
Practice: (i) Create file system common tools: 1. MKFS command:
        用法1:         mkfs.FS_TYPE /dev/DEVICE            常用FS_TYPE:                ext4                xfs                btrfs                vfat


Usage 2:# mkfs-t Fs_type/dev/device

2. Mke2fs:ext Series file system dedicated management tools
        选项:        -t {ext2|ext3|ext4}          -b {1024|2048|4096}  指明块大小        -L ‘LABEL‘  卷标        -j: 相当于 -t ext3        -i 数字: 为数据空间中每多少个字节创建一个inode;此大小不应该小于block的大小;        -N 数字:为数据空间创建个多少个inode;        -m 数字: 为管理人员预留的空间占据的百分比;        -O FEATURE[,...]:启用指定特性            -O ^FEATURE:关闭指定特性老实说,如果没有特殊需求的话,使用“mkfs -t ext3...” 不但容易记忆,而且非常好用。               mkfs.ext3 = mkfs -t ext3 = mke2fs -j = mke2fs -t ext3

Example:
Set the volume label for this file system to: "XXL"; my block is specified as 2048 size; each 8192byte allocates an inode; Build the Ext3 file system.

3. Mkswap: Creating a Swap partition
        mkswap [options] device            -L ‘LABEL‘        *前提:调整其分区的ID为82;
Other common tools: 4.blkid: Block device properties Information view
        blkid [OPTION]... [DEVICE]            -U UUID: 根据指定的UUID来查找对应的设备            -L LABEL:根据指定的LABEL来查找对应的设备
5.e2label: Manage Label for ext series File system
        # e2label DEVICE [LABEL]
6.TUNE2FS: Reset the values of the EXT series file system adjustable parameters
        -l:查看指定文件系统超级块信息;super block        -L ‘LABEL‘:修改卷标        -m #:修预留给管理员的空间百分比        -j: 将ext2升级为ext3        -O: 文件系统属性启用或禁用        -o: 调整文件系统的默认挂载选项        -U UUID: 修改UUID号;
7.DUMPE2FS:
        -h:查看超级块信息(二)文件系统检测:    fsck: File System CheCk        fsck.FS_TYPE         fsck -t FS_TYPE            -a: 自动修复错误            -r: 交互式修复错误            注意: FS_TYPE一定要与分区上已经文件类型相同;    e2fsck:ext系列文件专用的检测修复工具        -y:自动回答为yes;         -f:强制修复;

Linux System Management 2-File system Management

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.