手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux下如何用fdisk新建分区

[日期:2013-03-14] 来源:51cto  作者:lfgwqc [字体:大 中 小]
[root@bogon 桌面]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (设备或资源忙).  As a result, it may not reflect all of your changes until after reboot.
 
kenel识别分区表后,我们还不能使用它要对其进行格式化。mkfs.加文件系统格式,扩展分区是不能格式化的。
 
[root@bogon 桌面]# mkfs.ext4 /dev/sdb1 #格式化成ext4文件格式(要分区格式化,不能将整个硬盘格式化)
 mke2fs 1.41.12 (17-May-2010)
 文件系统标签=
 操作系统:Linux
 块大小=4096 (log=2)
 分块大小=4096 (log=2)
 Stride=0 blocks, Stripe width=0 blocks
 131648 inodes, 526120 blocks
 26306 blocks (5.00%) reserved for the super user
 第一个数据块=0
 Maximum filesystem blocks=541065216
 17 block groups
 32768 blocks per group, 32768 fragments per group
 7744 inodes per group
 Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912
 
正在写入inode表: 完成                           
Creating journal (16384 blocks): 完成
 Writing superblocks and filesystem accounting information: 完成
 
This filesystem will be automatically checked every 30 mounts or
 180 days, whichever comes first.  Use tune2fs -c or -i to override.
 [root@bogon 桌面]# mkfs.ext4 /dev/sdb5 #格式化逻辑分区
 mke2fs 1.41.12 (17-May-2010)
 文件系统标签=
 操作系统:Linux
 块大小=4096 (log=2)
 分块大小=4096 (log=2)
 Stride=0 blocks, Stripe width=0 blocks
 131648 inodes, 526120 blocks
 26306 blocks (5.00%) reserved for the super user
 第一个数据块=0
 Maximum filesystem blocks=541065216
 17 block groups
 32768 blocks per group, 32768 fragments per group
 7744 inodes per group
 Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912
 
正在写入inode表: 完成                           
Creating journal (16384 blocks): 完成
 Writing superblocks and filesystem accounting information: 完成
 
This filesystem will be automatically checked every 39 mounts or
 180 days, whichever comes first.  Use tune2fs -c or -i to override.
 
格式化后就可以使用了
 
[root@bogon 桌面]# mkdir /bak
 [root@bogon 桌面]# mount -o loop /dev/sdb1 /bak #挂载该分区到/bak
 [root@bogon 桌面]# df -TH #查看当前硬盘挂载信息
 文件系统    类型      容量  已用  可用 已用%% 挂载点
 /dev/sda5    ext4      52G  3.9G    45G  8% /
 tmpfs        tmpfs    528M  279k  528M  1% /dev/shm
 /dev/sda1    ext4    204M    28M  166M  15% /boot
 /dev/sda2    ext4      31G  2.9G    27G  10% /usr
 .host:/    vmhgfs    144G    41G  104G  29% /mnt/hgfs
 /ios/RHEL6.3.iso
            iso9660    3.2G  3.2G      0 100% /guazai
 /dev/sdb1    ext4    2.2G    71M  2.0G  4% /baklinux
相关资讯       fdisk  Linux fdisk分区  linux新建分区  fdisk分区 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款