指定block size大小:
12345678910 [root@linuxidc ~]# mkfs.xfs -b size=1024 /dev/sdb2
meta-data=/dev/sdb2 isize=256 agcount=4, agsize=25600 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0
data = bsize=1024 blocks=102400, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal log bsize=1024 blocks=2564, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
挂载分区到文件系统:
[root@linuxidc ~]# mkdir /aa
[root@linuxidc ~]# mount /dev/sdb1 /aa
[root@linuxidc ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 18G 12G 5.8G 68% /
devtmpfs 485M 0 485M 0% /dev
tmpfs 494M 84K 494M 1% /dev/shm
tmpfs 494M 7.1M 487M 2% /run
tmpfs 494M 0 494M 0% /sys/fs/cgroup
/dev/sda1 497M 120M 377M 25% /boot
/dev/sdb1 97M 5.2M 92M 6% /aa
可以使用xfs_info查看文件系统信息:
[root@linuxidc ~]# xfs_info /aa
meta-data=/dev/sdb1 isize=256 agcount=4, agsize=6400 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0
data = bsize=4096 blocks=25600, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=853, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
使用xfs_admin查看分区的blkid:
[root@linuxidc ~]# xfs_admin -u /dev/sdb1
UUID = 927317a3-92b9-4b6f-8696-30fe0dc26ac0
也可以使用blkid查看:
[root@linuxidc ~]# blkid
/dev/sda1: UUID="64d32c15-8708-44a2-893a-a437c0f43156" TYPE="xfs"
/dev/sda2: UUID="4Ice1U-52dB-jxhY-80pW-vWus-rv1n-MVBJQ5" TYPE="LVM2_member"
/dev/sdb1: UUID="927317a3-92b9-4b6f-8696-30fe0dc26ac0" TYPE="xfs" PARTLABEL="Linux filesystem" PARTUUID="2e1d4a03-14f5-4611-9267-c6b89e502dc9"
/dev/sdb2: UUID="102aa312-7b59-49fe-a924-520e20ef7a51" TYPE="xfs" PARTLABEL="Linux filesystem" PARTUUID="0c755c32-4c27-404d-9faa-fd86d4370b0e"
/dev/sr0: UUID="2014-05-07-03-58-46-00" LABEL="RHEL-7.0 Server.x86_64" TYPE="iso9660" PTTYPE="dos"
/dev/mapper/rhel-root: UUID="6e18526c-e4fa-4854-adcd-d2e463a53bf9" TYPE="xfs"
/dev/mapper/rhel-swap: UUID="b4476c9f-7681-48d8-8cba-3904f4ebce61" TYPE="swap"
一个分区如果不格式的话,没有文件系统那么就不会有UUID:
可以使用xfs_admin -U修改分区的UUID:
[root@linuxidc ~]# uuidgen
292e2919-11fa-4f1c-8006-4a506095d377
[root@linuxidc ~]# xfs_admin -U 292e2919-11fa-4f1c-8006-4a506095d377 /dev/sdb2
Clearing log and setting UUID
writing all SBs
new UUID = 292e2919-11fa-4f1c-8006-4a506095d377
xfs文件系统大小可以增加,但是不能减少
Swap交换分区,类似于Windows的虚拟内存:
就是利用磁盘里面的一部分空间,来模拟内存:
1、使用分区;
2、创建文件;