ESXI4.1 linux虚拟机调整扩充磁盘大小

ESXI4.1 linux虚拟机调整扩充磁盘大小

首先调整磁盘大小为60G  www.2cto.com

注意: 如果虚拟机做快照是无法调节置备大小的,要先删除快照才能调整

点确定后,重启虚拟机OS

[root@download1 ~] shutdown -r now

[root@download1 ~]fdisk -l

Disk /dev/sda: 64.4 GB, 64424509440 bytes

255 heads, 63 sectors/track, 7832 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14        2610    20860402+  8e  Linux LVM

[root@download1 ~]# df -hl

文件系统              容量  已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

19G   12G  6.4G  64% /

/dev/sda1              99M   20M   75M  21% /boot

tmpfs                 2.0G     0  2.0G   0% /dev/shm

[root@download1 ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 7832.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n

Command action

e   extended

p   primary partition (1-4)

p

Partition number (1-4): 3

First cylinder (2611-7832, default 2611): 默认回车

Using default value 2611

Last cylinder or +size or +sizeM or +sizeK (2611-7832, default 7832):默认回车

Using default value 7832

Command (m for help): t

Partition number (1-4): 3

Hex code (type L to list codes): 8e

Changed system type of partition 3 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/sda: 64.4 GB, 64424509440 bytes

255 heads, 63 sectors/track, 7832 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14        2610    20860402+  8e  Linux LVM

/dev/sda3            2611        7832    41945715   8e  Linux LVM

Command (m for help): w      保存退出

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

重启虚拟机OS

[root@download1 ~]# shutdown -r now

[root@download1 ~]fdisk -l

Disk /dev/sda: 64.4 GB, 64424509440 bytes

255 heads, 63 sectors/track, 7832 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14        2610    20860402+  8e  Linux LVM

/dev/sda3            2611        7832    41945715   8e  Linux LVM

[root@download1 ~]# df -hl

文件系统              容量  已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

19G   12G  6.4G  64% /

/dev/sda1              99M   20M   75M  21% /boot

tmpfs                 2.0G     0  2.0G   0% /dev/shm

[root@download1 ~]# df -T /dev/sda1

文件系统      类型     1K-块        已用     可用 已用% 挂载点

/dev/sda1     ext3      101086     19487     76380  21% /boot

格式化/dev/sda3

[root@download1 ~]# mkfs.ext3 /dev/sda3

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

5248992 inodes, 10486428 blocks

524321 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

321 block groups

32768 blocks per group, 32768 fragments per group

16352 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 28 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

创建PV

[root@download1 ~]# pvcreate /dev/sda3

Physical volume "/dev/sda3" successfully created

查看PV状态

[root@download1 ~]# pvdisplay

/dev/hdc: open failed: 找不到介质

--- Physical volume ---

PV Name               /dev/sda2

VG Name               VolGroup00

PV Size               19.89 GB / not usable 19.49 MB

Allocatable           yes (but full)

PE Size (KByte)       32768

Total PE              636

Free PE               0

Allocated PE          636

PV UUID               KjvMTJ-8laN-yuwe-N0oA-jtsF-Z0oc-CnzOUX

"/dev/sda3" is a new physical volume of "40.00 GB"

--- NEW Physical volume ---

PV Name               /dev/sda3

VG Name

PV Size               40.00 GB

Allocatable           NO

PE Size (KByte)       0

Total PE              0

Free PE               0

Allocated PE          0

PV UUID               J9yLqC-vpK8-jiwd-5STl-kbRT-BGMg-UB6uPk

[root@download1 ~]# vgdisplay

/dev/hdc: open failed: 找不到介质

--- Volume group ---

VG Name               VolGroup00

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               19.88 GB

PE Size               32.00 MB

Total PE              636

Alloc PE / Size       636 / 19.88 GB

Free  PE / Size       0 / 0

VG UUID               V6H9Dr-e1mb-7E3v-uEgv-UyYX-da9Q-fD8VVp

刚创建的PV加入相应的VG

[root@download1 ~]# vgextend VolGroup00 /dev/sda3

/dev/hdc: open failed: 找不到介质

Volume group "VolGroup00" successfully extended

[root@download1 ~]# vgdisplay

/dev/hdc: open failed: 找不到介质

--- Volume group ---

VG Name               VolGroup00

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               59.88 GB

PE Size               32.00 MB

Total PE              1916

Alloc PE / Size       636 / 19.88 GB

Free  PE / Size       1280 / 40.00 GB

VG UUID               V6H9Dr-e1mb-7E3v-uEgv-UyYX-da9Q-fD8VVp

查看LV状态

[root@download1 ~]# lvdisplay

/dev/hdc: open failed: 找不到介质

--- Logical volume ---

LV Name                /dev/VolGroup00/LogVol00

VG Name                VolGroup00

LV UUID                sSmNj2-Gw4B-hYE2-9nUw-ybJV-6Yxa-DU4VJt

LV Write Access        read/write

LV Status              available

# open                 1

LV Size                19.12 GB

Current LE             612

Segments               1

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           253:0

--- Logical volume ---

LV Name                /dev/VolGroup00/LogVol01

VG Name                VolGroup00

LV UUID                LIrXiG-3IiO-LhjI-o3yN-vI5T-Yamm-FxD31j

LV Write Access        read/write

LV Status              available

# open                 1

LV Size                768.00 MB

Current LE             24

Segments               1

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           253:1

=========================================================

[root@download1 ~]# lvextend -l +2559 /dev/VolGroup00/   勿回车

LogVol00  LogVol01

注意!不知道选哪个,通过以下命令获取可以得到

[root@download1 ~]# df -hl

文件系统              容量  已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

19G   12G  6.4G  64% /

/dev/sda1              99M   20M   75M  21% /boot

tmpfs                 2.0G     0  2.0G   0% /dev/shm

=========================================================

为/dev/VolGroup00/LogVol00增加容量

[root@download1 ~]# lvextend -l +2559 /dev/VolGroup00/LogVol00

/dev/hdc: open failed: 找不到介质

Extending logical volume LogVol00 to 99.09 GB

Insufficient free space: 2559 extents needed, but only 1280 available

[root@download1 ~]# lvextend -l +1280 /dev/VolGroup00/LogVol00

/dev/hdc: open failed: 找不到介质

Extending logical volume LogVol00 to 59.12 GB

Logical volume LogVol00 successfully resized

用 resize2fs 调整文件系统大小

[root@download1 ~]# resize2fs /dev/mapper/VolGroup00-LogVol00

resize2fs 1.39 (29-May-2006)

Filesystem at /dev/mapper/VolGroup00-LogVol00 is mounted on /; on-line resizing required

Performing an on-line resize of /dev/mapper/VolGroup00-LogVol00 to 15499264 (4k) blocks.

The filesystem on /dev/mapper/VolGroup00-LogVol00 is now 15499264 blocks long.

[root@download1 ~]# df -hl

文件系统              容量  已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

58G   12G   44G  21%    /

/dev/sda1              99M   20M   75M  21% /boot

tmpfs                 2.0G     0  2.0G   0% /dev/shm

esxi增加linux空间,ESXI4.1 linux虚拟机调整扩充磁盘大小相关推荐

  1. esxi增加linux空间,ESXI 4.1 Linux虚拟机调整扩充磁盘大小

    首先调整磁盘大小为60G 点确定后,重启虚拟机OS [root@download1 ~] shutdown -r now [root@download1 ~]fdisk -l Disk /dev/sd ...

  2. 阿里云国际站:阿里云linux扩充磁盘大小常见问题

    阿里云国际站:阿里云linux扩充磁盘大小常见问题 阿里云,全球领先的云计算服务平台,现已支持国际业务,云计算第一平台,云产品解决方案,享多线独享带宽. 将您的业务放心托管给中国最大且最值得信赖的云服 ...

  3. linux大容量硬盘 克隆到小硬盘_磁盘大小不一样,也能快速实现大磁盘克隆到小磁盘!...

    大磁盘克隆到小磁盘免费Windows软件推荐 在对拷磁盘时,你可能知道将小硬盘克隆到较大的磁盘一般是没有问题的.但是,将更大的硬盘克隆到较小的硬盘可能吗?是的,通过功能强大的磁盘克隆软件时,轻轻松松就 ...

  4. 扩充虚拟机文件系统的磁盘空间

    目录 问题描述 扩充思路 扩充步骤 1.查询当前的硬盘空间 2.在虚拟机层面扩展虚拟硬盘的大小 3.开启虚拟机,查看虚拟硬盘空间是否已按照需求进行了扩展 4.新建分区 5.告知系统重新读取分区表信息 ...

  5. linux 可变 大小 磁盘6,Linux下调整磁盘大小后的基于LVM的磁盘扩容

    挂载SAN的分区增加LUN的容量后相应的增加系统分区的容量 虚拟机中的磁盘容量增加后相应的增加系统分区的容量 假设被调整的磁盘是/dev/sda,以lvm安装centos,采用系统默认的分区,系统原有 ...

  6. 虚拟主机 windows linux,虚拟主机用Linux的好还是windows的好?

    站长们在建网站初大多都会在虚拟主机选择上有很多疑问,我的网站是选用linux虚拟主机还是windows虚拟主机呢?哪个更好呢? 这里天下数据给大家做一下全面的科普. windows空间和linux空间 ...

  7. linux挂载VMFS硬盘,linux – ESX Guest中的硬件磁盘错误,在vmfs支持的驱动器上……这怎么可能?...

    ESX中的guest虚拟机如何找到这样的问题? [ 40.601502] end_request: critical target error,dev sdg,sector 430203456 [ 4 ...

  8. virtualbox主机网络管理 未能创建_如何在 VirtualBox 中增加现有虚拟机的磁盘大小 | Linux 中国...

    导读:你可以在 VirtualBox 中扩大虚拟硬盘,即使在创建之后也可以. 本文字数:1434,阅读时长大约:2分钟https://linux.cn/article-12869-1.html作者:D ...

  9. linux centos7如何格式化磁盘,Linux CentOS 7 磁盘格式化mke2fs、mkfs.ext4、磁盘挂载及手动增加swap空间...

    一. 磁盘格式化 查看系统支持的分区类型: cat /etc/filesystems[root@fxq-1 ~]# cat /etc/filesystems xfs ext4 ext3 ext2 no ...

最新文章

  1. 百度翻译接口测试(2)
  2. java timer暂停继续_JavaScript暂停和继续定时器的实现方法
  3. 多生产者-多消费者问题
  4. C#阻止计算机关闭显示器和待机
  5. 基于JAVA+SpringBoot+Mybatis+MYSQL的疫情信息管理系统
  6. python实现柱状图_python3+PyQt5实现柱状图
  7. SpringBoot 整合 JPA
  8. php ftp上传文件 源码,PHP FTP上传文件
  9. 用数据全方位解读《欢乐颂2》
  10. Zotero 使用技巧
  11. php apache 假死,解决apache兼容性及慢或假死问题
  12. win10家庭版优化
  13. 网络协议学习笔记 · 22
  14. Selenium4新特性-关联定位策略
  15. matlab火箭升空,火箭升空原理
  16. LCD fb driver for linux 参数计算
  17. java url地址不变_页面跳转后,浏览器地址栏地址保持不变
  18. 如何在WordPress中使用Distraction Free全屏编辑器
  19. Android OpenGL+Camera2渲染(3) —— 大眼,贴纸功能实现
  20. optional说明

热门文章

  1. 老乡鸡上市获反馈:毛利率持续下降,多次被罚,食品安全隐患凸显
  2. 匠人精神打磨六年 “中国制造” Hubble自然走向AI-Native数据库
  3. 安卓反编译就这么简单
  4. 深入浅出RxJava(一:基础篇)
  5. EMC VNX硬盘存储硬盘告警
  6. html ap div,AP DIV 在哪里, 如何添加? AP DIV 的运用 / 布局 在哪里?
  7. nexus5 android 7.0,Android 7.0 Nougat正式版刷机教程—nexus5X
  8. python循环1000次_python循环
  9. PX4模块设计之三十八:Navigator模块
  10. 携程App网络服务通道治理和性能优化@2016