HowTo: Reload (re-read) Partition Table In Ubuntu Linux

How do I reload the partition table in Ubuntu Linux without rebooting the systems?

You need to install the parted package as follows
sudo apt-get update
sudo apt-get install parted

Once installed type the following command to re-read / reload the partition:
sudo partprobe
Finally, use mkfs.ext3 or mkfs.ext4 to create the file systems:
sudo mkfs.ext3 /dev/sdXY
Make sure you replace /dev/sdXY with actual device name and be careful do not type wrong device same. You may end up destroying working data. Please note that on server with RAID and SAS disk you may need to type the following command to rescan changes:
sudo echo 1 > /sys/block/sdd/device/rescan
sudo fdisk -l
sudo mkfs.ext3 /dev/sdXY

Again replace sdd with actual device name. Please note that above commands should work with all Linux distributions.


🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

10 comments… add one
  • Swapneel May 25, 2010 @ 20:44

    Strange, Ubuntu doesn’t come with partprobe by default. RPM based distros like Redhat, Fedora and CentOS have it by default.

  • Nilesh May 27, 2010 @ 4:28

    Not only RPM, even Arch Linux and others if you use the default installation configuration.

    Ubuntu, Debian has always been weird and different from others !! :)^

    One who is used to RPM and others will have a tough time migrating to Debain/Ubuntu and vice-versa as it happened to me, though not migrating. Had to help a friend setup his Ubuntu VPS.

  • Anonymous Jun 2, 2010 @ 0:11

    sudo hdparm -z

  • Mr. Pink Jun 2, 2010 @ 0:14

    sudo hdparm -z
    You linux people have to do everything through the rectum. The more complicated the better.

    • Anders Jun 10, 2010 @ 18:34

      You might want to tell “us” how it should be done.

      • Mr. Pink Oct 3, 2011 @ 0:53

        In the era of multicore multiGHz CPUs, multiGB RAM and multiTB hard drives you would think that Linux could handle it autoFUCKINGmaticaly.
        Can you imagine how many man/hours around the world are wasted on doing this by hand, while system could do it in a fraction of a second. So here. Now I told how it should be done. Do you think it took a lot of brain power? You could probably come up with it on your own, but then again you’re Linux user. It’s all about being a slave to your computer, isn’t it?

        • Anders Oct 4, 2011 @ 3:53

          Sorry, but you still have to tell. HOW to do it without causing any other problem, like losing data.
          What you have done here is just been ranting like you actually know HOW to do this. But you have just told us how you WANT it to be done, not HOW it actually NEEDS to be done, without losing any data.
          But I guess it is easier to produce hot air then actually producing a sollution and/or some real code…

  • mark Oct 22, 2010 @ 10:24


  • xew Mar 24, 2011 @ 11:07

    I don’t think this works :
    sudo echo 1 > /sys/block/sdd/device/rescan

    You have to start a new shell with sudo, like this :
    sudo bash -c “echo 1 > /sys/block/sdd/device/rescan”

    Otherwise only echo is done with sudo permissions. The redirection “>” is done by your current shell which does not have sudo permissions.

  • stv Jun 6, 2016 @ 22:59

    sudo -i

    # locate the scsi_disk

    ll /sys/class/scsi_disk/
    lrwxrwxrwx 1 root root 0 Mar 17 08:03 2:0:0:0 -> ../../devices/pci0000:00/0000:00:10.0/host2/target2:0:0/2:0:0:0/scsi_disk/2:0:0:0
    lrwxrwxrwx 1 root root 0 Mar 17 08:03 2:0:1:0 -> ../../devices/pci0000:00/0000:00:10.0/host2/target2:0:1/2:0:1:0/scsi_disk/2:0:1:0
    lrwxrwxrwx 1 root root 0 Mar 17 08:03 2:0:2:0 -> ../../devices/pci0000:00/0000:00:10.0/host2/target2:0:2/2:0:2:0/scsi_disk/2:0:2:0
    lrwxrwxrwx 1 root root 0 Mar 17 08:03 2:0:3:0 -> ../../devices/pci0000:00/0000:00:10.0/host2/target2:0:3/2:0:3:0/scsi_disk/2:0:3:0

    # In our case we have expanded the last disk (/devices/pci0000:00/0000:00:10.0/host2/target2:0:3/2:0:3:0/scsi_disk/2:0:3:0)
    # rescan the device

    echo 1 > /sys/class/scsi_disk/2\:0\:3\:0/device/rescan

    # create the new partition
    fdisk /dev/sdd
    # type “n”
    # write the partition number. e.g. “2”
    # type “t”
    # On Debian, CentOS 6 etc. is “8e”, on CentOS 7 “15”
    # type “w” to write to disk
    # As we already know write will fail

    # to re-read the partitions properly run partx on the device

    partx -v -a /dev/sdd
    # just for the sake of it
    pvcreate /dev/sdd2

    # add the physical volume to the corresponding volume group
    vgextend mainvg /dev/sdd2

    # confirm the disk has been added
    VG #PV #LV #SN Attr VSize VFree
    mainvg 5 6 0 wz–n- 102.90g 35.07g

    # expand the capacity of the logical volume
    lvextend -L+10G /dev/mainvg/LVopt

    # expand the file system capacity
    xfs_growfs /dev/mainvg/LVopt

    # df -hT to confirm all is done
    df -hT

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.