linux 挂载硬盘

[root@iZj6cdovnd2mgpgj3joz02Z ~]# fdisk -l

Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b2d99

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    83875364    41936658+  83  Linux

Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

(base) [root@iZj6cdovnd2mgpgj3joz02Z ~]# mkfs.xfs /dev/vdb
meta-data=/dev/vdb               isize=512    agcount=4, agsize=13107200 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=52428800, 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
(base) [root@iZj6cdovnd2mgpgj3joz02Z ~]# mkdir /data
(base) [root@iZj6cdovnd2mgpgj3joz02Z ~]# vim /etc/fstab

(base) [root@iZj6cdovnd2mgpgj3joz02Z ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Thu Jul 11 02:52:01 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=1114fe9e-2309-4580-b183-d778e6d97397 /                       ext4    defaults        1 1
/dev/vdb  /data xfs    defaults    0  0

(base) [root@iZj6cdovnd2mgpgj3joz02Z ~]# mount -a
(base) [root@iZj6cdovnd2mgpgj3joz02Z ~]# df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/vda1      ext4       40G  2.9G   35G   8% /
devtmpfs       devtmpfs  3.7G     0  3.7G   0% /dev
tmpfs          tmpfs     3.7G     0  3.7G   0% /dev/shm
tmpfs          tmpfs     3.7G  516K  3.7G   1% /run
tmpfs          tmpfs     3.7G     0  3.7G   0% /sys/fs/cgroup
tmpfs          tmpfs     756M     0  756M   0% /run/user/0
/dev/vdb       xfs       200G   33M  200G   1% /data

  

 

mkfs.ext4 /dev/vdb

echo '/dev/vdb /data ext4 defaults 0 0' >> /etc/fstab

mkdir /data
mkfs.ext4 /dev/vdb

echo '/dev/vdb /data ext4 defaults 0 0' >> /etc/fstab

posted @ 2021-07-23 11:05  逐梦~前行  阅读(91)  评论(0编辑  收藏  举报