分区——>格式化——>挂载
[[email protected] ~]# ls -l /dev/sd*
分区:
[[email protected] ~]# fdisk /dev/sdb
[[email protected] ~]# ls -l /dev/sdb*
[[email protected] ~]# partprobe (同步分区信息)
格式化:
[[email protected] ~]# mkfs 两次Tab键
[[email protected] ~]# mkfs.xfs /dev/sdb1
挂载:
[[email protected] ~]# mkdir /haha
[[email protected] ~]# mount /dev/sdb1 /haha
[[email protected] ~]# df –h (查看设备信息)
永久挂载:
[[email protected] ~]# vim /etc/fstab
/dev/sdb1 /haha xfs defaults 0 0
[[email protected] ~]# mount -a
[[email protected] ~]# df –h
[[email protected] ~]# reboot
[[email protected] ~]# blkid (查看设备对应的文件系统的格式是什么)
[[email protected] ~]# df –h
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
交换分区:
[[email protected] ~]# free –m
分区:
[[email protected] ~]# fdisk /dev/sdb
[[email protected] ~]# ls -l /dev/sdb*
[[email protected] ~]# partprobe
[[email protected] ~]# ls -l /dev/sdb*
格式化:
[[email protected] ~]# mkswap /dev/sdb3 (格式化交换分区)
挂载:
[[email protected] ~]# free -m
[[email protected] ~]# swapon /dev/sdb3 (启动交换分区)
[[email protected] ~]# free -m
永久挂载:
[[email protected] ~]# vim /etc/fstab
/dev/sdb3 swap swap defaults 0 0
[[email protected] ~]# reboot
[[email protected] Desktop]# free –m
[[email protected] Desktop]# tail -2 /etc/fstab (查看文件尾部信息)
[[email protected] Desktop]# lsblk (查看硬盘信息)
原文地址:https://www.cnblogs.com/dinghailong128/p/12178430.html