把磁盘sdb的容量用了创建一个分区 /dev/sdb1 ,把这个分区挂载到/mnt
有了硬盘,分区,格式化创建文件系统,挂载
第一步:创建分区
fdisk -cu /dev/sdb
Command (m for help): p
Disk /dev/sdb: 106 MB, 106954752 bytes
64 heads, 32 sectors/track, 102 cylinders, total 208896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0c7ada8f
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): 1
First sector (2048-208895, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-208895, default 208895):
Using default value 208895
Command (m for help): p
Disk /dev/sdb: 106 MB, 106954752 bytes
64 heads, 32 sectors/track, 102 cylinders, total 208896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0c7ada8f
Device Boot Start End Blocks Id System
/dev/sdb1 2048 208895 103424 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
第二步:通知系统 /dev/sdb磁盘的分区表修改了 变化了
partprobe /dev/sdb
第三步:格式化创建文件系统
mkfs.ext4 /dev/sdb1
mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
25896 inodes, 103424 blocks
5171 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1992 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
第四步:让系统不对我们新创建的分区 进行磁盘检查
tune2fs -c 0 -i 0 /dev/sdb1
tune2fs 1.41.12 (17-May-2010)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
第五步:挂载 与检查
mount /dev/sdb1 /mnt/
[[email protected] ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 8.8G 1.7G 6.8G 20% /
tmpfs 931M 0 931M 0% /dev/shm
/dev/sda1 190M 40M 141M 22% /boot
/dev/sdb1 94M 1.6M 88M 2% /mnt
第六步:需要永久挂载 开机自动挂载
----挂载命令放入到 /etc/rc.local 文件中
/bin/mount /dev/sdb1 /mnt/