Bug 472657
Summary: | RAID/LVM unable to use USB disk because device not (yet) stabilized | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dr. Tilmann Bubeck <tilmann> |
Component: | kernel | Assignee: | Kernel Maintainer List <kernel-maint> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 10 | CC: | aschorr, kernel-maint, notting |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-12-18 06:55:31 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Attachments: |
Description
Dr. Tilmann Bubeck
2008-11-22 23:54:25 UTC
We already run udevsettle - if that's not enough, we need better infrastructure in the kernel. This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle. Changing version to '10'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping There will never be infrastructure in the kernel to predict whether disks will appear sometime in the fiture. All we ask is some way to know that the *initial* scan (done on driver init) has finished. I think I'm having a similar problem. The root filesystem is on an IDE disk, and I have 2 external USB disks forming a raid 1 array. The mdadm assemble command in rc.sysinit is failing because the kernel does not see the devices yet. I patched rc.sysinit to wait for the needed devices to appear in /proc/partitions before mdadm is called (just loop while grepping for the devices, with sleep 1 in between). This works for me, but is a hack because I have to specify the device names to seek in /proc/partitions. Perhaps there should be something in /etc/sysconfig/mdadm that gives a list of devices to wait for before calling mdadm in rc.sysinit? Of course, this has a risk of hanging, so a timeout (10 seconds?) would be needed. In my case, it just needs to wait a couple of seconds for the devices to appear in /proc/partitions. Should I bother to submit a patch, or is this a horrendous idea? On 2nd thought, that idea was a bit premature. Presumably we don't want to be dependent on the partition (device) names, so perhaps we can wait for certain device UUIDs to appear before proceeding? And I guess this is not necessarily just an mdadm issue, since somebody could simply want to mount a (non-RAID) USB device in /etc/fstab. So perhaps there could be a list somewhere in /etc/sysconfig of UUIDs to wait for before proceeding? Created attachment 329218 [details]
rc.sysinit patch to wait for devices to become available
This is a patch to /etc/rc.d/rc.sysinit to enable it to wait
for devices such as USB disks to become available. It works
with a config file called /etc/sysconfig/devwait that might
look like this:
bash$ cat /etc/sysconfig/devwait
DEVWAIT_1_COUNT=2
DEVWAIT_1_UUID=925e61c7-a41b-02fd-e65f-1ba6c292e6f5
DEVWAIT_NUM=1
DEVWAIT_TIMEOUT=30
This gives a list (numbered from 1 through $DEVWAIT_NUM) of UUIDs
to wait for (and a count for each UUID, since mdadm RAID 1 arrays
seem to use the same UUID for both partitions). It waits up
to $DEVWAIT_TIMEOUT seconds for the devices to appear.
Is this at all useful? It works for me...
Regards,
Andy
It's not very generic, so I don't see it being integrated upstream. It's certainly a workaround that can work for some people, though. OK, thanks for the feedback. Can you think of a way to make it more generic? I thought by searching for UUIDs that it was a pretty robust and generally applicable approach. One possible thought that occurred to me was just to wait for devices that appear in the cached /etc/blkid/blkid.tab file to appear before proceeding. That has the advantage of requiring no configuration, but it gives the admin less control over the process. Perhaps combining that with the existing patch would give the right combination of ease-of-use plus the power to configure more deterministically when the admin knows what he's doing? Regards, Andy Created attachment 329266 [details]
patch to /etc/rc.d/init.d/halt and /etc/rc.d/rc.sysinit to wait for disks
The attached patch has the same functionality as the previous one,
plus it has some new features. When the system is halted, if the
file /etc/sysconfig/devwait exists, then the halt script will
save a list of all disks present at that time in /var/lib/devwait.devices.
At boot time, in rc.sysinit, we will wait for any devices
in /var/lib/devwait.devices as well as any devices that are
specified explicitly in /etc/sysconfig/devwait.
So to get the automatic disk waiting behavior, simply put this in
/etc/sysconfig/devwait:
DEVWAIT_NUM=0
DEVWAIT_TIMEOUT=30
With this in place, the system will wait up to 30 seconds at boot time
to detect all the disks that were present when it was halted.
This is pretty easy to use. Any chance of accepting a patch
like this?
Regards,
Andy
Created attachment 329284 [details]
patch to /etc/rc.d/init.d/halt and /etc/rc.d/rc.sysinit to wait for disks
This is a minor change to the previous version to fix some problems
in /etc/rc.d/init.d/halt. In particular, I hadn't realized
that "blkid -g" always gives a non-zero exit code. And now
it should display proper status for saving the device list.
If this patch is of any interest, I could clean up the rc.sysinit
portion to use a function with local variables (to avoid polluting
the name space). It also may make sense to put in some safeguards,
such as an upper limit on the value of DEVWAIT_TIMEOUT (perhaps
5 minutes?).
Regards,
Andy
This message is a reminder that Fedora 10 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 10. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '10'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 10's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 10 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed. |