[root@tangtang tmp]# fdisk -l
Disk /dev/vda:107.4GB,107374182400 bytes,209715200 sectors
Units = sectors of1*512=512 bytes
Sector size(logical/physical):512 bytes /512 bytes
I/Osize(minimum/optimal):512 bytes /512 bytes
Disk label type: dos
Disk identifier:0x000ad887
Device Boot Start End Blocks Id System
/dev/vda1 *20482099199104857683 Linux
/dev/vda2 20992002097151994361608e Linux LVM
1.2 增加新分区 /dev/vda3 ,格式为 LVM
[root@tangtang tmp]# fdisk /dev/vda
Welcome to fdisk(util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Command(m for help): n
Partition type:
p primary(2 primary,0 extended,2 free)
e extended
Select(default p):
Using default response p
Partition number(3,4,default3):
First sector(20971520-209715199,default20971520):
Using default value 20971520
Last sector,+sectors or +size{K,M,G}(20971520-209715199,default209715199):+10G
Partition 3of type Linux and of size 10 GiB is setCommand(m for help): t
Partition number(1-3,default3):3
Hex code(type L to list all codes):L8AIX4e QNX4.x 2nd part 8e Linux LVM df BootIt
Hex code(type L to list all codes):8e
Changed type of partition 'Linux' to '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: Device or resource busy.
The kernel still uses the old table. The newtable will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
1.3 进行新增分区查看
[root@tangtang tmp]# fdisk -l
Disk /dev/vda:107.4GB,107374182400 bytes,209715200 sectors
Units = sectors of1*512=512 bytes
Sector size(logical/physical):512 bytes /512 bytes
I/Osize(minimum/optimal):512 bytes /512 bytes
Disk label type: dos
Disk identifier:0x000ad887
Device Boot Start End Blocks Id System
/dev/vda1 *20482099199104857683 Linux
/dev/vda2 20992002097151994361608e Linux LVM/dev/vda3 2097152041943039104857608e Linux LVM
1.4 通知内核,重读分区
[root@tangtang tmp]# partx -a /dev/vda
partx:/dev/vda: error adding partitions 1-2[root@tangtang tmp]# partx -a /dev/vda
partx:/dev/vda: error adding partitions 1-3
1.5 对新增分区进行文件系统部署
[root@tangtang tmp]# mkfs.ext4 /dev/vda3
mke2fs 1.42.9(28-Dec-2013)
Filesystem label=OS type: Linux
Block size=4096(log=2)
Fragment size=4096(log=2)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes,2621440 blocks
131072blocks(5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=215167795280 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
Allocating group tables: done
Writing inode tables: done
Creating journal(32768 blocks): done
Writing superblocks and filesystem accounting information: done
1.6 对新增分区进行挂载使用
[root@tangtang tmp]# mount /dev/vda3 /tangtang/[root@tangtang tmp]# cd /tangtang/[root@tangtang tangtang]# ll
total 16
drwx------2 root root 16384 Oct 3110:51 lost+found # 显示此目录,说明挂载成功