centos6.4 分区挂载

1、# fdisk -l   查看磁盘信息,如下:
Disk /dev/sda: 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: 0x000b2584

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          39      307200   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              39         788     6016000   83  Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3             788        1045     2064384   82  Linux swap / Solaris

2、# fdisk /dev/sda  硬盘分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 
First cylinder (1-112401, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-182401, default 112401):
Using default value 112401
Command (m for help): w
The partition table has been altered!
3、# mkfs -t ext4 -c /dev/sda4
对分区使用ext4格式化     -c参数要先检测磁盘坏道,需要注意,有事会有如下异常:
The device apparently does not exist; did you specify it correctly?
有人说通过执行 partprobe  可解决,但是本人过尝试不行,reboot 之后再次格式化 ok  !
[root@localhost ~]# mkfs -t ext4 -c /dev/sda4
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
786432 inodes, 3144054 blocks
157202 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3221225472
96 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Checking for bad blocks (read-only test): done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

4、# mount -t ext4 /dev/sda4 /usr/local    挂载新硬盘

5、# vi /etc/fstab   加入一行:
/dev/sda4               /usr/local              ext4    defaults        0 0




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值