Linux下硬盘格式化的相关命令Partprobe

[root@db ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 253981.

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)

Command (m for help): p

Disk /dev/sdb: 2089.0 GB, 2089072092672 bytes

255 heads, 63 sectors/track, 253981 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1      124495  1000006056   83  Linux

Command (m for help): n

Command action

e   extended

p   primary partition (1-4)

p

Partition number (1-4): 2

First cylinder (124496-253981, default 124496):

Using default value 124496

Last cylinder or +size or +sizeM or +sizeK (124496-253981, default 253981):

Using default value 253981

Command (m for help): p

Disk /dev/sdb: 2089.0 GB, 2089072092672 bytes

255 heads, 63 sectors/track, 253981 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1      124495  1000006056   83  Linux

/dev/sdb2          124496      253981  1040096295   83  Linux

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

此时,分区里看不到新建的磁盘分区,提示通过重启才可以重用分区表,此时可以通过partprobe探测硬盘:

[root@db ~]# ls -al /dev/sdb*

brw-rw----  1 root disk 8, 16 Jun 25 04:40 /dev/sdb

brw-rw----  1 root disk 8, 17 Jun 29 22:07 /dev/sdb1

[root@db ~]# partprobe

[root@db ~]# ls -al /dev/sdb*

brw-rw----  1 root disk 8, 16 Jun 25 04:40 /dev/sdb

brw-rw----  1 root disk 8, 17 Jun 29 22:07 /dev/sdb1

brw-rw----  1 root disk 8, 18 Jul  2 22:37 /dev/sdb2分区容量:

[root@db ~]# mkfs /dev/sdb2

mke2fs 1.35 (28-Feb-2004)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

130023424 inodes, 260024073 blocks

13001203 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

7936 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

102400000, 214990848

Writing inode tables: 4076/7936

.done

Writing superblocks and filesystem accounting information:

.done

This filesystem will be automatically checked every 20 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

此时可以正常使用该磁盘分区了。

[root@db ~]# sfdisk -l /dev/sdb

Disk /dev/sdb: 253981 cylinders, 255 heads, 63 sectors/track

Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start     End   #cyls    #blocks   Id  System

/dev/sdb1          0+ 124494  124495- 1000006056   83  Linux

/dev/sdb2     124495  253980  129486  1040096295   83  Linux

/dev/sdb3          0       -       0          0    0  Empty

/dev/sdb4          0       -       0          0    0  Empty

By eygle on 2010-07-28 10:30 |

Comments (7) |

System | 2570 |

7 Comments

盖老大,这个文章,的确是在给凑数,对吧?

呵呵。

partprobe就这个值得一提,但sfidsk -l 这个用到人很少,一般都是fdisk -l或者parted .. print(和fdisk分出来的分区不兼容显示)。

有很多知识,我也是初学者,就记录一下。

然而这些简单过程里面涵盖的东西,我以为是不能忽视的,比如:

Maximum filesystem blocks=4294967296

7936 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

这些信息非常重要,在最近的恢复中,我们用到了很多这方面的知识。

磁盘分区虽然很简单,但是有个disk align的问题还是要注意一下:在IO频繁的硬盘上,是否有disk align据测试能导致10%左右的IO性能差距。

thanks coolzsb

以前真不知道,找到一点说明:

Microsoft engineers have shown again-&-again that disk alignment can improves performance by not merely the nominal 10 – 15% in RAID systems claimed in official documentation, but commonly 20%, 30%, or more.

微软的信息:

http://msdn.microsoft.com/en-us/library/dd758814%28SQL.100%29.aspx

有其他的介绍么?

To eygle

看Vmware的文档吧,有够详细了

http://www.vmware.com/pdf/esx3_partition_align.pdf

disk align 的确需要注意,一个关于磁盘优化的亮点, 学习了,感谢各位同仁。

下面这两个命令,可以进行查看已经格式化后的文件系统的相关情况

tune2fs -l /dev/sda1 | grep Block

dumpe2fs /dev/sda1

oracle 格式化命令,Linux下硬盘格式化的相关命令Partprobe相关推荐

  1. linux下tar命令解压缩,tar解压缩命令 Linux下的tar压缩解压缩命令详解

    <tar解压缩命令 Linux下的tar压缩解压缩命令详解>由会员分享,可在线阅读,更多相关<tar解压缩命令 Linux下的tar压缩解压缩命令详解(14页珍藏版)>请在人人 ...

  2. linux下常见的网络相关命令

    linux中环境部署.网络排查要用到非常多的命令,掌握一些核心的相关命令非常有必要.下面介绍几个工作和面试中高频提及的网络相关命令. ifconfig ifconfig 是一个用来查看.配置.启用或禁 ...

  3. 压缩加压 linux 命令,linux下tar加压、压缩命令

    linux下tar加压.压缩命令 参数: -c :建立一个压缩文件的参数指令(create 的意思): -x :解开一个压缩文件的参数指令! -t :查看 tarfile 里面的文件! 注意:在参数下 ...

  4. linux实验二目录与文件查看相关命令,Linux文件和目录管理相关命令(二)

    今天小编将继续为大家带来Linux文件和目录管理相关命令的文章,想要做Linux运维工程师的小伙伴,来看一看,希望能对你有帮助哦~ 一 查看文件内容 上面提到的一些命令例如ls只是用来显示文件的属性与 ...

  5. linux添加源ip路由命令,linux添加ip、路由相关命令

    1- Linux添加永久路由 vi /etc/sysconfig/network-scripts/route-eth1 ADDRESS0=192.168.10.0 NETMASK0=255.255.2 ...

  6. linux下tomcat服务的相关命令

    2019独角兽企业重金招聘Python工程师标准>>> 一:Linux下tomcat服务的启动.关闭与错误跟踪,使用PuTTy远程连接到服务器以后,通常通过以下几种方式启动关闭tom ...

  7. linux下面ps命令,Linux下修改后的ps命令,很好很强大!

    今天在linux下写了个小程序,功能是:利用ps来查找包含当前字符串的所有命令,有时候会得到很多搜索结果,而且由于每个命令附带的参数很长,导致很乱很难以分清楚,下面这个程序会将匹配得到的结果每隔一行输 ...

  8. linux下的rar命令,Linux下的压缩解压命令

    1. Linux zip命令 压缩 zip -r filename.zip ./*                  // 将当前目录下的所有文件和文件夹全部压缩成 filename.zip文件 -r ...

  9. linux smartctl 命令,Linux下硬盘检测工具smartmontools(smartctl)使用方法

    安装: yum install smartmontools help: #smartctl –help smartctl version 5.38 [i686-redhat-linux-gnu] Co ...

最新文章

  1. 计算机组成原理与系统结构---内存编址方法
  2. CUBRID学习笔记 1 简介 cubrid教程
  3. 【Android 应用开发】BluetoothServerSocket详解
  4. C#中ArrayList的简单使用
  5. Quick BI助力云上大数据分析---深圳云栖大会 1
  6. 300+队伍/8大直播间,这场NXP智能车竞赛谁才是真的神车?
  7. osg着色语言着色_探索数字着色
  8. 好老婆的作息时间(做女人真悲哀 ……)
  9. siege4安装和使用介绍
  10. js几种数组排序及sort的实现
  11. disBalancer(DDOS)将于4月15日在DuckSTARTER进行IDO
  12. [转]如何:定义和处理 SOAP 标头
  13. 计算机辅助翻译术语PPT,计算机辅助翻译
  14. JS:Falsy Bouncer(过滤数组假值)
  15. 天载杠杆炒股A股三大指数团体高开
  16. centos7安装Mysql8.0步骤
  17. 第3课 弹性之城--故事卡--跟阿西莫夫故事接龙
  18. TCP/IP协议栈Lwip的设计与实现:之三
  19. 租用国内的云主机的话,阿里云和盛大云,哪个更好?
  20. svm松弛变量与惩罚因子

热门文章

  1. Java面试题:MySQL
  2. 联发科业绩预估反映OPPO和vivo的手机销量不佳
  3. flutter 代码混淆
  4. 分享166个HTML医疗保健模板,总有一款适合您
  5. 海盐高级中学2021高考成绩查询,出来啦!海盐的高考状元是她!海盐高考成绩、普高录取结果出炉!...
  6. 【CodeSmith】The System.Data.SQLite library is not installed on this computer,不能使用SQLite解决办法
  7. python常用的程序调试方法_Python调试的几种方式
  8. c 语言文件写入,c语言文件的读取和写入
  9. C语言文件操作函数fwrite导致写入文件的内容乱码的问题解决方案
  10. 使用Navicat进行ssh通道连接MySQL数据库