Zhigang Wang
  • Home
  • Blog
  • Wiki
  • LDP
  • Planet

Using partprobe to avoid reboot after re-partitioning

Last modified on 2009-12-01

In my memory, the Linux kernel only reads partition table information at system initialization. So it needs reboot to get the new partition table info after re-partitioning. Until I see partprobe recently, I change my mind.

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. That means, disk re-partitioning now can be handled "on-the-fly".

After re-partitioning you disk with fdisk/parted, just type:

# partprobe
or:
# partprobe [device_node]
is enough. Nothing could be more simple.

PS: if no partition of the disk is mounted, use:

# blockdev --rereadpt [device_node]
can do the job as well.

Reference

  1. GNU Parted official web.
  2. Man page of partprobe.
  3. Man page of blockdev.
 

Categories

  • All contents
  • English contents
  • Chinese contents

Feeds

  • AtomAll contents
  • AtomEnglish contents
  • AtomChinese contents

Tags

  • gtd
  • syslog
  • twiki
  • virtualizaion
  • wiki
  • xen

Copyright © 2012 Zhigang Wang. Some right reserved.

The views expressed on this web site are my own and do not necessarily reflect the views of Oracle.