很少用的指定,做個整理
查看掛載
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sr0 11:0 1 1024M 0 rom
xvda 202:0 0 150G 0 disk
├─xvda1 202:1 0 1G 0 part /boot
├─xvda2 202:2 0 8G 0 part [SWAP]
├─xvda3 202:3 0 41G 0 part /
└─xvda4 202:4 0 100G 0 part <沒有掛載磁碟機>
sr0 11:0 1 1024M 0 rom
xvda 202:0 0 150G 0 disk
├─xvda1 202:1 0 1G 0 part /boot
├─xvda2 202:2 0 8G 0 part [SWAP]
├─xvda3 202:3 0 41G 0 part /
└─xvda4 202:4 0 100G 0 part <沒有掛載磁碟機>
或是傳統的使用 mount
# mount -l
一大堆、尤其有docker後
查看檔案類型
# lsblk -o PATH,FSTYPE,MOUNTPOINT /dev/xvda
PATH FSTYPE MOUNTPOINT
/dev/xvda
/dev/xvda1 xfs /boot
/dev/xvda2 swap [SWAP]
/dev/xvda3 xfs /
/dev/xvda4 xfs /tmp
/dev/xvda
/dev/xvda1 xfs /boot
/dev/xvda2 swap [SWAP]
/dev/xvda3 xfs /
/dev/xvda4 xfs /tmp
查看uuid
# lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sr0
xvda
├─xvda1 xfs bb95af31-3495-476f-a2bf-714ce41be32e 673.4M 34% /boot
├─xvda2 swap 1 adb448b7-fdc2-4ce1-b49f-99546162c519 [SWAP]
├─xvda3 xfs 65f37dec-d3d8-40aa-ad0f-5a49c3cdd137 33.5G 18% /
└─xvda4 xfs f01203bc-4bfb-490e-918a-9bfb1073910a
sr0
xvda
├─xvda1 xfs bb95af31-3495-476f-a2bf-714ce41be32e 673.4M 34% /boot
├─xvda2 swap 1 adb448b7-fdc2-4ce1-b49f-99546162c519 [SWAP]
├─xvda3 xfs 65f37dec-d3d8-40aa-ad0f-5a49c3cdd137 33.5G 18% /
└─xvda4 xfs f01203bc-4bfb-490e-918a-9bfb1073910a
使用 -f參數可以顯示uuid
格式化磁碟
# mkfs -t xfs /dev/xvda4
請小心操作,做錯沒有後悔藥。
# mkfs -t xfs /dev/xvda4
mkfs.xfs: /dev/xvda4 appears to contain an existing filesystem (xfs).
mkfs.xfs: Use the -f option to force overwrite.
mkfs.xfs: Use the -f option to force overwrite.
已有檔案系統報警告如上,沒有檔案系統的話直接出結果,可使用-f參數強制執行
# mkfs -t xfs -f /dev/xvda4
meta-data=/dev/xvda4 isize=512 agcount=4, agsize=6553600 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=1 inobtcount=1
data = bsize=4096 blocks=26214400, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=25600, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=1 inobtcount=1
data = bsize=4096 blocks=26214400, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=25600, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
一瞬間就完成了。