Linux挂载新磁盘

  • Post author:
  • Post category:linux



1、查看当前的磁盘情况,/dev/vdb未挂载

fdisk -l
Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 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: 0x000abcf4

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048     1026047      512000   83  Linux
/dev/vda2         1026048   209715166   104344559+  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


2、格式化vdb

mkfs -t ext4 /dev/vdb


3、挂载磁盘到目录 /cbs(路径需要预先创建)

mount /dev/vdb /cbs


—-取消挂载:

umount /dev/vdb


4、设置开机自动挂载

vim /etc/fstab

添加这一条:

/dev/vdb /cbs  ext4  defaults 0 0




版权声明:本文为qq_28834355原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。