EVE-NG硬盘扩容,存储海量镜像

来源 http://blog.51cto.com/sms1107/1928453

一、查看当前磁盘使用情况

/dev/mapper/eve--ng--vg-root,所以我们只要把这个LV容量扩大即可

二、给EVE-NG硬盘扩大容量,对于EVE-NG来说,相当于加大物理磁盘容量

把EVE-NG关机后编辑EVE-NG虚拟机

注意:无法扩展具有快照的虚拟机中的磁盘,必须删除快照。

点击扩展

填写磁盘大小,点扩展

等待完成扩展

三、EVE-NG系统层面增大VG容量

1、加电开机EVE-NG,确认硬盘容量为500G

root@eve-ng:~# fdisk -l

……

……

……

Disk /dev/sda: 500 GiB, 536870912000 bytes, 1048576000 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

Disklabel type: dos

Disk identifier: 0x6d98196e

Device     Boot   Start      End  Sectors  Size Id Type(硬盘分区情况)

/dev/sda1  *       2048   999423   997376  487M 83 Linux

/dev/sda2       1001470  61911042 29.5G  5 Extended (sda2的end sector值,该数值 +1即是sda3的start sector)

/dev/sda5       1001472 62912511 61911040 29.5G 8e Linux LVM

Disk /dev/mapper/eve--ng--vg-root: 23.5 GiB, 25253904384 bytes, 49324032 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 /dev/mapper/eve--ng--vg-swap_1: 6 GiB, 6442450944 bytes, 12582912 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@eve-ng:~#

2、给硬盘sda分区

root@eve-ng:~# fdisk /dev/sda

Welcome to fdisk (util-linux 2.27.1).

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

Be careful before using the write command.

Command (m for help): n

Partition type

p   primary (1 primary, 1 extended, 2 free)

l   logical (numbered from 5)

Select (default p): p

Partition number (3,4, default 3):

First sector (999424-1048575999, default 999424): 62912512

#(sda3的start sector,该值是sda2的end sector值 +1)

Last sector, +sectors or +size{K,M,G,T,P} (62912512-1048575999, default 1048575999):

Created a new partition 3 of type 'Linux' and of size 470 GiB.

Command (m for help): p

Disk /dev/sda: 500 GiB, 536870912000 bytes, 1048576000 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

Disklabel type: dos

Disk identifier: 0x6d98196e

Device     Boot    Start        End   Sectors  Size Id Type

/dev/sda1  *        2048     999423    997376  487M 83 Linux

/dev/sda2        1001470   62912511  61911042 29.5G  5 Extended

/dev/sda3       62912512 1048575999 985663488  470G 83 Linux

/dev/sda5        1001472   62912511  61911040 29.5G 8e Linux LVM

Partition table entries are not in disk order.

Command (m for help): w

The partition table has been altered.

Calling ioctl() to re-read partition table.

Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

root@eve-ng:~# reboot (重启,使分区生效)

3、将sda3加入到VG中

查看VG的名字

root@eve-ng:~# vgdisplay

--- Volume group ---

VG Name               eve-ng-vg

System ID

Format                lvm2

Metadata Areas        1

Metadata Sequence No  3

VG Access             read/write

VG Status             resizable

MAX LV                0

Cur LV                2

Open LV               2

Max PV                0

Cur PV                1

Act PV                1

VG Size               29.52 GiB

PE Size               4.00 MiB

Total PE              7557

Alloc PE / Size       7557 / 29.52 GiB

Free  PE / Size       0 / 0

VG UUID               9MuCtK-vJSR-Y2aw-iIPi-lQa3-0onn-m5uNbv

将sda3加入到eve-ng-vg这个VG中

root@eve-ng:~# vgextend eve-ng-vg /dev/sda3

Physical volume "/dev/sda3" successfully created

Volume group "eve-ng-vg" successfully extended

root@eve-ng:~# vgdisplay

--- Volume group ---

VG Name               eve-ng-vg

System ID

Format                lvm2

Metadata Areas        2

Metadata Sequence No  4

VG Access             read/write

VG Status             resizable

MAX LV                0

Cur LV                2

Open LV               2

Max PV                0

Cur PV                2

Act PV                2

VG Size               499.52 GiB

PE Size               4.00 MiB

Total PE              127877

Alloc PE / Size       7557 / 29.52 GiB

Free  PE / Size       120320 / 470.00 GiB

VG UUID               9MuCtK-vJSR-Y2aw-iIPi-lQa3-0onn-m5uNbv

4、扩容LV

查看LV路径

root@eve-ng:~# lvdisplay

--- Logical volume ---

LV Path                /dev/eve-ng-vg/root

LV Name                root

VG Name                eve-ng-vg

LV UUID                0wyDXu-602J-HQ0N-T1Ue-J5si-EFFY-vKO1tX

LV Write Access        read/write

LV Creation host, time eve-ng, 2017-03-18 22:23:02 +0200

LV Status              available

# open                 1

LV Size                23.52 GiB

Current LE             6021

Segments               1

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           252:0

--- Logical volume ---

LV Path                /dev/eve-ng-vg/swap_1

LV Name                swap_1

VG Name                eve-ng-vg

LV UUID                umXPMX-3BGd-2TR6-Msjn-zp05-GLvx-ReOHx6

LV Write Access        read/write

LV Creation host, time eve-ng, 2017-03-18 22:23:02 +0200

LV Status              available

# open                 2

LV Size                6.00 GiB

Current LE             1536

Segments               1

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           252:1

将剩余容量扩容到/dev/eve-ng-vg/root路径下

root@eve-ng:~# lvextend -l +100%FREE /dev/eve-ng-vg/root

Size of logical volume eve-ng-vg/root changed from 23.52 GiB (6021 extents) to 493.52 GiB (126341 extents).

Logical volume root successfully resized.

root@eve-ng:~# lvdisplay

--- Logical volume ---

LV Path                /dev/eve-ng-vg/root

LV Name                root

VG Name                eve-ng-vg

LV UUID                0wyDXu-602J-HQ0N-T1Ue-J5si-EFFY-vKO1tX

LV Write Access        read/write

LV Creation host, time eve-ng, 2017-03-18 22:23:02 +0200

LV Status              available

# open                 1

LV Size                493.52 GiB

Current LE             126341

Segments               2

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           252:0

--- Logical volume ---

LV Path                /dev/eve-ng-vg/swap_1

LV Name                swap_1

VG Name                eve-ng-vg

LV UUID                umXPMX-3BGd-2TR6-Msjn-zp05-GLvx-ReOHx6

LV Write Access        read/write

LV Creation host, time eve-ng, 2017-03-18 22:23:02 +0200

LV Status              available

# open                 2

LV Size                6.00 GiB

Current LE             1536

Segments               1

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           252:1

重新定义文件系统大小

root@eve-ng:~# resize2fs /dev/eve-ng-vg/root

resize2fs 1.42.13 (17-May-2015)

Filesystem at /dev/eve-ng-vg/root is mounted on /; on-line resizing required

old_desc_blocks = 2, new_desc_blocks = 31

The filesystem on /dev/eve-ng-vg/root is now 129373184 (4k) blocks long.

5、查看磁盘使用情况

root@eve-ng:~# df -h

Filesystem                    Size  Used Avail Use% Mounted on

udev                          2.9G     0  2.9G   0% /dev

tmpfs                         597M   14M  584M   3% /run

/dev/mapper/eve--ng--vg-root  486G  6.1G  460G   2% /

tmpfs                         3.0G     0  3.0G   0% /dev/shm

tmpfs                         5.0M     0  5.0M   0% /run/lock

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

/dev/sda1                     472M  105M  343M  24% /boot

root@eve-ng:~#

好啦,扩容完成!各位,随意上传镜像吧,镜像再多也不怕!

================== End

EVE-NG硬盘扩容,存储海量镜像的更多相关文章

  1. [linux]如何为Virtualbox虚拟硬盘扩容(转载)

    前言 这个教程介绍如何为Virtualbox虚拟硬盘扩容,虚拟硬盘分为动态分配大小和固定虚拟硬盘,扩容的方法不一样: 如何为动态分配的Virtualbox虚拟硬盘扩容 如何为固定大小的Virtualb ...

  2. linux 为动态分配的Virtualbox虚拟硬盘扩容

    如何为动态分配的Virtualbox虚拟硬盘扩容 查看虚拟硬盘是否是动态分配大小 打开虚拟机的设置界面,在左侧栏点击存储.在存储树下面选择你的虚拟硬盘.在右边可以看见虚拟硬盘的信息.在下面可以看见,我 ...

  3. 用hdfs存储海量的视频数据的设计思路

    用hdfs存储海量的视频数据 存储海量的视频数据,主要考虑两个因素:如何接收视频数据和如何存储视频数据. 我们要根据数据block在集群上的位置分配计算量,要充分利用带宽的优势. 1.接收视频数据 将 ...

  4. 解决持久化数据太大,单个节点的硬盘无法存储的问题;解决运算量太大,单个节点的内存、CPU无法处理的问题

    需要学习的技术很多,要自学新知识也不是一件容易的事,选择一个自己比较感兴趣的会是一个比较好的开端,于是,打算学一学分布式系统. 带着问题,有目的的学习,先了解整体架构,在深入感兴趣的细节,这是我的计划 ...

  5. linux学习之硬盘的存储原理和内部架构

    原文地址:https://blog.csdn.net/tanggao1314/article/details/52074735 首先,让我们看一下硬盘的发展史: 1956年9月13日,IBM的IBM ...

  6. virtualbox硬盘扩容

    https://blog.csdn.net/ouyang_peng/article/details/53261599 1. cmd界面进入virtualbox安装目录:cd C:\Program Fi ...

  7. (转)fastdfs group通过添加硬盘扩容

    通过给group的机器添加硬盘的方式,实现某个group的扩容. fastdfs在一台服务器支持多个store_path,每个store_path指向一个存储路径.url “M00/3F/E1/oYY ...

  8. fastdfs group通过添加硬盘扩容

    通过给group的机器添加硬盘的方式,实现某个group的扩容. fastdfs在一台服务器支持多个store_path,每个store_path指向一个存储路径.url "M00/3F/E ...

  9. 【vagrant】硬盘扩容

    如题,笔者之前一直在使用vagrant作为虚拟机使用. vagrant的好处自然不必说,只是有一天遇到了一个麻烦事--虚拟硬盘空间不!够!了! 笔者使用了df -h命令一看,结果发现,主硬盘(/dev ...

随机推荐

  1. ASP.NET SignalR 与 LayIM2.0 配合轻松实现Web聊天室(零) 前言(内容已过期,阅读请慎重)

    2018-09-19 更新 :现在已经更新ASP.NET Core Middleware版本.对.NET Core SignalR感兴趣的朋友移步:https://github.com/fanpan2 ...

  2. 可能是全网首个支持阿里云Elasticsearch Xapck鉴权的Skywalking

    可能是全网首个支持阿里云Elasticsearch Xapck鉴权的Skywalking 对Skywalking有兴趣的同学参见:年轻人的第一个APM-Skywalking 之前在搭建Skywalki ...

  3. 暗通道去雾算法的python实现

    何凯明博士的去雾文章和算法实现已经漫天飞了,我今天也就不啰里啰唆,直接给出自己python实现的完整版本,全部才60多行代码,简单易懂,并有简要注释,去雾效果也很不错. 在这个python版本中,计算 ...

  4. 理解依赖注入(Dependency Injection)

    理解依赖注入 Yii2.0 使用了依赖注入的思想.正是使用这种模式,使得Yii2异常灵活和强大.千万不要以为这是很玄乎的东西,看完下面的两个例子就懂了. class SessionStorage { ...

  5. MSP-EZ430U_02板子测试使用

    1. 实物如下 2. 先上电,显示驱动没安装 3. 找到驱动的位置,不过实际上安装IAR for msp430之后,驱动就自动的识别了.

  6. kali2.0下JAVA安装

    参考网址:http://www.blackmoreops.com/2013/10/26/how-to-install-java-jdk-in-kali-linux/ 1.下载javase,http:/ ...

  7. 使用SCSS扩展Bootstrap4

    摘要 因为打算写一个小网站,而个人时间又不是那么充裕,所以没有选择前后端分离的架构. 对于非前后端分离应用来说,Bootstrap应该是目前的最佳前端框架之一了. 而Bootstrap4,是Boots ...

  8. svn 配置仓库

    1.新建一个空文件夹,然后点击--在此创建版本库. 2.修改conf 下的 svnserve.conf : anon-access = read auth-access = write passwor ...

  9. 英特尔近日发布最新版实感™ SDK R5 (v7)

    英特尔开发人员专区 原文地址 英特尔® 实感™ SDK 的 7.0.23.8048 版本(也称为 R5)现已推出.您将看到的主要变化包括: 支持英特尔® 实感™ SR300 摄像头:应于 2016 年 ...

  10. @Resource和@Autowired的异同

    相同点: 两者都能做到注入一个Bean. 两者都可应用在Field和Method上面. 两者均为Runtime级别的Retention. 不同点: 使用的场景有差异 @Resource可应用在类(TY ...