2

I am days before the RHCSA exam and i have noticed i still haven't been able to successfully run partprobe successfully after months on testing and testing and testing..not a single time

I have tried

partprobe

partprobe /dev/sdx

where sdx is the drive name

It never works. I get a warning saying that the kernel failed to re-read the partition table on /dev/sdx (device or resource busy). As a result it may not reflect all of your changes until after reboot

What can i do?

Yes, parted is installed .

dawud
  • 14,918
  • 3
  • 41
  • 61
redhatengineer6
  • 79
  • 2
  • 5
  • 9
  • have you compared the output of "fdisk -l" before & after running partprobe? do you have a log of this? what do you want to achieve, increasing the size of a device without rebooting? – Striker_84 Apr 22 '13 at 12:05
  • fdisk -l does show the new partition but just cannot use the partition until after reboot and i try to use partprobe but it never works – redhatengineer6 Apr 23 '13 at 04:21

3 Answers3

1

before running partprobe make sure all partitions of that disk are unmounted. In case you are using lvm you should also inactivate the volumes on that disk with something like "lvchange -an vgname/lvname" before running partprobe again.

Adrian
  • 21
  • 1
1

Recently ran into this trying to allocate some unused space on a drive, and the following worked for me:

partx -a /dev/sda

It complained about an in-use partition #1, but added the new partition one #2 and I was able to reference it under /dev/sda2 and do a pvcreate on it and to my volume group. This was after the fdisk & partprobe that didn't work as below

# fdisk -l /dev/sda

Disk /dev/sda: 21.5 GB, 21474836480 bytes
224 heads, 19 sectors/track, 9855 cylinders
Units = cylinders of 4256 * 512 = 2179072 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00006917

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          49      102400   83  Linux
/dev/sda2              49        9855    20868016   83  Linux

# partprobe 
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.

# ls /dev/sda*
/dev/sda   /dev/sda1  

# partx -a /dev/sda
BLKPG: Device or resource busy
error adding partition 1

# ls /dev/sda*
/dev/sda  /dev/sda1  /dev/sda2
1

partprobe is unsafe. Red Hat recommends partx. For example,

partx -v -a /dev/sdx

And verify if all partitions created

ll /dev/sdx?
Colt
  • 1,939
  • 6
  • 20
  • 25