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): n //输入n Command action e extended p primary partition (1-4) p//主分区 Partition number (1-4): 1 //分区号1 First cylinder (1-3230, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-3230, default 3230): Using default value 3230
Command (m for help): wq //保存并退出 The partition table has been altered!
复制代码代码如下: [root@iZ94zz3wqciZ ~]# mkfs.ext4 /dev/xvdb1 //格式化分区 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 1441792 inodes, 5765543 blocks 288277 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 176 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000
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): d //删除分区 Selected partition 1
Command (m for help): wq //保存 The partition table has been altered!
2,安装lvm
复制代码代码如下: [root@iZ94zz3wqciZ nginx]# uname -a //查看内核信息 Linux iZ94zz3wqciZ 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
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): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-2871, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-2871, default 2871): Using default value 2871
复制代码代码如下: [root@iZ94zz3wqciZ ~]# mkfs.ext4 /dev/myfiles/fastdfs//格式化逻辑卷 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 1441792 inodes, 5764096 blocks 288204 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 176 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000
[root@iZ94zz3wqciZ ~]# pvcreate /dev/xvdc1 //创建物理卷 Physical volume "/dev/xvdc1" successfully created
[root@iZ94zz3wqciZ ~]# vgextend myfiles /dev/xvdc1//将新硬盘加入卷组 Volume group "myfiles" successfully extended
[root@iZ94zz3wqciZ ~]# vgdisplay myfiles | grep "Total PE"//查看所有PE Total PE6907
[root@iZ94zz3wqciZ ~]# lvresize -l 6907 /dev/myfiles/fastdfs//重新规定大小 Size of logical volume myfiles/fastdfs changed from 21.99 GiB (5629 extents) to 26.98 GiB (6907 extents). Logical volume fastdfs successfully resized
[root@iZ94zz3wqciZ ~]# resize2fs /dev/myfiles/fastdfs//重新规定大小 resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/myfiles/fastdfs is mounted on /mnt/fastdfs; on-line resizing required old desc_blocks = 2, new_desc_blocks = 2 Performing an on-line resize of /dev/myfiles/fastdfs to 7072768 (4k) blocks. The filesystem on /dev/myfiles/fastdfs is now 7072768 blocks long.