Centos6.0及之前的默认文件系统是ext系列的,而在最新的Centos7上却使用了xfs作为默认的文件系统。在Centos7中xfs文件系统包括如下命令:
xfs_admin:修改xfs文件系统的参数,需要先卸载分区
用法:xfs_admin [ -eflpu ] [ -c 0|1 ] [ -L label ] [ -U uuid ] device xfs_admin -V
xfs_estimate:估算xfs文件系统需要占用的空间
用法:xfs_estimate [ -h ] [ -b blocksize ] [ -i logsize ][ -e logsize ] [ -v ] directory ... xfs_estimate -V
xfsinvutil:xfsdump数据库检查和修改工具
用法:xfsinvutil [-F|-i] [-m media_label] -M mount_point mm/dd/yyyy xfsinvutil [-F|-i] [-m media_label] -u UUID mm/dd/yyyy xfsinvutil [-F] -s SESSION_ID xfsinvutil -i xfsinvutil -C
xfs_mkfile:创建xfs文件
用法:xfs_mkfile [ -v ] [ -n ] [ -p ] size[k|b|m|g] filename ... xfs_mkfile -V
xfs_rtcp:xfs实时拷贝命令
用法:xfs_rtcp [ -e extsize ] [ -p ] source ... target xfs_rtcp -V
xfs_bmap:打印xfs文件的块映射表
用法:xfs_bmap [ -adlpv ] [ -n num_extents ] file xfs_bmap -V
xfs_freeze:挂起xfs文件系统
用法: xfs_freeze [ -f | -u ] mount-point xfs_freeze -V
xfs_io :调试xfs文件系统的I/O路径
用法: xfs_io [ -adfmrRstxT ] [ -c cmd ] ... [ -p prog ] file xfs_io -V
xfs_ncheck:从i号码产生路径名
用法: xfs_ncheck [ -i ino ] ... [ -f ] [ -s ] [ -l logdev ] device xfs_ncheck -V
xfs_copy:复制xfs文件系统中的内容
用法: xfs_copy [ -bd ] [ -L log ] source target1 [ target2 ... ] xfs_copy -V
xfs_fsr:xfs文件系统碎片整理
用法: xfs_fsr [-vdg] [-t seconds] [-p passes] [-f leftoff] [-m mtab] xfs_fsr [-vdg] [xfsdev | file] ...
xfs_logprint:打印xfs文件系统日志
用法:xfs_logprint [ options ] device
xfs_quota:管理xfs文件系统配额
用法:xfs_quota [ -x ] [ -p prog ] [ -c cmd ] ... [ -d project ] ... [ path... ] xfs_quota -V
xfs_db:调试xfs文件系统
用法:xfs_db [ -c cmd ] ... [ -i|r|x|F ] [ -f ] [ -l logdev ] [ -p progname ]device xfs_db -V
xfs_growfs:扩展xfs文件系统
用法:xfs_growfs [ -dilnrx ] [ -D size ] [ -e rtextsize ] [ -L size ] [ -mmaxpct ] [ -t mtab ] [ -R size ] mount-point xfs_growfs -V
xfs_mdrestore:重载xfs元数据
用法:xfs_mdrestore [ -g ] source target xfs_mdrestore -V
xfs_repair:修复xfs文件系统
用法:xfs_repair [ -dfLnPv ] [ -m maxmem ] [ -c subopt=value ] [ -o sub‐opt[=value] ] [ -t interval ] [ -l logdev ] [ -r rtdev ] device xfs_repair -V
Xfsdump:xfs文件系统增量备份工具
用法:xfsdump -h xfsdump [ options ] -f dest [ -f dest ... ] filesystem xfsdump [ options ] - filesystem xfsdump -I [ subopt=value ... ]
xfs_info:xfs文件系统信息查看工具
用法:xfs_info [ -t mtab ] mount-point xfs_info -V
xfs_metadump:拷贝xfs元数据信息到文件
用法:xfs_metadump [ -aefFgow ] [ -m max_extents ] ] [ -l logdev ] source target xfs_metadump -V
xfsrestore:xfs文件系统备份恢复工具
用法:xfsrestore -h xfsrestore [ options ] -f source [ -f source ... ] dest xfsrestore [ options ] - dest xfsrestore -I [ subopt=value ... ]
比较常用的命令有:
mkfs.xfs : 构建XFS文件系统 参数: -b 块大小,linux仅支持4K -d 后接data section相关参数包括: agcount=数值:设置存储群组的数目,通常与CPU有关 agsize=数值:设置每个AG的容量 file:格式化的对象是文档,而不是分区 size=数值:格式化的容量 su=数值:如果格式化RAID分区,条带的数量,与sw搭配使用 sw=数值:如果格式化RAID分区,去掉备份盘的数据盘的数量 sunit=数值:与su类似,单位为n×512byte大小 swidth=数值:就是su×sw数值/512 -f 如果已有文件系统,使用此参数强制格式化 -i 设置inode相关参数包括: size=数值:最小256最大2K,一般使用256 internal=0/1:日志是否为内部日志。如果为0,则需要设置下面的参数 logdev=device:日志设备 size=数值:制定日志容量,最小512,推荐2M以上 -L 设置文件系统的Label名 -r 设置realtime section相关参数
xfs_info:查看xfs文件系统信息
xfs_info /dev/sda1 meta-data=/dev/sda1 isize=512 agcount=4, agsize=60992 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0 data = bsize=4096 blocks=243968, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal bsize=4096 blocks=855, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0
xfs_repair:修复文件系统
xfs_repair /dev/sda3 Phase 1 - find and verify superblock... Phase 2 - using internal log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk Phase 3 - for each AG... - scan and clear agi unlinked lists... - process known inodes and perform inode discovery... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - process newly discovered inodes... Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - check for inodes claiming duplicate blocks... - agno = 0 - agno = 1 - agno = 2 - agno = 3 Phase 5 - rebuild AG headers and trees... - reset superblock... Phase 6 - check inode connectivity... - resetting contents of realtime bitmap and summary inodes - traversing filesystem ... - traversal finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify and correct link counts... done
xfs_admin:设置xfs文件系统参数
xfs_admin [-efjlpuV] [-c 0|1] [-L label] [-U uuid] device 参数: -e 启用文件系统的不可写扩展支持 -f 指定文件系统的镜像存储在设备上的指定文件里 -j 启用第二版日志格式(支持大日志缓存) -l 打印当前文件系统别名 -p 启用32位支持 -u 打印当前文件系统的UUID -c 0/1 启用或禁用lazy-counters -L 设置lable -U 设置UUID
原创文章,作者:realmaster,如若转载,请注明出处:http://www.178linux.com/71060