[root@zzp 桌面]# ll /dev/sdb*
brw-rw----. 1 root disk 8, 169月 816:38 /dev/sdb
[root@zzp 桌面]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x21b8e569.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m forhelp): 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 unitsv verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m forhelp): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1): 1
Last cylinder, +cylinders or +size{K,M,G}(1-2610, default 2610): +5G
Command (m forhelp): p
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512=8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x21b8e569
Device Boot Start End Blocks Id System
/dev/sdb1 16545253223+ 83 Linux
Command (m forhelp): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@zzp 桌面]#
1.3格式化分区,挂载分区
#######格式化分区[root@zzp 桌面]# mkfs.ext4 /dev/sdb1mke2fs1.41.12 (17-May-2010)
文件系统标签=
操作系统:Linux
块大小=4096(log=2)
分块大小=4096(log=2)Stride=0 blocks, Stripe width=0 blocks
328656 inodes, 1313305 blocks
65665 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=134637158441 block groups32768 blocks per group, 32768 fragments per group
8016 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
This filesystem will be automatically checked every 23 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
#######挂载分区[root@zzp /]# mkdir /sdb1[root@zzp /]# mount dev/sdb1 /sdb1[root@zzp /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 20G 3.8G 15G 21% /
tmpfs 1.9G 224K 1.9G 1% /dev/shm
/dev/sda1 124M 44M 74M 38% /boot
/dev/sr0 3.7G 3.7G 0100% /media/CentOS_6.9_Final
/dev/sdb1 4.9G 11M 4.6G 1% /sdb1