I add a new virtual hard drive vdb to the KVM guest(centos6.5),like this
[root@centos ~]# fdisk -l | grep vdb
Disk /dev/vdb: 8589 MB, 8589934592 bytes
Then,there are two ways to format the disk
a.
[root@centos ~]# mkfs.ext4 /dev/vdb
[root@centos ~]# mount /dev/vdb /data/
b.
[root@boss ~]# fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1044, default 1044):
Using default value 1044
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@centos ~]# mkfs.ext4 /dev/vdb1
[root@centos ~]# mount /dev/vdb1 /data/
The above two ways are working ok,but what diff?