[root@MyVPS ~]# fdisk -l Disk /dev/xvda: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/xvda1 * 1 13 104391 83 Linux /dev/xvda2 14 1044 8281507+ 8e Linux LVM Disk /dev/xvdb: 23.6 GB, 23622320128 bytes 255 heads, 63 sectors/track, 2871 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System
1、对/dev/xvdb(此名称因系统而异)进行分区:
1 2 3 4 5 6 7
[root@MyVPS ~]# fdisk /dev/xvdb The number of cylinders for this disk is set to 2871. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: a. software that runs at boot time (e.g., old versions of LILO) b. booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)
2、输入n新建分区
1 2 3 4
Command (m forhelp): n Command action e extended p primary partition (1-4)
3、选择/dev/xvdb中第1个分区
1 2 3 4 5
Partition number (1-4): 1 First cylinder (1-2871, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-2871, default 2871): Using default value 2871
4、输入W保存退出
1 2 3 4
Command (m forhelp): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
[root@MyVPS ~]# mkfs -t ext3 /dev/xvdb1 mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 2883584 inodes, 5765319 blocks 288265 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 16384 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 24 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.