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

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

6ee5639a40442445944d63b514b2dd02.png

[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

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值