Partprobe not working

When adding new partition , new partition doesnot showup because failing to re-read partition table. Partprobe command works , if it doesnot work and gives out error as below

[root@jan yum.repos.d]# partprobe /dev/sdb
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sdb (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.

then ,

create a partition and run following comand,

partx -v -a /dev/sdb

[root@jan yum.repos.d]#  partx -v -a /dev/sdb
device /dev/sdb: start 0 size 20971520
gpt: 0 slices
dos: 4 slices
# 1:        63-  4209029 (  4208967 sectors,   2154 MB)
# 2:   4209030-  8418059 (  4209030 sectors,   2155 MB)
# 3:         0-       -1 (        0 sectors,      0 MB)
# 4:         0-       -1 (        0 sectors,      0 MB)
BLKPG: Device or resource busy
error adding partition 1
added partition 2
[root@jan yum.repos.d]# lsblk
NAME                        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                          11:0    1 1024M  0 rom
sda                           8:0    0   80G  0 disk
├─sda1                        8:1    0  256M  0 part /boot
├─sda2                        8:2    0   15G  0 part /
├─sda3                        8:3    0    2G  0 part [SWAP]
├─sda4                        8:4    0    1K  0 part
└─sda5                        8:5    0 62.8G  0 part
  ├─sysvg-homelv (dm-0)     253:0    0    5G  0 lvm  /home
  ├─sysvg-varlv (dm-1)      253:1    0    5G  0 lvm  /var
  ├─sysvg-optlv (dm-2)      253:2    0    4G  0 lvm  /opt
  ├─sysvg-usrlocallv (dm-3) 253:3    0    4G  0 lvm  /usr/local
  ├─sysvg-usrlv (dm-4)      253:4    0    5G  0 lvm  /usr
  └─sysvg-tmplv (dm-5)      253:5    0    4G  0 lvm  /tmp
sdb                           8:16   0   10G  0 disk
├─sdb1                        8:17   0    2G  0 part
│ └─appvg-backuplv (dm-6)   253:6    0    1G  0 lvm  /backup
└─sdb2                        8:18   0    2G  0 part

IF you need to remove partition then you can just type in

partx -v -d /dev/sdb

 

Leave a Reply