Bug 738182

Summary: uninstall didn't wipe the boot disk
Product: Red Hat Enterprise Linux 6 Reporter: Mohua Li <moli>
Component: ovirt-nodeAssignee: Mike Burns <mburns>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2CC: apevec, cshao, gouyang, leiwang, mburns, ovirt-maint, ycui
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-node-2.0.2-0.12.gitc05f24f.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 19:27:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Patch apevec: review+

Description Mohua Li 2011-09-14 09:42:58 UTC
Description of problem:

see Bug 736971  comment 10, although dracut could wipe the lvs, but won't wipe the root/rootbackup boot disk, which make it still bootable, but no any lvs, so can't login, 


Version-Release number of selected component (if applicable):
6.2-0.16.2,

How reproducible:
always

Steps to Reproduce:
1.install rhev-hypervisor first
2.try to uninstall it specify "uninstall " in kernel cmd line
3.
  
Actual results:
wiped the all lv, but didn't remove rootbackup/root

Expected results:


Additional info:

Comment 1 Mike Burns 2011-09-15 13:13:04 UTC
This is actually not an easy fix, though it might be doable.  The problem lies with the fact that we don't know what device to clean up with just "uninstall" in the kernel commandline.  We do most of the cleanup in dracut with detecting where HostVG, but the cleaning of the mbr is done in ovirt-early.  

There are a couple of approaches that we could take, though both are speculative until I try to implement them

1.  cleanup mbr in dracut as well -- not easy.  I think we would need to include sfdisk in dracut to determine the right places on the disk to cleanup

2.  We *could* leave the HostVG volume group after we're done with dracut and cleaning up all the LV's.  Then we can wipe HostVG, PVs and mbr from disks in ovirt-early.  Note:  this is a radical change since we don't individually clean up LVs now.  

3.  pass information to the running system from dracut -- I don't even know if this is technically possible, but it would solve the problem if we could.

There may be others, but none that I can think of at the moment.

Alan, any thoughts on the above?

Comment 2 Mike Burns 2011-09-15 19:14:50 UTC
Created attachment 523431 [details]
Patch

After discussion with Alan, we decided that we can detect the disk that contains Root and RootBackup partitions and wipe that.

Comment 5 Ying Cui 2011-10-13 07:18:03 UTC
Check this issue with RHEV-H 6.2-20111010.2 build. It is not fixed, After uninstall in kernel cmd, it didn't remove Rootbackup/Root. and it still can be bootable.

#pvs
#lvs
No volume groups found
#vgs
No volume groups found
#findfs LABEL=Root
/dev/sda2
#findfs LABEL=RootBackup
/dev/sda1

Assigned it.

Comment 6 Mike Burns 2011-10-13 14:10:01 UTC
Called the wrong function, so it wasn't wiping any disks.

diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index 28ebd05..6c22054 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -679,7 +679,7 @@ start_ovirt_early () {
         oldIFS=$IFS
         log "Found uninstall arg, wiping mbr from init disks"
         IFS=$SEP
-        for init_disk in $init $init_app $(get_boot_disk); do
+        for init_disk in $init $init_app $(get_boot_device); do
             echo "Wiping $init_disk"
             wipe_mbr "$init_disk"
         done

Comment 9 errata-xmlrpc 2011-12-06 19:27:50 UTC
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.

http://rhn.redhat.com/errata/RHBA-2011-1783.html