惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
雷峰网
雷峰网
Recent Announcements
Recent Announcements
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
博客园_首页
The Cloudflare Blog
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
S
SegmentFault 最新的问题
P
Proofpoint News Feed
Y
Y Combinator Blog
Jina AI
Jina AI
博客园 - 聂微东
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
F
Full Disclosure
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
T
Tailwind CSS Blog
J
Java Code Geeks
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Blog of Author Tim Ferriss
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 三生石上(FineUI控件)
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
宝玉的分享
宝玉的分享
IT之家
IT之家
Hacker News: Ask HN
Hacker News: Ask HN
The Register - Security
The Register - Security
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs

泠泫凝的异次元空间

通过串口安装Linux | 泠泫凝的异次元空间 curl自编译 | 泠泫凝的异次元空间 Minecraft 认证服务器代理 | 泠泫凝的异次元空间 飞塔分流配置实战 | 泠泫凝的异次元空间 Windows 安全启动证书检查 | 泠泫凝的异次元空间 Lxn-OneDriveCLI | 泠泫凝的异次元空间 华三交换机配置 ERPS 环网 | 泠泫凝的异次元空间 PVE 配置 VLAN 感知 | 泠泫凝的异次元空间 MT7922 无线网卡安装 | 泠泫凝的异次元空间 无显示输出 Linux 主机配置桌面显示 | 泠泫凝的异次元空间 Wireguard 部署 SOP 手册(自用) | 泠泫凝的异次元空间 Zabbix 7.4 通过钉钉发送告警提醒 | 泠泫凝的异次元空间 Debian with xfce 通过 VNC 共享屏幕 华三S6860 IRF堆叠 | 泠泫凝的异次元空间 iPad 应用侧载 | 泠泫凝的异次元空间 Smart DNS 分区解析 | 泠泫凝的异次元空间 建立 NFS 服务器并挂载到客户端 | 泠泫凝的异次元空间 将 Android 以 MTP 方式连接至 Debian PVE 虚拟机迁移至 vCenter | 泠泫凝的异次元空间 vCenter 虚拟机迁移至 PVE | 泠泫凝的异次元空间 PVE迁移时提示密钥验证失败 | 泠泫凝的异次元空间 修改Windows设备设置区域 | 泠泫凝的异次元空间 恢复 SecureCRT 7.x 保存的密码 | 泠泫凝的异次元空间 PVE 超融合下电与上电流程 | 泠泫凝的异次元空间 记一次Zabbix异常处理 | 泠泫凝的异次元空间 苹果设备保存SHSH2 | 泠泫凝的异次元空间 PVE超融合部署 | 泠泫凝的异次元空间 树莓派启用zram | 泠泫凝的异次元空间 在 Hyper-V 上安装 EVE-NG | 泠泫凝的异次元空间 Zabbix 部署与 Windows 硬件信息收集 | 泠泫凝的异次元空间 在WSL2中安装CUDA支持 | 泠泫凝的异次元空间 MinIO 集群部署 | 泠泫凝的异次元空间 vmware 虚拟化平台备份工具 Veeam 12 安装及配置 ubuntu 24.04 安装 nVidia 驱动后网卡消失 XMRig 自编译 | 泠泫凝的异次元空间 云桌面通过组策略统一体验配置 | 泠泫凝的异次元空间 Fortigate SSLVPN 无法连接内网 VNC 服务器 CentOS 7 使用镜像作为本地源并将自身作为YUM源服务器 | 泠泫凝的异次元空间 CentOS 7 离线更新 OpenSSH 服务 使用KubeKey离线部署Kubernetes | 泠泫凝的异次元空间 使用PGP对消息进行签名 | 泠泫凝的异次元空间 禁止MinIO展示桶内文件列表 | 泠泫凝的异次元空间 华为 Fusion Access 云桌面部署 | 泠泫凝的异次元空间 vmware Horizon 模板机部署 | 泠泫凝的异次元空间 vmware Horizon 云桌面与云应用部署 | 泠泫凝的异次元空间 Citrix XenApp 云应用交付 | 泠泫凝的异次元空间 Citrix XenDesktop 云桌面部署 | 泠泫凝的异次元空间 PVE LVM 扩容 | 泠泫凝的异次元空间 Linux 网络聚合(bond方式) | 泠泫凝的异次元空间 Citrix XenServer 7.2 部署教程 | 泠泫凝的异次元空间 在 Windows Server 2019 上安装 AMD 显卡驱动 openEuler 安装并使用 EPEL 源 | 泠泫凝的异次元空间 从已有Linux系统创建带桌面环境的Docker镜像 | 泠泫凝的异次元空间 下载联想原厂镜像及解密 | 泠泫凝的异次元空间 在基于 arm 架构的服务器上安装 PVE | 泠泫凝的异次元空间 自制 EVE-NG 镜像 | 泠泫凝的异次元空间 不使用 Snap 在 ubuntu 上安装 Chromium 浏览器 Fortigate 6.2 固件从 PPPoE 获得 IPv6 地址 Fortigate 手记 | 泠泫凝的异次元空间 Fortigate 通过命令行自定义 NTP 服务器 | 泠泫凝的异次元空间 arm 架构 CentOS 7 安装 MySQL 5.7 版本 ubuntu 20 安装计算卡驱动和 CUDA Toolkit 锐捷诺客云添加设备后一直显示“等待同步” | 泠泫凝的异次元空间 Windows 10 自动登录 | 泠泫凝的异次元空间 OpenWRT IPv6 防火墙设置 | 泠泫凝的异次元空间 k8s 部署踩坑合集 | 泠泫凝的异次元空间 改变 Ubuntu TTY 终端字体 | 泠泫凝的异次元空间 Parted 无损扩容磁盘分区 | 泠泫凝的异次元空间 NTP服务器测试 | 泠泫凝的异次元空间 【相亲相爱】2024祝大家!新年快乐!!! ESXi中重新挂载数据盘 | 泠泫凝的异次元空间 使用 MediaMTX + RTSP 搭建低延迟直播服务器 Firewalld 手记 | 泠泫凝的异次元空间 Ubuntu 上不使用 snapd 安装 Firefox 在 armbian 上安装 xfce 和 VNC 做远程桌面 在 ubuntu 20 上使用 TigerVNC 做远程桌面 在 openEuler 上部署安装 openGauss | 泠泫凝的异次元空间 Wireguard 组网笔记 | 泠泫凝的异次元空间 让特定IP(段)走VPN连接 | 泠泫凝的异次元空间 在Wireguard中排除部分IP(段) | 泠泫凝的异次元空间 CentOS 7 上升级 OpenSSL | 泠泫凝的异次元空间 将黑群晖部署到ESXi(笔记) | 泠泫凝的异次元空间 apk 代码反编译笔记 | 泠泫凝的异次元空间 Windows 搭建 iSCSI 服务器全攻略 | 泠泫凝的异次元空间 CentOS 7 编译安装 Python 3 开源语音识别工具 Whisper | 泠泫凝的异次元空间 Ubuntu 下 Python 编译安装及关联问题解决 | 泠泫凝的异次元空间 Ansible Tower 安装 | 泠泫凝的异次元空间 提高 PowerPoint 导出到图片时的分辨率 | 泠泫凝的异次元空间 利用亚马逊云服务器和VPC 构建安全可靠的虚拟网络 | 泠泫凝的异次元空间 Windows Server 多网卡链路聚合 | 泠泫凝的异次元空间 MT3000路由+移远EC20模块体验 | 泠泫凝的异次元空间 Python安装依赖时出现ctype问题 | 泠泫凝的异次元空间 GL-MT3000日用设置 | 泠泫凝的异次元空间 解除 vCenter 的最低内存限制 | 泠泫凝的异次元空间 跳过Windows 11的强制联网和账户登录 | 泠泫凝的异次元空间 Cloudflare Trace API 信息详解 | 泠泫凝的异次元空间 在CentOS中搭建由nginx反代和Apache2作为后端的Wordpress | 泠泫凝的异次元空间 通过nginx进行文件共享 | 泠泫凝的异次元空间 禁用 sudo 时密码认证 | 泠泫凝的异次元空间
EVE-NG 系统盘扩容及镜像导入 | 泠泫凝的异次元空间
Lxn's Area · 2023-04-03 · via 泠泫凝的异次元空间

默认的 Eve-NG 硬盘空间大小可用空间只有 36GB ,本文将对系统盘进行扩容并导入镜像。本文的每一条命令都是作者能够跑通实际测试过的,如果有问题可以下方评论区留言。

首先先看一下默认的各分区大小:

1
2
3
4
5
6
7
8
9
root@eve-ng:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 798M 14M 784M 2% /run
/dev/mapper/eve--ng--vg-root 41G 2.8G 36G 8% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 472M 119M 329M 27% /boot

可以看到,默认的根分区/dev/mapper/eve--ng--vg-root只有41GB的总空间,并且在默认状态下只有36GB的空闲空间。

这里提供两种思路,一种是扩容不超过2TB;一种是扩容大小大于2TB。这两种模式的区别主要是EVE-NG的主硬盘采用了MBR分区表格式,而MBR的分区表格式不支持大于2TB的结构管理。

修改:不再提供容量小于2TB的扩容方案,相对来说会比较复杂,也需要重启多次来应用更改。以下方案无论容量多少都可以采用。

注意:本文所提供的示例可能是有修改和删减的,具体以实际输出为准。

  1. 首先在EVE-NG的虚拟机上创建一个硬盘,容量自定,可以在不关机的状态下添加硬盘,注意硬盘接口一定要选择SATA。
    这里以新增一块4TB的硬盘为例:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 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: 0xeb1c7d5a

    Device Boot Start End Sectors Size Id Type
    /dev/sda1 * 2048 999423 997376 487M 83 Linux
    /dev/sda2 1001470 104855551 103854082 49.5G 5 Extended
    /dev/sda5 1001472 104855551 103854080 49.5G 8e Linux LVM


    Disk /dev/sdb: 4 TiB, 4398046511104 bytes, 8589934592 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
  2. 在新加的硬盘上创建分区:
    1
    fdisk /dev/sdb
    首先输入g回车创建GPT分区表:
    1
    2
    Command (m for help): g
    Created a new GPT disklabel (GUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
    然后输入n创建新分区(如果没有特殊要求以下参数均可保持默认):
    1
    2
    3
    4
    5
    6
    Command (m for help): n
    Partition number (1-128, default 1):
    First sector (2048-8589934558, default 2048):
    Last sector, +sectors or +size{K,M,G,T,P} (2048-8589934558, default 8589934558):

    Created a new partition 1 of type 'Linux filesystem' and of size 4 TiB.
    最后输入w将更改写入硬盘:
    1
    2
    3
    4
    Command (m for help): w
    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    Syncing disks.
    最后最后用fdisk -l看一下分区和容量是否正确:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    Disk /dev/sdb: 4 TiB, 4398046511104 bytes, 8589934592 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: gpt
    Disk identifier: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

    Device Start End Sectors Size Type
    /dev/sdb1 2048 8589934558 8589932511 4T Linux filesystem
  3. 看一下 Volume Group 的名称:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    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 49.52 GiB
    PE Size 4.00 MiB
    Total PE 12677
    Alloc PE / Size 12677 / 49.52 GiB
    Free PE / Size 0 / 0
    VG UUID Mt9awT-x1IE-4b7W-Hlvy-NINH-x3Pb-SPuZZb
    可见VG Nameeve-ng-vg
  4. 将新创建的分区加入到上面的组中:
    1
    2
    3
    root@eve-ng:~# vgextend eve-ng-vg /dev/sdb1
    Physical volume "/dev/sdb1" successfully created
    Volume group "eve-ng-vg" successfully extended
    然后看一下组中是否有了新增的容量:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    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 4.05 TiB
    PE Size 4.00 MiB
    Total PE 1061252
    Alloc PE / Size 12677 / 49.52 GiB
    Free PE / Size 1048575 / 4.00 TiB
    VG UUID Mt9awT-x1IE-4b7W-Hlvy-NINH-x3Pb-SPuZZb
  5. 扩容逻辑卷:
    首先看一下目前逻辑卷的信息
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    root@eve-ng:~# lvdisplay
    --- Logical volume ---
    LV Path /dev/eve-ng-vg/root
    LV Name root
    VG Name eve-ng-vg
    LV UUID arklJp-Shb2-f1qp-sjeg-ekmw-fbRN-VUf4Rw
    LV Write Access read/write
    LV Creation host, time eve-ng, 2021-01-11 03:27:43 +0200
    LV Status available
    # open 1
    LV Size 41.52 GiB
    Current LE 10629
    Segments 1
    Allocation inherit
    Read ahead sectors auto
    - currently set to 256
    Block device 253:0
    将加入 Volume Group 的全部空闲容量并入逻辑卷的路径下:
    1
    2
    3
    root@eve-ng:~# lvextend -l +100%FREE /dev/eve-ng-vg/root
    Size of logical volume eve-ng-vg/root changed from 41.52 GiB (10629 extents) to 4.04 TiB (1059204 extents).
    Logical volume root successfully resized.
    Resize一下:
    1
    2
    3
    4
    5
    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 = 3, new_desc_blocks = 259
    The filesystem on /dev/eve-ng-vg/root is now 1084624896 (4k) blocks long.
  6. 最后看一下容量变化:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    root@eve-ng:~# df -h
    Filesystem Size Used Avail Use% Mounted on
    udev 3.9G 0 3.9G 0% /dev
    tmpfs 798M 14M 784M 2% /run
    /dev/mapper/eve--ng--vg-root 4.0T 2.8G 3.9T 1% /
    tmpfs 3.9G 0 3.9G 0% /dev/shm
    tmpfs 5.0M 0 5.0M 0% /run/lock
    tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
    /dev/sda1 472M 119M 329M 27% /boot
    扩容成功了,还有3.9T的空余空间。

导入镜像

镜像的导入就简单多了。

镜像分类

EVE-NG镜像共三种类型:

  • Dynamips:思科设备真实IOS镜像,类似GNS3,电脑CPU利用率非常高。
  • IOL:IOU模拟器的镜像,基本完全支持思科设备二、三层功能。
  • QEMU:这已经不算是镜像文件,而是KVM虚拟机安装操作系统后生成的磁盘文件,通常用来模拟ASAv、ISE、F5、N9K等设备。每台设备相当于一台虚拟机,比较吃资源。

QEMU镜像

  1. 用scp工具(如WinSCP)连接到EVE-NG主机,IP地址在启动后可以看到,用户名为root,密码是首次初始化后自行设定的。
  2. 将镜像文件带文件夹上传至/opt/unetlab/addons/qemu/目录下。
  3. 执行如下命令修正权限,修正后即可使用镜像。
    1
    /opt/unetlab/wrappers/unl_wrapper -a fixpermissions
  4. 如果还需要再次导入镜像,则每次都需要执行第三步的修正权限。

IOL镜像

安装之前先说一下IOL需要的文件:

  1. .bin文件,是IOL镜像文件;
  2. iourc是IOL的License文件;
  3. CiscoIOUKeygen.py是License的生成工具。

安装IOL镜像的话分为两步:复制文件和生成License。

  1. 将上述所有文件上传到/opt/unetlab/addons/iol/bin目录下;
  2. 看一下文件是否都在:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    root@eve-ng:/opt/unetlab/addons/iol/bin# ll -a
    total 427024
    drwxr-xr-x 2 root root 4096 Apr 3 16:58 ./
    drwxr-xr-x 4 root root 4096 Jan 11 2021 ../
    -rw-r--r-- 1 root root 1202 Mar 18 2020 CiscoIOUKeygen.py
    -rw-r--r-- 1 root root 126226692 Mar 18 2020 i86bi_LinuxL2-AdvEnterpriseK9-M_152_May_2018.bin
    -rw-r--r-- 1 root root 126249700 Mar 18 2020 i86bi_linux_l2-adventerprisek9-ms.SSA.high_iron_20190423.bin
    -rw-r--r-- 1 root root 184759244 Mar 18 2020 i86bi_LinuxL3-AdvEnterpriseK9-M2_157_3_May_2018.bin
    -rw-r--r-- 1 root root 37 Mar 18 2020 iourc
  3. 生成License:
    切换到目录之后执行命令:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    root@eve-ng:/opt/unetlab/addons/iol/bin# python CiscoIOUKeygen.py
    *********************************************************************
    Cisco IOU License Generator - Kal 2011, python port of 2006 C version
    Modified to work with python3 by c_d 2014
    hostid=007f0101, hostname=eve-ng, ioukey=7f0343

    Add the following text to ~/.iourc:
    [license]
    eve-ng = 972f30267ef51616;

    You can disable the phone home feature with something like:
    echo '127.0.0.127 xml.cisco.com' >> /etc/hosts
    然后删掉原来的iourc文件,将上面[License]和下一行写入该文件,保存退出即可。
    注意License跟随主机的主机名变更,如果主机名变更,License也要重新生成。
    以下是一个iourc的示例文件:
    1
    2
    [license]
    eve-ng = 972f30267ef51616;

Dynamips镜像

手头没有这个镜像,不写了,之后有了再写。

 上一篇

vmware