美文网首页
Centos7 数据盘挂载

Centos7 数据盘挂载

作者: 林亚希 | 来源:发表于2019-07-19 11:24 被阅读0次

今天发现购买了很久的华为云居然忘记挂载磁盘上去。!!!!

  1. 使用 fdisk -l 查看磁盘

[root@ecs-e63d ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G  3.2G   35G   9% /
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           3.9G  8.6M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           783M     0  783M   0% /run/user/0

[root@ecs-e63d ~]# 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: 0x000af5dd

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    83886079    41942016   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

发现活生生的100G被放在一边。浪费钱。

  1. 分区
[root@ecs-e63d /]# 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 0xd64f9f84.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default 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): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

  1. 格式化
[root@ecs-e63d /]# 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

  1. 挂载
mount /dev/vdb1 /home
  1. 永久挂载
[root@ecs-e63d /]# vi /etc/fstab
写入
/dev/vdb1 /mnt ext4 defaults 0 0

相关文章

  • HDFS数据迁移

    之前的数据存储在系统盘中,无法实现动态扩展,现在需要将数据迁移到数据盘(挂载盘)。 挂载硬盘 重命名挂载盘对应的目...

  • 阿里云 云盘挂载

    1 需要挂载的数据盘创建快照 2 创建云盘,选择对应云盘类型,用数据盘的快照创建云盘 3 查看云盘,挂载到需要挂载...

  • 阿里云ECS数据盘挂载

    一、查看服务器数据库情况 二、挂载数据盘 三、格式化数据盘(可选) 四、执行挂载操作 五、查看挂载结果 六、卸载挂载点

  • Centos7 数据盘挂载

    今天发现购买了很久的华为云居然忘记挂载磁盘上去。!!!! 使用 fdisk -l 查看磁盘 发现活生生的100G被...

  • linux的系统盘和数据盘&挂载数据盘到系统盘

    看系统盘: 看数据盘:有100G的数据盘可用 挂载数据盘到系统盘 看到多了/dev/vdb1 创建根目录 挂载成功!

  • 阿里云服务器挂载云盘和格式化云盘详细图文教程

    注意:单独购买的数据盘必须先挂载数据盘才能格式化,随实例一起购买的数据盘,无需挂载 如图购买完未挂载,服务器也只有...

  • 挂载硬盘过程

    新增设备/dev/bdb 挂载到wangyk目录1、挂载数据盘2、fdisk -l 查看数据盘3、mkfs.ext...

  • 阿里云数据盘挂载和卸载

    我们在阿里云买了一个数据盘,如果要使用这个数据盘,首先我们得先进行数据盘的挂载。数据盘的挂载 Setp1. 检查阿...

  • 阿里云ECS格式化数据盘及挂载

    一、基础说明 1、单独 购买的数据盘 需要先 挂载数据盘,然后才能格式化。2、随实例一起购买的数据盘,无需挂载,直...

  • centos7.3 yum LNMP 环境配置

    服务器配置太低,装了gitlab后挂了,重新配置一下。 一、挂载数据盘 只有系统盘了,挂载上原来的数据盘 看到数据...

网友评论

      本文标题:Centos7 数据盘挂载

      本文链接:https://www.haomeiwen.com/subject/onhjlctx.html