增加ubuntu磁盘大小的问题(virtualbox image)

时间:2014-09-09 16:37:27

标签: linux ubuntu size virtualbox disk

我的ubuntu磁盘大小为52.4 GB,但磁盘仍然显示为11G。对下面的任何建议?     root @mubuntu:〜#fdisk -l     ------------     磁盘/ dev / sda:52.4 GB,52428800000字节     255个头,63个扇区/轨道,6374个气缸,总共102400000个扇区     单位= 1 * 512 = 512字节的扇区     扇区大小(逻辑/物理):512字节/ 512字节     I / O大小(最小/最佳):512字节/ 512字节     磁盘标识符:0x000ac38c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          499712      501757        1023   8e  Linux LVM
/dev/sda3          501758    23486463    11492353    5  Extended
/dev/sda5          501760    23486463    11492352   8e  Linux LVM

root@mubuntu:~# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/mubuntu--vg-root   11G  9.5G  161M  99% /
none                          4.0K     0  4.0K   0% /sys/fs/cgroup
udev                          991M  4.0K  991M   1% /dev
tmpfs                         201M  1.1M  200M   1% /run
none                          5.0M     0  5.0M   0% /run/lock
none                         1001M     0 1001M   0% /run/shm
none                          100M     0  100M   0% /run/user
/dev/sda1                     236M   66M  158M  30% /boot

- >以下看起来不错吗?

root@mubuntu:~# pvscan
  PV /dev/sda5   VG mubuntu-vg   lvm2 [10.96 GiB / 0    free]
  Total: 1 [10.96 GiB] / in use: 1 [10.96 GiB] / in no VG: 0 [0   ]

root@mubuntu:~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda5
  VG Name               mubuntu-vg
  PV Size               10.96 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              2805
  Free PE               0
  Allocated PE          2805
  PV UUID               upfW6u-dHEc-0ub9-0FAJ-hmFW-10lK-po2nwS

root@mubuntu:~# vgdisplay
  --- Volume group ---
  VG Name               mubuntu-vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  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                1
  Act PV                1
  VG Size               10.96 GiB
  PE Size               4.00 MiB
  Total PE              2805
  Alloc PE / Size       2805 / 10.96 GiB
  Free  PE / Size       0 / 0   
  VG UUID               v9h4EA-xJbR-vEff-qsEk-AvHE-apfK-1j4YI2

root@mubuntu:~# lvdisplay
  --- Logical volume ---
  LV Path                /dev/mubuntu-vg/root
  LV Name                root
  VG Name                mubuntu-vg
  LV UUID                Os34MI-SJz0-DTPa-2104-xof8-F4Wm-sy0XfM
  LV Write Access        read/write
  LV Creation host, time mubuntu, 2014-08-30 15:51:45 -0500
  LV Status              available
  # open                 1
  LV Size                10.46 GiB
  Current LE             2677
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Path                /dev/mubuntu-vg/swap_1
  LV Name                swap_1
  VG Name                mubuntu-vg
  LV UUID                FmnrhR-7i3c-jMaK-dmqr-OMA3-S3jv-oetzdS
  LV Write Access        read/write
  LV Creation host, time mubuntu, 2014-08-30 15:51:46 -0500
  LV Status              available
  # open                 2
  LV Size                512.00 MiB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

1 个答案:

答案 0 :(得分:0)

每当您将虚拟磁盘设置为虚拟框中的动态分配时,虚拟框不会立即占用所有空间,即在您的情况下,您已设置52.4GB作为虚拟磁盘的大小这是虚拟硬盘的最大大小可以采取。当虚拟盒创建一个动态分配的磁盘时,它的最小大小可能是100KB,但随着虚拟操作系统中的内容开始增加,磁盘增长,并且它会增长到您设置的大小。但无论何时从虚拟操作系统内部检查硬盘大小,它都会显示您设置的最大大小。