1、首先,查看磁盘,fdisk -l
Disk /dev/xvdf: 536.9 GB, 536870912000 bytes, 1048576000 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes
2、进入磁盘,对磁盘进行分区
[root@shap000103262 ~]# fdisk /dev/xvdfWelcome 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.Device does not contain a recognized partition tableBuilding a new DOS disklabel with disk identifier 0x9c0f9ab7.Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): 1First sector (2048-1048575999, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-1048575999, default 1048575999): Using default value 1048575999Partition 1 of type Linux and of size 500 GiB is setCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.
3、格式化分区
[root@shap000103262 ~]# mkfs.ext3 /dev/xvdf1mke2fs 1.42.9 (28-Dec-2013)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks32768000 inodes, 131071744 blocks6553587 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=42949672964000 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done
4、开始挂载分区
mount /dev/xvdf1 /opt/share