当前位置 : 主页 > 编程语言 > java >

Linux挂载新磁盘

来源:互联网 收集:自由互联 发布时间:2023-09-03
1、查看当前的磁盘情况,/dev/vdb未挂载 fdisk -l Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal)

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
网友评论