Bug 1225694
Summary: | Disk partition table is broken after wiping an extended partition | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Yang Yang <yanyang> |
Component: | libvirt | Assignee: | John Ferlan <jferlan> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.2 | CC: | dyuan, jdenemar, jferlan, mzhan, rbalakri, shyu, xuzhang, yisun |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.17-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 06:39:20 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Yang Yang
2015-05-28 02:16:03 UTC
The following patch has been posted upstream http://www.redhat.com/archives/libvir-list/2015-June/msg00389.html Patch pushed upstream: commit 84020f9a398f739ee2cf7588a7cf3b4b0c077984 Author: John Ferlan <jferlan> Date: Tue Jun 9 18:15:39 2015 -0400 storage: Disallow wiping an extended disk partition Check if the disk partition to be wiped is the extended partition, if so then disallow it. Do this via changing the wipeVol backend to check the volume before passing to the common virStorageBackendVolWipeLocal $ git describe 84020f9a398f739ee2cf7588a7cf3b4b0c077984 v1.2.16-151-g84020f9 $ Verified and passed with: libvirt-1.2.17-2.el7.x86_64 qemu-kvm-rhev-2.3.0-9.el7.x86_64 kernel-3.10.0-290.el7.x86_64 Steps: 1. prepare a disk sdb and make 3 partitions, sdb1 (primary) sdb2 (extended) sdb3 (logical) as follow: # fdisk /dev/sdb 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): print Disk /dev/sdb: 8004 MB, 8004304896 bytes, 15633408 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: 0x1e3d54c6 Device Boot Start End Blocks Id System /dev/sdb1 2048 2099199 1048576 83 Linux /dev/sdb2 2099200 6293503 2097152 5 Extended /dev/sdb5 2101248 2121727 10240 83 Linux 2. create a disk pool # cat pool.xml <pool type="disk"> <name>usbdisk</name> <source> <device path='/dev/sdb'/> <format type='dos'/> </source> <target> <path>/dev</path> </target> </pool> # virsh pool-create pool.xml Pool usbdisk created from pool.xml # virsh vol-list usbdisk --details Name Path Type Capacity Allocation ----------------------------------------------- sdb1 /dev/sdb1 block 1.00 GiB 1.00 GiB sdb2 /dev/sdb2 block 2.00 GiB 2.00 GiB sdb5 /dev/sdb5 block 10.00 MiB 10.00 MiB 3. vol-wipe the primary, logical and extended partition to see if it works as expected. # virsh vol-wipe sdb5 usbdisk Vol sdb5 wiped <=== logical # virsh vol-wipe sdb1 usbdisk Vol sdb1 wiped <=== primary # virsh vol-wipe sdb2 usbdisk error: Failed to wipe vol sdb2 error: this function is not supported by the connection driver: cannot wipe extended partition '/dev/sdb2' <=== extended, failed as expected. 4. check the partition table of /dev/sdb # fdisk /dev/sdb 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): print Disk /dev/sdb: 8004 MB, 8004304896 bytes, 15633408 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: 0x1e3d54c6 Device Boot Start End Blocks Id System /dev/sdb1 2048 2099199 1048576 83 Linux /dev/sdb2 2099200 6293503 2097152 5 Extended /dev/sdb5 2101248 2121727 10240 83 Linux Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2202.html |