| 
                        副标题[/!--empirenews.page--]
                        技术沙龙 | 邀您于8月25日与国美/AWS/转转三位专家共同探讨小程序电商实战
             在esx server上安装虚拟机时,由于只分配了默认的8GB磁盘空间。空间不太够,所以在虚拟机上把分配磁盘空间扩大的20GB。在esx server上扩容磁盘空间的方法很简单,在此不提,下面具体说说如何把该扩容的磁盘空间在虚拟机上应用上去。 
  
以下是未扩容前的状态: 
- [root@localhost ~]# fdisk -l 
 -  
 - Disk /dev/sda: 21.4 GB, 21474836480 bytes 
 -  
 - 255 heads, 63 sectors/track, 2610 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        1044     8281507+  8e  Linux LVM 
 -  
 -   
 -  
 - [root@localhost ~]# df -h 
 -  
 - Filesystem            Size  Used Avail Use% Mounted on 
 -  
 - /dev/mapper/VolGroup-LogVol00 
 -  
 -                       7.0G  4.8G  1.8G  73% / 
 -  
 - /dev/sda1              99M   12M   82M  13% /boot 
 -  
 - tmpfs                 187M     0  187M   0% /dev/shm 
 -  
 - /dev/hdc              183M  183M     0 100% /media/VMware Tools 
 
  
可以看到sda有21.4GB,但是只利用了sda1和sda2;根目录挂载在/dev/mapper/VolGroup-LogVol00,我们要做的是,把sda上剩余的空间扩容到/dev/mapper/VolGroup-LogVol00。 
1)首先,通过fdisk /dev/sda命令将sda剩余空间创建一个分区: 
- [root@localhost ~]# fdisk /dev/sda 
 -  
 - The number of cylinders for this disk is set to 2610. 
 -  
 - 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): m 
 -  
 - Command action 
 -  
 -    a   toggle a bootable flag 
 -  
 -    b   edit bsd disklabel 
 -  
 -    c   toggle the dos compatibility flag 
 -  
 -    d   delete a partition 
 -  
 -    l   list known partition types 
 -  
 -    m   print this menu 
 -  
 -    n   add a new partition 
 -  
 -    o   create a new empty DOS partition table 
 -  
 -    p   print the partition table 
 -  
 -    q   quit without saving changes 
 -  
 -    s   create a new empty Sun disklabel 
 -  
 -    t   change a partition's system id 
 -  
 -    u   change display/entry units 
 -  
 -    v   verify the partition table 
 -  
 -    w   write table to disk and exit 
 -  
 -    x   extra functionality (experts only) 
 -  
 - Command (m for help): n 
 -  
 - Command action 
 -  
 -    e   extended 
 -  
 -    p   primary partition (1-4) 
 -  
 - p 
 -  
 - Partition number (1-4): 3 
 -  
 - First cylinder (1045-2610, default 1045): 
 -  
 - Using default value 1045 
 -  
 - Last cylinder or +size or +sizeM or +sizeK (1045-2610, default 2610): 
 -  
 - Using default value 2610 
 -  
 - 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: Device or resource busy. 
 -  
 - The kernel still uses the old table. 
 -  
 - The new table will be used at the next reboot. 
 -  
 - Syncing disks. 
 -  
 - [root@localhost ~]# 
 
  
                                                (编辑:滁州站长网) 
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! 
                     |