Skip to content

Instantly share code, notes, and snippets.

@zjutszl
Created March 4, 2019 05:09
Show Gist options
  • Save zjutszl/1be656f33c14cdaee4b91939d9a5e3e4 to your computer and use it in GitHub Desktop.
Save zjutszl/1be656f33c14cdaee4b91939d9a5e3e4 to your computer and use it in GitHub Desktop.
[阿里云 · 挂载新硬盘] #阿里云 #扩容 #硬盘

step1: 购买云盘

step2: linux服务器上挂载云盘

1.检查未挂载磁盘

[root@iZwz9i55doz3nfgzzkmvokZ /]# fdisk -l

磁盘 /dev/vda:42.9 GB, 42949672960 字节,83886080 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x635e6c7d

   设备 Boot      Start         End      Blocks   Id  System
/dev/vda1            2048    83886079    41942016   83  Linux

磁盘 /dev/vdb:107.4 GB, 107374182400 字节,209715200 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节

2.格式化该磁盘

格式化/dev/vdb分区,命令:mkfs.ext3 /dev/vdb

3.挂载到指定目录

挂载/dev/vdb分区到/mnt目录下:

命令:mkdir /mnt mount /dev/vdb /mnt ls -l /mnt df -h

ps: 持久化

如果要让这个挂载持久,需要再修改一下/etc/fstab .命令:echo "/dev/vdb /mnt ext3 defaults 1 2" >> /etc/fstab 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment