阿里云服务器挂载数据盘
阿里服务器申请到后,即便申请了数据盘,系统里面也没有自动配置上,看到的只有系统盘20GB,需要手动配置数据盘。
[root@iZcmake-2.8.5]# fdisk -l Disk /dev/xvda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00078f9c Device Boot Start End Blocks Id System /dev/xvda1 * 1 2611 20970496 83 Linux Disk /dev/xvdb: 322.1 GB, 322122547200 bytes 255 heads, 63 sectors/track, 39162 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 可以看到里面有一个300GB的硬盘/dev/xvdb,但是没有其他信息,因为没有格式化。 OK,现在手动格式化这个硬盘。 fdisk /dev/xvdb 在 fdisk 程序里输入 n, 然后输入 p,在后面分区开头和结尾选择里直接回车格式化位一个分区; 然后输入 p 可看到分区信息,再输入 w 写入分区配置,然后开始显示格式化进度条,结束后就OK了。 Command (m for help): p Disk /dev/xvdb: 322.1 GB, 322122547200 bytes 255 heads, 63 sectors/track, 39162 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x976480a3 Device Boot Start End Blocks Id System Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-39162, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-39162, default 39162): Using default value 39162 Command (m for help): p Disk /dev/xvdb: 322.1 GB, 322122547200 bytes 255 heads, 63 sectors/track, 39162 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x976480a3 Device Boot Start End Blocks Id System /dev/xvdb1 1 39162 314568733+ 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@iZcmake-2.8.5]# fdisk -l 挂载分区到目录: [root@iZcmake-2.8.5]# mkdir -pv /data mkdir: created directory `/data' [root@iZcmake-2.8.5]# mount /dev/xvdb1 /data 如果这一步提示错误: mount: you must specify the filesystem type 那是因为没有格式化分区导致的,重新格式化再mount就OK: mkfs.ext3 /dev/xvdb1 mount /dev/xvdb1 /data [root@iZcmake-2.8.5]# 将配置写入fstab: vim /etc/fstab 末尾增加一行: /dev/xvdb1 /data ext3 defaults 1 1 然后保存退出即可。
1. 本站所有资源来源于用户上传和网络,因此不包含技术服务请大家谅解!如有侵权请邮件联系客服!10210454@qq.com
2. 本站不保证所提供所有下载的资源的准确性、安全性和完整性,资源仅供下载学习之用!如有链接无法下载、失效或广告,请联系客服处理,有奖励!
3. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!如用于商业或者非法用途,与本站无关,一切后果请用户自负!
4. 如果您也有好的资源或教程,您可以投稿发布,成功分享后有RB奖励和额外RMB收入!
磊宇堂正在使用的服务器 维护管理由磊宇云服务器提供支持
磊宇堂 » 阿里云服务器挂载数据盘
2. 本站不保证所提供所有下载的资源的准确性、安全性和完整性,资源仅供下载学习之用!如有链接无法下载、失效或广告,请联系客服处理,有奖励!
3. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!如用于商业或者非法用途,与本站无关,一切后果请用户自负!
4. 如果您也有好的资源或教程,您可以投稿发布,成功分享后有RB奖励和额外RMB收入!
磊宇堂正在使用的服务器 维护管理由磊宇云服务器提供支持
磊宇堂 » 阿里云服务器挂载数据盘