7.EVE-NG硬盤擴容,存儲海量鏡像


文章列表(關注微信公衆號EmulatedLab,及時獲取文章以及下載連接)html

一、EVE-NG介紹(EVE-NG最好用的模擬器,仿真環境時代來臨!)
linux

二、EVE-NG安裝過程介紹微信

三、EVE-NG導入Dynamips和IOLapp

四、EVE-NG導入QEMU鏡像ide

五、EVE-NG關聯SecureCRT,VNC,Wiresharkui

六、EVE-NG網卡橋接,帶您走進更高級的實驗spa

七、EVE-NG硬盤擴容,存儲海量鏡像3d

八、EVE-NG定製我的鏡像,腳本快速導入orm

九、EVE-NG容納H3C、Huawei,吞併GNS3視頻

十、EVE-NG鏡像來啦!打造國內最大的EVE交流圈

十一、EVE-NG鏡像再次來襲,無所不能!

十二、EVE-NG鏡像增持,走上神壇!

1三、EVE-NG內存不夠?教您擴大虛擬內存!

1四、EVE-NG更新方便,不費勁兒!

1五、EVE-NG小衆鏡像,助力嚐鮮!

1六、EVE-NG體驗Seafile,拋棄10K/s網盤

1七、......

點擊查看配套視頻教程!



wKioL1kiyFLiltmFAAbqCnW3vJc492.jpg-wh_50


EVE-NG硬盤擴容,存儲海量鏡像



1、查看當前磁盤使用狀況

 

wKioL1kjmE3QUvbMAAA6TIkoFt0212.png-wh_50

 

/dev/mapper/eve--ng--vg-root,因此咱們只要把這個LV容量擴大便可

wKioL1kjmE6SiiI4AAA6qn44rC8525.png-wh_50



2、給EVE-NG硬盤擴大容量,對於EVE-NG來講,至關於加大物理磁盤容量

 

EVE-NG關機後編輯EVE-NG虛擬機

 

注意:沒法擴展具備快照的虛擬機中的磁盤,必須刪除快照。

wKiom1kjmE6Q_iJTAABG8bKVQM4005.png-wh_50


點擊擴展

wKioL1kjmE7y9S9-AADrIqmfgIM294.png-wh_50


填寫磁盤大小,點擴展

wKiom1kjmE-yA5XiAAA2QrEBkm4522.png-wh_50


等待完成擴展

wKiom1kjmFCBmhJpAAFPef-Jx1w359.png-wh_50



3、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 62912511 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): 3

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

#sda3start sector,該值是sda2end sector +1

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

 

# 因爲sda1sda2中間的一些sector沒有使用,因此First sector提示的default999424

 

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:~#

 

 

好啦,擴容完成!各位,隨意上傳鏡像吧,鏡像再多也不怕!



EmulatedLab QQ羣,期待您的加入!

關注微信公衆號EmulatedLab,及時獲取更新文章和下載連接!


本篇於2017-04-14在微信公衆號EmulatedLab上發表

Maosen | 森

相關文章
相關標籤/搜索