这几天格式化硬盘,记录一下用到的命令:

[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探测硬盘:

本日志由 flyinweb 于 2011-05-27 16:52:56 发表到 Linux 中,目前已经被浏览 1045 次,评论 0 次;

作者添加了以下标签: partprobefdisk

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文