Bug 722895 - system-config-lvm leaves mount for logical group in fstab after group was completely removed.
Summary: system-config-lvm leaves mount for logical group in fstab after group was com...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: system-config-lvm
Version: 6.2
Hardware: i686
OS: Linux
low
high
Target Milestone: rc
: ---
Assignee: Marek Grac
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On: 658344
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-18 12:27 UTC by Marek Grac
Modified: 2011-12-06 17:46 UTC (History)
12 users (show)

Fixed In Version: system-config-lvm-1.1.12-9
Doc Type: Bug Fix
Doc Text:
The system-config-lvm utility incorrectly left mount information in the /etc/fstab configuration file for a logical volume that had been completely removed from the system. This could have caused the system to enter single-user mode after rebooting because it was unable to mount a logical volume in /etc/fstab that no longer existed. This update ensures that system-config-lvm correctly removes the fstab entry for any logical volume that is removed.
Clone Of: 658344
Environment:
Last Closed: 2011-12-06 17:46:39 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1710 0 normal SHIPPED_LIVE system-config-lvm bug fix update 2011-12-06 01:02:25 UTC

Description Marek Grac 2011-07-18 12:27:20 UTC
+++ This bug was initially created as a clone of Bug #658344 +++

Description of problem:
system-config-lvm leaves mount for logical group in fstab after group was completely removed. The devices are removed from /dev/mapper,/dev/disk but the entry for mounting the group is left in /etc/fstab.

When the system is rebooted,the system cannot find the device and fails to mount (for obvious reasons) the group. At that point the system prompts to enter the root password to go into recovery mode. Problem is, root is mounted read only so fstab can't be edited. Have to boot from the install media and go into recovery mode to edit fstab and remove the entry in fstab.

Then the reboot will work, but it takes a while to come up since when the system goes into recovery mode, selinux is put into permissive mode and the reboot requires a relabel. Ah, the adventures of Linux.

Version-Release number of selected component (if applicable):
system-config-lvm-1.1.15-1.fc14.noarch

How reproducible:
Only did this once. Too painful to try again. Besides, the bad drive is already packed and ready to go back for replacement.

 
Actual results:
mount information for logical group left in fstab after complete removal of group in system-config-lvm.

Expected results:
system-config-lvm should clean up the entry in fstab if the group is completely removed.

--- Additional comment from mgrac on 2011-07-08 08:35:55 EDT ---

@John:

thanks for reporting this problem. Surely something what I would like to fix.

By "logical group" you meant "volume group", am I right?

work-around: as a root you can do "mount -o remount,rw /" and then you can edit /etc/fstab without need for installation media.

--- Additional comment from fedora.jrg01 on 2011-07-08 10:33:59 EDT ---

Actually I meant a logical volume like:

/dev/mapper/vg_host-lv_someVolume /someMountPoint    ext4    defaults        1 2

--- Additional comment from mgrac on 2011-07-18 08:26:44 EDT ---

Created attachment 513606 [details]
Proposed patch

@John:

ok, I have tested it and in new distros there is different way how to do a symlinks for logical volumes. I have added heuristic that guess /dev/mapper/... and it should be pretty solid. 

Patch will be in upstream in few days (and new version for fedora too).

Comment 1 Marek Grac 2011-07-18 12:30:40 UTC
Unit test:

1) add new logical volume to fstab
2) change path to /dev/mapper/vg-lv
3) remove logical volume from fstab
4) if line was removed then patch is correct

Comment 4 Radek Steiger 2011-10-18 12:48:38 UTC
The situation as per unit test in Comment #1 seems quite artificial for the manual fstab entry modification, but I still understand this might happen during system upgrades.


BEFORE FIX:

Following steps of unit test Comment #1

1) created a new Logical volume named "test" using system-config-lvm on a physical extent named "test", with option "Mount when rebooted" selected
2) check that fstab entry exists
     [root@z1 etc]# cat fstab |grep test
     /dev/test/test		/mnt		ext3	defaults	1 2
3) modify this entry to point to /dev/mapper/$1 entry of the same logical unit:
     [root@z1 etc]# cat fstab |grep test
     /dev/mapper/test-test		/mnt		ext3	defaults	1 2
4) delete the logical volume using system-config-lvm
5) see that the entry was not removed from /etc/fstab:
     [root@z1 etc]# cat fstab |grep test
     /dev/mapper/test-test		/mnt		ext3	defaults	1 2
     [root@z1 etc]#



AFTER FIX:

Following steps of unit test Comment #1

1) created a new Logical volume named "test" using system-config-lvm on a physical extent named "test", with option "Mount when rebooted" selected
2) check that fstab entry exists
     [root@z1 etc]# cat fstab |grep test
     /dev/test/test		/mnt		ext3	defaults	1 2
3) modify this entry to point to /dev/mapper/$1 entry of the same logical unit:
     [root@z1 etc]# cat fstab |grep test
     /dev/mapper/test-test		/mnt		ext3	defaults	1 2
4) delete the logical volume using system-config-lvm
5) see that the entry was removed correctly from /etc/fstab:
     [root@z1 etc]# cat fstab |grep test
     [root@z1 etc]#


Marking VERIFIED for system-config-lvm-1.1.12-9.el6

Comment 5 Eliska Slobodova 2011-11-03 09:49:40 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The system-config-lvm utility incorrectly left mount information in the /etc/fstab configuration file for a logical volume that had been completely removed from the system. This could have caused the system to enter single-user mode after rebooting because it was unable to mount a logical volume in /etc/fstab that no longer existed. This update ensures that system-config-lvm correctly removes the fstab entry for any logical volume that is removed.

Comment 6 errata-xmlrpc 2011-12-06 17:46:39 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-1710.html


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