转自:http://www.7edown.com/edu/article/soft_48647_1.html

linux上,在安装系统之后,可否创建分区并且在不重新启动机器的情况下系统能够识别这些分区?
解决方法:

你可以使用一个叫做partprobe的工具。它包含在parted的rpm软件包中。在Red Hat Enterprise Linux 3上他的版本是parted-1.6。 partprobe 是一个可以修改kernel中分区表的工具。可以使kernel重新读取分区表。如下命令可以查看你的系统是否安装了parted软件包

复制代码代码如下:
rpm -q parted
举例来说:

复制代码代码如下:
# rpm -q parted
parted-1.6.3-29

你可以使用up2date命令安装这个软件包,如果在你的系统已经正确地注册到RHN上了。否则你可以从光盘上安装这个文件。

你可以使用fdisk或者其他命令创建一个新的分区,然后使用partprobe命令重新读取分区表。

复制代码代码如下:
# partprobe
这个命令执行完毕之后不会输出任何返回信息,你可以使用mke2fs命令在新的分区上创建文件系统。

在Linux中使用fdisk命令进行分区时,有时会遇到“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.”这种告警信息。如下所示

复制代码代码如下:
[root@localhost ~]# fdisk /dev/sde
 
The number of cylinders for this disk is set to 18928.
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/sde: 155.6 GB, 155692564480 bytes
255 heads, 63 sectors/track, 18928 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1       18275   146793906    5  Extended
/dev/sde5               1       18275   146793874+  83  Linux
 
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)

Partition number (1-4): 2
First cylinder (18276-18928, default 18276): 
Using default value 18276
Last cylinder or +size or +sizeM or +sizeK (18276-18928, default 18928): 
Using default value 18928
 
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.
 
此时使用fdisk命令看不到新建的分区信息,可以使用partprobe命令解决这个问题而不用重启系统,因为partprobe可以使kernel重新读取分区信息,从而避免重启系统。

复制代码代码如下: 
partprobe - inform the OS of partition table changes
 
DESCRIPTION
       This manual page documents briefly the partprobe command.
 
       partprobe is a program that informs the operating system kernel of partition table changes, by requesting that the operating system re-read the partition table.

[转]linux之partprobe命令的更多相关文章

  1. Linux 执行partprobe命令时遇到Unable to open /dev/sr0 read-write (Read-only file system)

    在使用fdisk创建分区时,我们会使用partprobe命令可以使kernel重新读取分区信息,从而避免重启系统,但是有时候会遇到下面错误信息"Warning: Unable to open ...

  2. Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令

    分区的过程正常: [root@db1 /]# fdisk -l   Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/tr ...

  3. Linux partprobe命令详解

    partprobe命令 partprobe: 通知系统分区表的变化 常用的命令展示: 查看帮助 [root@localhost omc]# partprobe --help Usage: partpr ...

  4. Linux系统常用命令权威指南

    <一>线上查询及帮助命令(2)1.man man [选项] [命令] 查看命令帮助,命令的词典,更复杂的还有info,但不常用. #man cd-a 显示所有的手册页,不只是显示第一个-f ...

  5. Linux 系统常见命令功能大全_【all】

    Linux常见快捷键(6个) ctrl + u:剪贴光标前面 ctrl + k:剪贴光标后面 ctrl + y:粘贴 ctrl + r:查找命令 ctrl + insert:复制 shift+ ins ...

  6. partprobe命令详解

    基础命令学习目录首页 原文链接:https://www.jb51.net/LINUXjishu/389836.html linux上,在安装系统之后,可否创建分区并且在不重新启动机器的情况下系统能够识 ...

  7. Linux基础之命令练习Day4-fdisk,mkfs,mlabel,mount,umount,mkswap,swapon,dd,top,free,ps,kill,rpm,yum,make

    一. 硬盘分区.格式化及文件系统的管理 1. 在Linux系统中,一切皆文件.每个设备都被当作一个文件来对待. 常见的存储设备在Linux系统中的文件名如下表所示: 2. 对硬盘进行分区有以下优点: ...

  8. Linux下history命令用法

    如果你经常使用 Linux 命令行,那么使用 history(历史)命令可以有效地提升你的效率.本文将通过实例的方式向你介绍 history 命令的 15 个用法. 使用 HISTTIMEFORMAT ...

  9. Linux下ps命令详解 Linux下ps命令的详细使用方法

    http://www.jb51.net/LINUXjishu/56578.html Linux下的ps命令比较常用 Linux下ps命令详解Linux上进程有5种状态:1. 运行(正在运行或在运行队列 ...

随机推荐

  1. 2、Spring的LocalSessionFactoryBean创建过程源码分析

    spring的LocalSessionFactoryBean生成过程与hibernate的SessionFactory生成过程是高度吻合的. 为了后面源码分析,首先讲解一个接口,一个类的功能:①.接口 ...

  2. VMware VMware各版本

    VMware各版本 一.VMware  vSphere5: VMware vSphere5 取代原 VMware ESX 二.VMware ESXI/VMware Citrix/VMware XenS ...

  3. How to write a product backlog step by step

    一般来说,制定发布计划是在尝试回答这个问题:“最晚到什么时候为止,我们可以交付这个新系统的1.0版本“ 下面是验收标准规则的一个例子: 1.  所有重要性>=100的条目都必须在1.0版中发布. ...

  4. linux系统的目录讲解

    还记得在前面介绍c h m o d命令时讲过,目录的权限位和文件有所不同.现在我们来看看其中的区别.目录的读权限位意味着可以列出其中的内容.写权限位意味着可以在该目录中创建文件,如果不希望其他用户在你 ...

  5. 每天一个小算法(Heapsort)

    #include "stdio.h" #include "stdlib.h" #define Num 10 Heap(int arr[],int i,int n ...

  6. [转载]java的几种对象(PO,VO,DAO,BO,POJO)解释

    原文地址:java的几种对象(PO,VO,DAO,BO,POJO)解释作者:munandong 一.PO:persistant object 持久对象,可以看成是与数据库中的表相映射的java对象.最 ...

  7. Qt之模型/视图(自定义进度条)

    简述 在之前的章节中分享过关于QHeaderView表头排序.添加复选框等内容,相信大家模型/视图.自定义风格有了一定的了解,下面我们来分享一个更常用的内容-自定义进度条. 实现方式: 从QAbstr ...

  8. UVa 1587 Box

    题意:给出6个矩形的长和宽,问是否能够构成一个长方体 先假设一个例子 2 3 3 4 2 3 3 4 4 2 4 2 排序后 2 3 2 3 3 4 3 4 4 2 4 2 如果要构成一个长方体的话, ...

  9. USACO全部测试数据

    链接:http://share.weiyun.com/8c37d26066ee9e63147d2af983f24290 密码:YyGL 请使用2345好压解压.

  10. php扩展编译(以memcached为例)

    1)到 https://pecl.php.net/ 上搜索并下载(wget)你需要的扩展的源码包 2)解压并切换进入扩展包的目录 3)使用phpize工具自动生成 configure 4)config ...