RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1095773 - partx -a /dev/vda not working - VM reboot required to be synched to newly added size of partition.
Summary: partx -a /dev/vda not working - VM reboot required to be synched to newly add...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: util-linux
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-08 13:38 UTC by Nikolai Sednev
Modified: 2015-09-02 08:17 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-02 08:17:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nikolai Sednev 2014-05-08 13:38:18 UTC
Description of problem:
partx -a /dev/vda not working - VM reboot required to be synched to newly added size of partition.

[root@dashboard ~]# partx -a /dev/vda
partx: /dev/vda: error adding partitions 1-3


Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 7.0 (Maipo)

How reproducible:
100%

Steps to Reproduce:
1.Create guest-VM from RHEVM3.4 with boot disk of 15gig and install RHEL7.0 OS on it, use host with RHEL7.0 OS to run guest-VM on it. 
2.Run guest-VM and expand it's boot disk to additional 50Gig via RHEVM.
3.Following http://myshell.co.uk/index.php/how-to-extend-a-root-lvm-partition-online/ manual, try to extend the root partition.
4.Try using "partx -a /dev/vda", so it will update the size of newly created partition /dev/vda3.
5.Run lsblk and \ls -la /dev/vda*, you won't get /dev/vda3 updated, neither shown until VM rebooted.

Actual results:
[root@dashboard ~]# partx -a /dev/vda
partx: /dev/vda: error adding partitions 1-3

partx not updating the kernel until VM rebooted.

Expected results:
partx should update kernel of added partition without OS being rebooted.

Additional info:
Red Hat Enterprise Linux Server release 7.0 (Maipo)

Comment 2 Nikolai Sednev 2014-05-08 13:50:56 UTC
Please see bellow that partx not updating kernel regarding changes beeing done to disk partitions until OS rebooted (here I'm deleting /dev/vda4 via fdisk, then saving this by entering "w" and trying to partx the kernel without success, until OS reboot, no changes taking any effect:


[root@dashboard ~]# fdisk -u -c /dev/vda
Welcome to fdisk (util-linux 2.23.2).   

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.                         


Command (m for help): p

Disk /dev/vda: 75.2 GB, 75161927680 bytes, 146800640 sectors
Units = sectors of 1 * 512 = 512 bytes                      
Sector size (logical/physical): 512 bytes / 512 bytes       
I/O size (minimum/optimal): 512 bytes / 512 bytes           
Disk label type: dos                                        
Disk identifier: 0x0002f514                                 

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048     1026047      512000   83  Linux 
/dev/vda2         1026048    31457279    15215616   8e  Linux LVM
/dev/vda3        31457280   104857599    36700160   83  Linux    
/dev/vda4       104857600   146800639    20971520   8e  Linux LVM

Command (m for help): d
Partition number (1-4, default 4): 
Partition 4 is deleted             

Command (m for help): p

Disk /dev/vda: 75.2 GB, 75161927680 bytes, 146800640 sectors
Units = sectors of 1 * 512 = 512 bytes                      
Sector size (logical/physical): 512 bytes / 512 bytes       
I/O size (minimum/optimal): 512 bytes / 512 bytes           
Disk label type: dos                                        
Disk identifier: 0x0002f514                                 

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048     1026047      512000   83  Linux 
/dev/vda2         1026048    31457279    15215616   8e  Linux LVM
/dev/vda3        31457280   104857599    36700160   83  Linux    

Command (m for help): t
Partition number (1-3, default 3): 
Hex code (type L to list all codes):   
Hex code (type L to list all codes): q 
Changed type of partition 'Linux' to 'unknown'

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 or after you run partprobe(8) or kpartx(8)                            
Syncing disks.                                                                        
[root@dashboard ~]# lsblk                                                             
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT                                   
sr0              11:0    1 1024M  0 rom                                               
vda             252:0    0   70G  0 disk                                              
├─vda1          252:1    0  500M  0 part /boot                                        
├─vda2          252:2    0 14.5G  0 part                                              
│ ├─vg0-lv_root 253:0    0 41.9G  0 lvm  /                                            
│ ├─vg0-lv_swap 253:1    0  6.9G  0 lvm  [SWAP]                                       
│ └─vg0-lv_home 253:3    0  688M  0 lvm  /home                                        
├─vda3          252:3    0   35G  0 part                                              
│ └─vg0-lv_root 253:0    0 41.9G  0 lvm  /                                            
└─vda4          252:4    0   20G  0 part                                              
[root@dashboard ~]# partx -a /dev/vda4
[root@dashboard ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0              11:0    1 1024M  0 rom
vda             252:0    0   70G  0 disk
├─vda1          252:1    0  500M  0 part /boot
├─vda2          252:2    0 14.5G  0 part
│ ├─vg0-lv_root 253:0    0 41.9G  0 lvm  /
│ ├─vg0-lv_swap 253:1    0  6.9G  0 lvm  [SWAP]
│ └─vg0-lv_home 253:3    0  688M  0 lvm  /home
├─vda3          252:3    0   35G  0 part
│ └─vg0-lv_root 253:0    0 41.9G  0 lvm  /
└─vda4          252:4    0   20G  0 part
[root@dashboard ~]# partx -a /dev/vda
partx: /dev/vda: error adding partitions 1-3
[root@dashboard ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0              11:0    1 1024M  0 rom
vda             252:0    0   70G  0 disk
├─vda1          252:1    0  500M  0 part /boot
├─vda2          252:2    0 14.5G  0 part
│ ├─vg0-lv_root 253:0    0 41.9G  0 lvm  /
│ ├─vg0-lv_swap 253:1    0  6.9G  0 lvm  [SWAP]
│ └─vg0-lv_home 253:3    0  688M  0 lvm  /home
├─vda3          252:3    0   35G  0 part
│ └─vg0-lv_root 253:0    0 41.9G  0 lvm  /
└─vda4          252:4    0   20G  0 part
[root@dashboard ~]# reboot
Connection to 10.35.102.59 closed by remote host.
Connection to 10.35.102.59 closed.
[nsednev@nsednev ~]$ ssh -Y -X -l root 10.35.102.59
root.102.59's password:
Last login: Thu May  8 16:41:40 2014 from dhcp-4-207.tlv.redhat.com
[root@dashboard ~]# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0              11:0    1 1024M  0 rom
vda             252:0    0   70G  0 disk
├─vda1          252:1    0  500M  0 part /boot
├─vda2          252:2    0 14.5G  0 part
│ ├─vg0-lv_root 253:0    0 41.9G  0 lvm  /
│ ├─vg0-lv_swap 253:1    0  6.9G  0 lvm  [SWAP]
│ └─vg0-lv_home 253:2    0  688M  0 lvm  /home
└─vda3          252:3    0   35G  0 part
  └─vg0-lv_root 253:0    0 41.9G  0 lvm  /
[root@dashboard ~]#

Comment 3 Denys Vlasenko 2015-02-03 17:11:55 UTC
partx belongs to util-linux package, not busybox.

Comment 4 Karel Zak 2015-02-04 08:19:47 UTC
There is difference between add (-a) and update (-u) partx commands. Try, 

 partx -d /dev/vda4
 partx -u /dev/vda3

It seems also little bit problematic to play with partition actively mapped by LVM.

Comment 5 Karel Zak 2015-02-04 09:54:41 UTC
BTW, according to comment #2, you have deleted vda4 by fdisk, but vda3 is still the same (unchanged size), not sure what change do you expect from kernel. Note that kernel does not care about partition types (for example LVM is detected in userspace according to the partition content).

Comment 6 Nikolai Sednev 2015-02-16 15:25:31 UTC
Works for me.

Comment 8 Karel Zak 2015-09-02 08:17:31 UTC
(In reply to Nikolai Sednev from comment #6)
> Works for me.

I guess we can close as NOTABUG. If you don't agree then reopen, please. Thanks.


Note You need to log in before you can comment on or make changes to this bug.