zoukankan      html  css  js  c++  java
  • ZJ 虚拟机扩直接扩原磁盘

    <pre name="code" class="sql">pay:/root# fdisk -l
    
    Disk /dev/sda: 10.7 GB, 10737418240 bytes
    64 heads, 32 sectors/track, 10240 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0002b1a2
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           2         201      204800   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2             202       10201    10240000   8e  Linux LVM
    Partition 2 does not end on cylinder boundary.
    
    
    
    Disk /dev/mapper/vg00-lv_root: 8321 MB, 8321499136 bytes
    255 heads, 63 sectors/track, 1011 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/mapper/vg00-lv_swap: 2147 MB, 2147483648 bytes
    255 heads, 63 sectors/track, 261 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    pay:/root# df -h
    Filesystem                Size  Used Avail Use% Mounted on
    /dev/mapper/vg00-lv_root  7.7G  1.9G  5.4G  26% /
    tmpfs                     246M     0  246M   0% /dev/shm
    /dev/sda1                 194M   29M  155M  16% /boot
    
    
    添加磁盘后:
    pay:/root# fdisk -l
    
    Disk /dev/sda: 53.7 GB, 53687091200 bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0002b1a2
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           2         201      204800   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2             202       10201    10240000   8e  Linux LVM
    Partition 2 does not end on cylinder boundary.
    
    Disk /dev/mapper/vg00-lv_root: 8321 MB, 8321499136 bytes
    255 heads, 63 sectors/track, 1011 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/mapper/vg00-lv_swap: 2147 MB, 2147483648 bytes
    255 heads, 63 sectors/track, 261 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
     新加的磁盘从10202 开始到51200 
    
    
    pay:/root# fdisk /dev/sda
    
    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
             switch off the mode (command 'c') and change display units to
             sectors (command 'u').
    
    Command (m for help): p
    
    Disk /dev/sda: 53.7 GB, 53687091200 bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0002b1a2
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           2         201      204800   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2             202       10201    10240000   8e  Linux LVM
    Partition 2 does not end on cylinder boundary.
    
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    3
    Invalid partition number for type `3'
    Command action
       e   extended
       p   primary partition (1-4)
    ^C
    pay:/root# fdisk /dev/sda
    
    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
             switch off the mode (command 'c') and change display units to
             sectors (command 'u').
    
    Command (m for help): p
    
    Disk /dev/sda: 53.7 GB, 53687091200 bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0002b1a2
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           2         201      204800   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2             202       10201    10240000   8e  Linux LVM
    Partition 2 does not end on cylinder boundary.
    
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 3
    First cylinder (1-51200, default 1): 10202
    Last cylinder, +cylinders or +size{K,M,G} (10202-51200, default 51200): 
    Using default value 51200
    
    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 or after you run partprobe(8) or kpartx(8)
    Syncing disks.
    
    
    
    
    pay:/root# fdisk -l
    
    Disk /dev/sda: 53.7 GB, 53687091200 bytes
    64 heads, 32 sectors/track, 51200 cylinders
    Units = cylinders of 2048 * 512 = 1048576 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0002b1a2
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           2         201      204800   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2             202       10201    10240000   8e  Linux LVM
    Partition 2 does not end on cylinder boundary.
    /dev/sda3           10202       51200    41982976   83  Linux
    
    Disk /dev/mapper/vg00-lv_root: 8321 MB, 8321499136 bytes
    255 heads, 63 sectors/track, 1011 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/mapper/vg00-lv_swap: 2147 MB, 2147483648 bytes
    255 heads, 63 sectors/track, 261 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    pay:/root# pvcreate /dev/sda3
      Physical volume "/dev/sda3" successfully created
    pay:/root# vgextend vg00 /dev/sda3
      Volume group "vg00" successfully extended
    pay:/root#  lvextend -L +30G /dev/mapper/vg00-lv_root 
      Extending logical volume lv_root to 37.75 GiB
      Logical volume lv_root successfully resized
    pay:/root#  resize2fs  /dev/mapper/vg00-lv_root 
    resize2fs 1.41.12 (17-May-2010)
    Filesystem at /dev/mapper/vg00-lv_root is mounted on /; on-line resizing required
    old desc_blocks = 1, new_desc_blocks = 3
    Performing an on-line resize of /dev/mapper/vg00-lv_root to 9895936 (4k) blocks.
    The filesystem on /dev/mapper/vg00-lv_root is now 9895936 blocks long.
    
    pay:/root# df -h
    Filesystem                Size  Used Avail Use% Mounted on
    /dev/mapper/vg00-lv_root   38G  1.9G   34G   6% /
    tmpfs                     246M     0  246M   0% /dev/shm
    /dev/sda1                 194M   29M  155M  16% /boo


    
                                        
    
  • 相关阅读:
    webstorm11.0下载地址和webstorm11.0破解程序patcher.exe下载使用方法说明 前端IDE工具的利器
    20151224今天发现到的两篇关于CSS架构、可复用可维护CSS和CSS学习提升能有改变思想观念意识的文章 分别是CSS架构目标和说说CSS学习中的瓶颈
    GOF提出的23种设计模式是哪些 设计模式有创建形、行为形、结构形三种类别 常用的Javascript中常用设计模式的其中17种 详解设计模式六大原则
    HTML过滤器,用于去除XSS漏洞隐患。
    springboot的快速集成多数据源的启动器
    Springboot根据url后缀返回json或者xml或者html
    Springboot打包成War包并使其可以部署到Tomcat中直接运行
    数据脱敏工具类(包含手机号,银行卡号,邮箱,中文名称等)
    MySQL函数find_in_set介绍
    防止同一IP多次请求攻击
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351632.html
Copyright © 2011-2022 走看看