本站已运行

攻城狮论坛

作者: 男友力max
查看: 1025|回复: 8

主题标签Tag

more +今日重磅推荐Recommend No.1

所有IT类厂商认证考试题库下载所有IT类厂商认证考试题库下载

more +随机图赏Gallery

【新盟教育】2023最新华为HCIA全套视频合集【网工基础全覆盖】---国sir公开课合集【新盟教育】2023最新华为HCIA全套视频合集【网工基础全覆盖】---国sir公开课合集
【新盟教育】网工小白必看的!2023最新版华为认证HCIA Datacom零基础全套实战课【新盟教育】网工小白必看的!2023最新版华为认证HCIA Datacom零基础全套实战课
原创_超融合自动化运维工具cvTools原创_超融合自动化运维工具cvTools
重量级~~30多套JAVA就业班全套 视频教程(请尽快下载,链接失效后不补)重量级~~30多套JAVA就业班全套 视频教程(请尽快下载,链接失效后不补)
链接已失效【超过几百G】EVE 国内和国外镜像 全有了 百度群分享链接已失效【超过几百G】EVE 国内和国外镜像 全有了 百度群分享
某linux大佬,积累多年的电子书(约300本)某linux大佬,积累多年的电子书(约300本)
乾颐堂现任明教教主Python完整版乾颐堂现任明教教主Python完整版
乾颐堂 教主技术进化论 2018-2019年 最新31-50期合集视频(各种最新技术杂谈视频)乾颐堂 教主技术进化论 2018-2019年 最新31-50期合集视频(各种最新技术杂谈视频)
Python学习视频 0起点视频 入门到项目实战篇 Python3.5.2视频教程 共847集 能学102天Python学习视频 0起点视频 入门到项目实战篇 Python3.5.2视频教程 共847集 能学102天
约21套Python视频合集 核心基础视频教程(共310G,已压缩)约21套Python视频合集 核心基础视频教程(共310G,已压缩)
最新20180811录制 IT爱好者-清风羽毛 - 网络安全IPSec VPN实验指南视频教程最新20180811录制 IT爱好者-清风羽毛 - 网络安全IPSec VPN实验指南视频教程
最新20180807录制EVE开机自启动虚拟路由器并桥接物理网卡充当思科路由器最新20180807录制EVE开机自启动虚拟路由器并桥接物理网卡充当思科路由器

[EVE-NG] EVE-NG扩展硬盘容量

[复制链接]
查看: 1025|回复: 8
开通VIP 免金币+免回帖+批量下载+无广告
1、查看当前磁盘使用情况 SSH方式连接EVE-NG虚机后输入指令(df -h)查看当前磁盘。/dev/mapper/eve–ng–vg-root 就是存放镜像的,只要把这个容量扩大即可,下面就针对此情况扩展容量。
  • root@eve-ng:~# df -h
  • Filesystem                    Size  Used Avail Use% Mounted on
  • udev                           12G     0   12G   0% /dev
  • tmpfs                         2.4G   15M  2.4G   1% /run
  • /dev/mapper/eve--ng--vg-root   24G   13G  9.4G  58% /
  • tmpfs                          12G     0   12G   0% /dev/shm
  • tmpfs                         5.0M     0  5.0M   0% /run/lock
  • tmpfs                          12G     0   12G   0% /sys/fs/cgroup
  • /dev/sda1                     472M  143M  305M  32% /boot

2、关闭EVE-NG虚机,编译虚拟机设置>>硬件>>磁盘(SCSI)>>扩展 输入磁盘大小,推荐最少500GB然后点击扩展,扩展后按确定即可

EVE-NG扩展硬盘容量

EVE-NG扩展硬盘容量

EVE-NG扩展硬盘容量

EVE-NG扩展硬盘容量

EVE-NG扩展硬盘容量

EVE-NG扩展硬盘容量

EVE-NG扩展硬盘容量

EVE-NG扩展硬盘容量

EVE-NG扩展硬盘容量

EVE-NG扩展硬盘容量

3、开启EVE-NG虚机,SSH方式连接EVE-NG虚机后输入指令(fidsk -l)查看当前磁盘大小,从第一百行可以确认磁盘已经扩展到了500GB。
  • root@eve-ng:~# fdisk -l      #查看当前磁盘大小
  • Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk /dev/sda: 500 GiB, 536870912000 bytes, 1048576000 sectors  #磁盘总容量已经扩展到了500GB
  • 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: 0x94fa5649
  • 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/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

以下操作需要一定的Linux基础,零基础的谨慎操作。
4、分区扩展的磁盘,磁盘扩容好需要重启系统。
  • 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): 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: 0x94fa5649
  • 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/sda5       1001472 62912511 61911040 29.5G 8e Linux LVM
CCNA考试 官方正规报名 仅需1500元
回复 论坛版权

使用道具 举报

男友力max [VIP@钻石] 发表于 2017-12-3 19:36:20 | 显示全部楼层


  • 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): 3
  • First sector (999424-1048575999, default 999424): 62912512  #输入分区开始位置
  • Last sector, +sectors or +size{K,M,G,T,P} (62912512-1048575999, default 1048575999): 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: 0x94fa5649
  • 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  #重启系统使分区操作生效

5、分区好的扩展磁盘加入到EVE-NG的动态卷上
  • root@eve-ng:~# vgdisplay  #查看VG的名字
  •   --- 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               RAfj0r-fDwi-oPHM-WzTI-IrX9-OdLM-JQeoyz
  •    
  • root@eve-ng:~# vgextend eve-ng-vg /dev/sda3  #将sda3加入到eve-ng-vg这个VG中
  •   Physical volume "/dev/sda3" successfully created
  •   Volume group "eve-ng-vg" successfully extended
  • root@eve-ng:~# vgdisplay      #查看VG的名字
  •   --- 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               RAfj0r-fDwi-oPHM-WzTI-IrX9-OdLM-JQeoyz

6、扩容EVE-NG的LV
  • root@eve-ng:~# lvdisplay  #查看LV路径和大小
  •   --- Logical volume ---
  •   LV Path                /dev/eve-ng-vg/root
  •   LV Name                root
  •   VG Name                eve-ng-vg
  •   LV UUID                CxNG4X-3jtX-9Lbf-WfIp-eMAl-Y2wL-Qxg4sL
  •   LV Write Access        read/write
  •   LV Creation host, time eve-ng, 2017-04-11 02:53:43 +0300
  •   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                3JJj36-MU70-hMAc-ZY7S-9pcK-R1uw-3Szevc
  •   LV Write Access        read/write
  •   LV Creation host, time eve-ng, 2017-04-11 02:53:43 +0300
  •   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:~# lvextend -l +100%FREE /dev/eve-ng-vg/root  #将剩余容量扩容到/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                CxNG4X-3jtX-9Lbf-WfIp-eMAl-Y2wL-Qxg4sL
  •   LV Write Access        read/write
  •   LV Creation host, time eve-ng, 2017-04-11 02:53:43 +0300
  •   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                3JJj36-MU70-hMAc-ZY7S-9pcK-R1uw-3Szevc
  •   LV Write Access        read/write
  •   LV Creation host, time eve-ng, 2017-04-11 02:53:43 +0300
  •   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.

7、查看扩容最终效果
  • root@eve-ng:~# df -h  #查看磁盘使用情况
  • Filesystem                    Size  Used Avail Use% Mounted on
  • udev                           12G     0   12G   0% /dev
  • tmpfs                         2.4G   15M  2.4G   1% /run
  • /dev/mapper/eve--ng--vg-root  486G   13G  454G   3% /
  • tmpfs                          12G     0   12G   0% /dev/shm
  • tmpfs                         5.0M     0  5.0M   0% /run/lock
  • tmpfs                          12G     0   12G   0% /sys/fs/cgroup
  • /dev/sda1                     472M  174M  274M  39% /boot


回复 支持 反对

使用道具 举报

Rockyw [Lv10 举世无双] 发表于 2017-12-4 12:32:30 | 显示全部楼层
字体的颜色能不能统一一下,太花了
回复 支持 反对

使用道具 举报

byronyj [Lv8 技术精悍] 发表于 2017-12-5 18:33:03 | 显示全部楼层
学习IT知识,自学网络技术,就来攻城狮论坛bbs.vlan5.com
回复 支持 反对

使用道具 举报

慈行普度 [Lv9 无所不能] 发表于 2017-12-5 19:39:29 | 显示全部楼层
啊啊啊啊啊!
回复 支持 反对

使用道具 举报

ldsh [Lv8 技术精悍] 发表于 2017-12-28 07:09:13 | 显示全部楼层
看帖看完了至少要顶一下!
回复 支持 反对

使用道具 举报

adonis1978 [Lv3 牛刀小试] 发表于 2018-11-27 22:43:54 | 显示全部楼层
地板
byronyj [Lv8 技术精悍] 发表于 2017-12-5 18:33:03 | 只看该作者
学习IT知识,自学网络技术,就来攻城狮论坛bbs.vlan5.com
回复 支持 反对

使用道具 举报

andygrrr [Lv9 无所不能] 发表于 2018-11-27 23:06:53 | 显示全部楼层
啊啊啊啊啊
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|无图浏览|手机版|网站地图|攻城狮论坛

GMT+8, 2025-5-23 10:07 , Processed in 0.135531 second(s), 17 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4 © 2001-2013 Comsenz Inc.

Designed by ARTERY.cn