阿里云服务器挂载硬盘(阿里云服务器挂载硬盘失败)

华为云服务器特价优惠火热进行中!

2核2G2兆仅需 38 元;4核4G3兆仅需 79 元。购买时间越长越优惠!更多配置及优惠价格请咨询客服。

合作流程:
1、点击链接注册/关联华为云账号:点击跳转
2、添加客服微信号:cloud7591,确定产品方案、价格方案、服务支持方案等;
3、客服协助购买,并拉微信技术服务群,享受一对一免费技术支持服务;
技术专家在金蝶、华为、腾讯原厂有多年工作经验,并已从事云计算服务8年,可对域名、备案、网站搭建、系统部署、AI人工智能、云资源规划等上云常见问题提供更专业靠谱的服务,对相应产品提供更优惠的报价和方案,欢迎咨询。

本篇文章给大家谈谈阿里云服务器挂载硬盘,以及阿里云服务器挂载硬盘失败对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

微信号:cloud7591
如需了解更多,欢迎添加客服微信咨询。
复制微信号

本文目录一览:

记一次阿里云服务器如何实现数据盘挂载指定目录

数据盘的挂载基本上可以分为两大步,第一步分区并初始化磁盘;第二步挂载。

接下来带大家看看具体的操作及命令。

首先使用fdisk -l 查看需要挂载的数据盘:

开始对磁盘分区这里就不分多个区了,只需要 fdisk /dev/vdb 然后 "n p 1 wq" 就完成了分区:

最后挂载磁盘到指定目录 mount /dev/vdb1 /var/www/html (可以是任意目录) 并查看挂载情况 df -h

至此完成了整个数据盘的挂载,无需重启服务器就可以开始使用了。

刚刚买阿里云服务器怎么挂载硬盘

进入阿里云的后台,在实例下面的服务器中点击【更多】----【连接管理终端】再输入一个密码就可以完成登陆了。

先查一下你的阿里云的数据盘有没有。如果没有就没有必要往下看了。如下图所示:

如果检测到有硬盘则需要对这个硬盘进行分区,使用命令:

fdisk

/dev/xvdb1

然后在提示的界面中输入

n回车

p回车

1回车回车

w回车

这样就会分成功。

新的分区挂载成功后,再检验一下有没有挂载成功。使用命令:fdisk

-l

查看一下有没有成功。如果能看到一个xx

gb多少的地方说明挂载成功。

格式化分区:

mkfs.ext3

/dev/xvdb1

使用这个命令很快就会完成。

6

最后就要添加分区信息,使用命令:

mount

/dev/xvdb1

/alidata

挂载到主目录下的alidata目录下面。

最后查查有没有写入成功使用命令:df

-h

有如下图所示的提示/dev/xvdb1

在/alidata目录下。

阿里云服务器怎么分区格式化/挂载硬盘

1、分区fdisk/dev/sdb依次输入n,回车p,回车1,回车回车w2、格式化mkfs-text4-c/dev/sdb13、挂载(挂载目录可自行定义)mount/dev/sdb1/opt4、设置开机自动挂载vi/etc/fstab在最后面添加一行/dev/sdb1/optext4defaults00配置完毕,再使用df-h查看是否正常挂载了。重启服务器系统,再次使用df-h命令验证。有不明白的可以直接进小鸟云帮助中心搜索:/help/

阿里云ECS挂载硬盘

[root@test ~]# fdisk -l

Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x000b6c99

  Device Boot      Start        End      Blocks  Id  System

/dev/vda1  *        2048    83886046    41941999+  83  Linux

Disk /dev/vdb: 100.4 GB, 107374182400 bytes, 209715200 sectors    需要挂载的磁盘

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@test~]# fdisk /dev/vdb

Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Device does not contain a recognized partition table

Building a new DOS disklabel with disk identifier 0xc247eca8.

Command (m for help): n    输入n

Partition type:

  p  primary (0 primary, 0 extended, 4 free)

  e  extended

Select (default p): p  输入p

Partition number (1-4, default 1): 1

First sector (2048-209715199, default 2048):      回车

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):       回车

Using default value 209715199        

Partition 1 of type Linux and of size 100 GiB is set

Command (m for help): wq  输入wq退出

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

[root@test~]# fdisk -l

Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x000b6c99

  Device Boot      Start        End      Blocks  Id  System

/dev/vda1  *        2048    83886046    41941999+  83  Linux

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0xc247eca8

  Device Boot      Start        End      Blocks  Id  System

/dev/vdb1            2048  209715199  104856576  83  Linux      已创建/dev/vdb1分区

[root@test~]# mkfs.ext4 /dev/vdb1       格式化磁盘

mke2fs 1.42.9 (28-Dec-2013)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

6553600 inodes, 26214144 blocks

1310707 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=2174746624

800 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

[root@test~]# mkdir /mnt    创建挂载目录

mkdir: cannot create directory ‘/mnt’: File exists

[root@Hilbert ~]# echo /dev/vdb1 /mnt ext4 defaults 0 0 /etc/fstab

[root@Hilbert ~]# cat /etc/fstab       写入新分区信息

#

# /etc/fstab

# Created by anaconda on Wed May 25 02:12:53 2022

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

UUID=d71b01a9-bf24-4afb-b7d9-3a0961522139 /                      ext4    defaults        1 1

/dev/vdb1 /mnt ext4 defaults 0 0

[root@test~]# mount /dev/vdb1 /mnt      把分区挂载在/mnt目录下

[root@test~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

devtmpfs        3.9G    0  3.9G  0% /dev

tmpfs          3.9G    0  3.9G  0% /dev/shm

tmpfs          3.9G  608K  3.9G  1% /run

tmpfs          3.9G    0  3.9G  0% /sys/fs/cgroup

/dev/vda1        40G  2.1G  36G  6% /

tmpfs          783M    0  783M  0% /run/user/0

/dev/vdb1        98G  61M  91G  1% /mnt       新挂载的分区

阿里云服务器挂载硬盘的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于阿里云服务器挂载硬盘失败、阿里云服务器挂载硬盘的信息别忘了在本站进行查找喔。

发布于 2022-11-25 16:11:33
收藏
分享
海报
63
目录

    忘记密码?

    图形验证码

    复制成功
    微信号: cloud7591
    如需了解更多,欢迎添加客服微信咨询。
    我知道了