fdisk -l /dev/sdb
 
mount /dev/sdb5 /mnt/ 挂载
df -h
df -T 查看分区类型
mkdir /home/weifeng/123
ls /home/
mount /dev/sdb1 /home/
ls /home/原先home下文件覆盖
umount /home/ 卸载
ls /home/ 可见原先数据
mount LABEL=weifeng /home/weifeng/123/
 
 
[root@compute ~]# mkfs.xfs -f /dev/sdb            #没有分区 也可以直接格式化 , Linux访问,必须挂载到一个目录下 
meta-data=/dev/sdb               isize=256    agcount=4, agsize=1310720 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=5242880, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@compute ~]# blkid /dev/sdb
/dev/sdb: UUID="ddb72be6-3af1-4813-9c9e-62160171bf19" TYPE="xfs"
 
 
[root@compute ~]# mount /dev/sdb /mnt/
[root@compute ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   18G  2.0G   16G  12% /
devtmpfs                 907M     0  907M   0% /dev
tmpfs                    917M     0  917M   0% /dev/shm
tmpfs                    917M  8.6M  908M   1% /run
tmpfs                    917M     0  917M   0% /sys/fs/cgroup
/dev/sda1                497M  169M  328M  34% /boot
tmpfs                    184M     0  184M   0% /run/user/0
/dev/sdb                  20G   33M   20G   1% /mnt
 
挂载点可以说是磁盘的入口
 
[root@compute ~]# umount /dev/sdb      卸载
[root@compute ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   18G  2.0G   16G  12% /
devtmpfs                 907M     0  907M   0% /dev
tmpfs                    917M     0  917M   0% /dev/shm
tmpfs                    917M  8.6M  908M   1% /run
tmpfs                    917M     0  917M   0% /sys/fs/cgroup
/dev/sda1                497M  169M  328M  34% /boot
tmpfs                    184M     0  184M   0% /run/user/0
 
除了mount ,也可以配置文件挂载 /etc/fstab
 
[root@compute ~]# vim /etc/fstab
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=ed05abd0-7e8b-4f22-8acb-e86bb1de7276 /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0
/dev/sdb                                  /mnt                    xfs     defaults       0 0
 
 
 
也可以通过 mount UUID 来实现挂载
[root@compute ~]# blkid
/dev/sdb: UUID="ddb72be6-3af1-4813-9c9e-62160171bf19" TYPE="xfs"
/dev/sda1: UUID="ed05abd0-7e8b-4f22-8acb-e86bb1de7276" TYPE="xfs"
/dev/sda2: UUID="FnQHjq-rpt4-oNHm-uybd-cwXv-qh37-XYGyfZ" TYPE="LVM2_member"
/dev/mapper/centos-root: UUID="41199724-7ecb-4006-9c9a-96faaeea7303" TYPE="xfs"
/dev/mapper/centos-swap: UUID="6765adfd-2c38-4d52-9c5e-0ccf7f4a1001" TYPE="swap"
 
 
[root@compute ~]# mount UUID="ddb72be6-3af1-4813-9c9e-62160171bf19" /mnt
[root@compute ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   18G  2.0G   16G  12% /
devtmpfs                 907M     0  907M   0% /dev
tmpfs                    917M     0  917M   0% /dev/shm
tmpfs                    917M  8.6M  908M   1% /run
tmpfs                    917M     0  917M   0% /sys/fs/cgroup
/dev/sda1                497M  169M  328M  34% /boot
tmpfs                    184M     0  184M   0% /run/user/0
/dev/sdb                  20G   33M   20G   1% /mnt