磁盘及分区管理

  1. 查看磁盘设备列表命令fdisk

【命令格式】

fdisk [option] device

【常用选项】

l:列出当前系统中的磁盘设备及分区详情。

提示:在Linux系统中,所有的设备都被放置在/dev/中。对于磁盘等存储设备而言,sd通常表示SCSI磁盘、SATA磁盘、U盘等设备,hd通常表示IDE设备。而软驱通常使用fd表示,光驱则使用hdc或cdrom表示。

  1. 查看磁盘设备命令hdparm

hdparm命令主要用于查看IDE硬盘的工作参数。

【命令格式】

hdparm [option] device

【常用选项】

I:显示硬盘提供的硬件信息。

T:评估硬盘从快速缓存(cache)中读取数据的速度。

t:评估硬盘从缓冲区(buffer)中读取数据的速度。

【用法示例】

(1)查看硬盘提供的硬件信息:

[root@localhost test]# hdparm -I /dev/hda

 

注意:hdparm命令的大多数用法都只能用于IDE硬盘。

(2)hdparm最常见的用法是评估硬盘的性能(此用法适用于IDE硬盘、SCSI硬盘及RAID设备等):

[root@localhost test]# hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   3180 MB in  2.00 seconds = 1591.13 MB/sec
 Timing buffered disk reads:   30 MB in  3.22 seconds =   9.32 MB/sec

 

  1. 磁盘分区工具fdisk
[root@localhost test]# fdisk /dev/sda

The number of cylinders for this disk is set to 1958.
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):

按m会出现详细的提示信息,按照提示信息操作即可。

使用fdisk执行完分区工作后,有时内核会无法识别新添加的分区,这个问题主要存在于一些移动硬盘、U盘等移动存储设备及较早的发行版中。主要现象是设备目录/dev中,没有相应的分区文件或分区文件不完全等。这时可以使用命令partprobe,让内核重新读取分区表。

[root@localhost test]# partprobe
posted @ 2013-12-10 17:44  ITtecman  阅读(359)  评论(0编辑  收藏  举报