云主机硬盘挂载

新主机查看硬盘信息

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda3        16G  2.7G   13G  19% /
tmpfs            16G     0   16G   0% /dev/shm
/dev/vda1       194M   34M  151M  19% /boot
fdisk -l
Disk /dev/vda: 21.5 GB, 21474836480 bytes
16 heads, 63 sectors/track, 41610 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000eb3c7

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *           3         409      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/vda2             409        8731     4194304   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/vda3            8731       41611    16571392   83  Linux
Partition 3 does not end on cylinder boundary.

Disk /dev/vdb: 1073.7 GB, 1073741824000 bytes
16 heads, 63 sectors/track, 2080507 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

1.格式化

  mkfs.ext3 /dev/vdb

2.创建挂载点

  mkdir /data

3.挂载磁盘到data目录
挂载命令:mount /dev/vdb /data/

4.修改fstab,以便系统启动时自动挂载磁盘
编辑fstab默认启动文件命令: vi /etc/fstab 回车在其中添加一行:

  /dev/vdb /data ext3 defaults 0 0 

在fstab中添加的一行,添加后,保存。
5. 重启验证
sync 将缓存写入服务器,reboot重启服务器
df -lh 查看第2块磁盘是否有正常挂载

参考此篇

参考此篇

你可能感兴趣的:(硬盘,云主机)