Bugzilla – Bug 862403
lvmetad should not scan floppy
Last modified: 2015-03-24 07:43:44 UTC
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0 Patch for bnc#854413 switched LVM2 to use lvmetad by default. It appears lvmetad scans all available devices on startup, including CD-ROMs and floppy. It has cosmetic issues (errors are logged) but also attempt to access non-existent floppy is known to hang for very long time. Currently patch is pulled back due to bnc#862076. If switch to lvmetad is considered again, it should restrict range of devices to scan, at least skip floppies. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Liuhua, Can you help to fix this?
(In reply to comment #0) I have modified /etc/lvm/lvm.conf to fix the filter as followed: ----------------------------------------- # By default we accept every block device except udev names, floppy and cdrom: filter = [ "r|/dev/.*/by-path/.*|", "r|/dev/.*/by-id/.*|","r|/dev/fd.*|", "r|/dev/cdrom|", "a/.*/" ] ----------------------------------------- Andrey: Would you please modify your filter in lvm.conf as the above and try again? I have also committed to openSUSE:Factory/lvm2
This is an autogenerated message for OBS integration: This bug (862403) was mentioned in https://build.opensuse.org/request/show/229351 13.1 / lvm2
This is an autogenerated message for OBS integration: This bug (862403) was mentioned in https://build.opensuse.org/request/show/229469 Factory / lvm2
Update released for openSUSE 13.1 - resolved fixed.
openSUSE-RU-2014:0533-1: An update that has one recommended fix can now be installed. Category: recommended (low) Bug References: 862403 CVE References: Sources used: openSUSE 13.1 (src): lvm2-2.02.98-0.28.18.1
This does not completely fix it. When the very first client connects to lvmetad, full device scan is triggered which still attempts to scan /dev/fd0 and /dev/cdrom. This device scan ignores device/filter setting. It does respect device/global_filter setting though and this was what originally was suggested.
Andrey, I am sorry there is some error with my bugzilla. it doesnot send mail to me. I just noticed the bug Reopened. Can you tell what the reproduce steps? In my environment, I cannot see the log of scanning floppy disk. Is the os installed on a lvm partition?
(In reply to comment #9) > > Is the os installed on a lvm partition? No. Here is trivial way to reproduce it - install OS without LVM - create the very first PV this reliably triggers for me [ 143.704478] end_request: I/O error, dev fd0, sector 0 [ 143.732256] end_request: I/O error, dev fd0, sector 0
Or the very first pvscan after reboot linux-dwhw:~ # pvscan /dev/fd0: open failed: No such device or address /dev/cdrom: open failed: No medium found
Thanks for your reply. I install newest sle12beta9, could not reproduce. 1. install sle12b9 2. edit /etc/lvm/lvm.conf : user_lvmetad = 1 3. systemctl enable lvm2-lvmetad.socket (if not enbale, lvmetad cannot run) 4. pvcreate /dev/sda3 5. pvscan pvscan return quickly. Lvm2 has same source on sle12:GA and opensuse factory, so I tested with it. Andey, would you please try on the newest os to see if still has this problem?
(In reply to comment #12) > Lvm2 has same source on sle12:GA and opensuse factory, so I tested with it. > Andey, would you please try on the newest os to see if still has this problem? I installed Factory (network install) and lvmetad was disabled after installation. So of course this problem is not seen. I manually enabled lvmetad and I see the same problem.
Hi Andrey, May I please you to give me some tar of lvmdump and output of pvscan -vvv? Thanks very much.
Created attachment 599214 [details] lvmdump
Created attachment 599215 [details] pvscan -vvv Files attached.
the pvscan result here has no prblem. # pvscan -vvv Setting activation/monitoring to 1 Processing: pvscan -vvv O_DIRECT will be used Setting global/locking_type to 3 Setting global/wait_for_locks to 1 Cluster locking selected. connect() failed on local socket: No such file or directory Internal cluster locking initialisation failed. Setting global/fallback_to_local_locking to 1 locking/fallback_to_local_locking not found in config: defaulting to 1 WARNING: Falling back to local file-based locking. Volume Groups with the clustered attribute will be inaccessible. Setting global/locking_dir to /run/lvm/lock Setting global/prioritise_write_locks to 1 Locking /run/lvm/lock/P_global WB _do_flock /run/lvm/lock/P_global:aux WB _do_flock /run/lvm/lock/P_global WB _undo_flock /run/lvm/lock/P_global:aux Wiping cache of LVM-capable devices /dev/vda: Added to device cache /dev/vda1: Added to device cache /dev/disk/by-uuid/ac22fbb1-3206-44c9-9094-effef5836834: Aliased to /dev/vda1 in device cache /dev/vda2: Added to device cache /dev/disk/by-uuid/9aaec23b-2b85-4caa-840e-c0cd36a79ecf: Aliased to /dev/vda2 in device cache /dev/root: Aliased to /dev/vda2 in device cache (preferred name) /dev/vda3: Added to device cache /dev/disk/by-uuid/124a1883-eb38-4df2-b2c2-347dc8ff5ef1: Aliased to /dev/vda3 in device cache /dev/fd0: Added to device cache Wiping internal VG cache lvmcache: initialised VG #orphans_lvm1 lvmcache: initialised VG #orphans_pool lvmcache: initialised VG #orphans_lvm2 Setting response to OK Setting response to OK Walking through all physical volumes Setting response to OK Setting response to OK No matching physical volumes found Unlocking /run/lvm/lock/P_global _undo_flock /run/lvm/lock/P_global ---------------------------------------- Is that your fd0 device is not in good status? Can you open it manually?
Hi, When use_lvmetad is set, the filter only works when the global_filter in devices section is set. Please add "r|/dev/fd.*|" and do the test again. But the root problem is not here. It's: 59 Setting response to token_mismatch 60 Setting response to OK The result of first reply from lvmetad is "token_mismatch" instead of "OK", and followed by a lot of "Unknown". However, I can't reproduce this locally. So would you mind let me take a look at your test machines?
modify /etc/lvm/lvm.conf to umcomment global_filter as the followed: global_filter = ["r|/dev/fd.*|", "a/.*/"] should prevent lvmetad from scanning floppy disk.And we had a test to show that works. Close this bug.