[root@pg1 ~]# fdisk /dev/hdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. The number of cylinders for this disk is set to6241. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk andexit x extra functionality (experts only) Command (m for help): p ---查看分区情况 Disk /dev/hdb: 3221 MB, 3221225472 bytes 16 heads, 63 sectors/track, 6241 cylinders Units = cylinders of1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System Command (m for help): n Command action e extended p primary partition (1-4) ----选择主分区 p Partition number (1-4): 3----选择分区编号 First cylinder (1-6241, default1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-6241, default6241): +2048M ----选择大小,我这里设置成2G Command (m for help): p Disk /dev/hdb: 3221 MB, 3221225472 bytes 16 heads, 63 sectors/track, 6241 cylinders Units = cylinders of1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System /dev/hdb3 139692000344+ 83 Linux Command (m for help): w ----写入分区表The partition table has been altered! Calling ioctl() to re-read partition table. 4 格式化分区,设置成 ext3 格式 [root@pg1 ~]# mkfs -t ext3 /dev/hdb3 mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 250368 inodes, 500086 blocks 25004 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=515899392 16block groups 32768 blocks per group, 32768 fragments per group 15648 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 25 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
5 挂载
1
[root@pg1 ~]# mount -t ext3 /dev/hdb3 /archive/pga