云主机硬盘挂载

来源:互联网 发布:单片机控制系统 编辑:程序博客网 时间:2024/04/28 06:48

新主机查看硬盘信息

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 bytes16 heads, 63 sectors/track, 41610 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000eb3c7   Device Boot      Start         End      Blocks   Id  System/dev/vda1   *           3         409      204800   83  LinuxPartition 1 does not end on cylinder boundary./dev/vda2             409        8731     4194304   82  Linux swap / SolarisPartition 2 does not end on cylinder boundary./dev/vda3            8731       41611    16571392   83  LinuxPartition 3 does not end on cylinder boundary.Disk /dev/vdb: 1073.7 GB, 1073741824000 bytes16 heads, 63 sectors/track, 2080507 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk 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块磁盘是否有正常挂载

参考此篇

参考此篇

0 0
原创粉丝点击