阿里云服务器挂载数据盘

网友投稿 810 2023-03-16

本站部分文章、图片属于网络上可搜索到的公开信息,均用于学习和交流用途,不能代表睿象云的观点、立场或意见。我们接受网民的监督,如发现任何违法内容或侵犯了您的权益,请第一时间联系小编邮箱jiasou666@gmail.com 处理。

阿里云服务器挂载数据盘

阿里服务器申请到后,即便申请了数据盘,系统里面也没有自动配置上,看到的只有系统盘20GB,需要手动配置数据盘。

[root@iZcmake-2.8.5]# fdisk -lDisk /dev/xvda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00078f9cDevice Boot      Start         End      Blocks   Id  System/dev/xvda1   *           1        2611    20970496   83  LinuxDisk /dev/xvdb: 322.1 GB, 322122547200 bytes255 heads, 63 sectors/track, 39162 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000可以看到里面有一个300GB的硬盘/dev/xvdb,但是没有其他信息,因为没有格式化。OK,现在手动格式化这个硬盘。fdisk /dev/xvdb在 fdisk 程序里输入 n, 然后输入 p,在后面分区开头和结尾选择里直接回车格式化位一个分区;然后输入 p 可看到分区信息,再输入 w 写入分区配置,然后开始显示格式化进度条,结束后就OK了。Command (m for help): pDisk /dev/xvdb: 322.1 GB, 322122547200 bytes255 heads, 63 sectors/track, 39162 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x976480a3Device Boot      Start         End      Blocks   Id  SystemCommand (m for help): nCommand actione   extendedp   primary partition (1-4)pPartition number (1-4): 1First cylinder (1-39162, default 1):Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-39162, default 39162):Using default value 39162Command (m for help): pDisk /dev/xvdb: 322.1 GB, 322122547200 bytes255 heads, 63 sectors/track, 39162 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x976480a3Device Boot      Start         End      Blocks   Id  System/dev/xvdb1               1       39162   314568733+  83  LinuxCommand (m for help): wThe 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 /datamkdir: created directory `/data'[root@iZcmake-2.8.5]# mount /dev/xvdb1 /data如果这一步提示错误:mount: you must specify the filesystem type那是因为没有格式化分区导致的,重新格式化再mount就OK:mkfs.ext3 /dev/xvdb1mount /dev/xvdb1 /data[root@iZcmake-2.8.5]#将配置写入fstab:vim /etc/fstab末尾增加一行:/dev/xvdb1  /data  ext3 defaults 1 1然后保存退出即可。

[root@iZcmake-2.8.5]# fdisk -lDisk /dev/xvda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00078f9cDevice Boot Start End Blocks Id System/dev/xvda1 * 1 2611 20970496 83 LinuxDisk /dev/xvdb: 322.1 GB, 322122547200 bytes255 heads, 63 sectors/track, 39162 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000可以看到里面有一个300GB的硬盘/dev/xvdb,但是没有其他信息,因为没有格式化。OK,现在手动格式化这个硬盘。fdisk /dev/xvdb在 fdisk 程序里输入 n, 然后输入 p,在后面分区开头和结尾选择里直接回车格式化位一个分区;然后输入 p 可看到分区信息,再输入 w 写入分区配置,然后开始显示格式化进度条,结束后就OK了。Command (m for help): pDisk /dev/xvdb: 322.1 GB, 322122547200 bytes255 heads, 63 sectors/track, 39162 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x976480a3Device Boot Start End Blocks Id SystemCommand (m for help): nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 1First cylinder (1-39162, default 1):Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-39162, default 39162):Using default value 39162Command (m for help): pDisk /dev/xvdb: 322.1 GB, 322122547200 bytes255 heads, 63 sectors/track, 39162 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x976480a3Device Boot Start End Blocks Id System/dev/xvdb1 1 39162 314568733+ 83 LinuxCommand (m for help): wThe 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 /datamkdir: created directory `/data'[root@iZcmake-2.8.5]# mount /dev/xvdb1 /data如果这一步提示错误:mount: you must specify the filesystem type那是因为没有格式化分区导致的,重新格式化再mount就OK:mkfs.ext3 /dev/xvdb1mount /dev/xvdb1 /data[root@iZcmake-2.8.5]#将配置写入fstab:vim /etc/fstab末尾增加一行:/dev/xvdb1 /data ext3 defaults 1 1然后保存退出即可。

上一篇:云数据恢复:文档是成功的关键
下一篇:主机告警信息怎么处理(主机警报声)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~