Bug 593830 - Error on boot: /init: 3: cannot create /sys/block/sr0: Is a directory
Summary: Error on boot: /init: 3: cannot create /sys/block/sr0: Is a directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-19 19:28 UTC by Gaetan Cambier
Modified: 2010-10-30 23:39 UTC (History)
11 users (show)

Fixed In Version: dracut-005-5.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-27 22:54:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Checking if $cdrom is a directory (491 bytes, patch)
2010-06-04 21:27 UTC, Eduardo
no flags Details | Diff

Description Gaetan Cambier 2010-05-19 19:28:22 UTC
Description of problem:
i have this error message at boot

/init: 3: cannot create /sys/block/sr0: Is a directory

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

2.6.32.12-115.fc12.x86_64

How reproducible:

reboot the computer ans view log (first line boot.log)

 
Actual results:

this error is only with 2.6.32.12-115
the older kernel are not affected

Comment 1 Eduardo 2010-05-25 20:04:41 UTC
I had the same problem. Here is a some additional information.

This is actually happening for any kernel. The problem seems to be the images created by dracut. After I downgraded from dracut-005-2.fc12.noarch to dracut-002-13.4.git8f397a9b.fc12.noarch (the version provided at release time) and recreated the kernel boot image I was able to boot with 2.6.32.12-115.fc12.x86_64

Comment 2 Eric Sandeen 2010-05-25 20:07:25 UTC
Punting over for some dracut eyeballs :)

Comment 3 Rodrigo de Farias Gomes 2010-06-03 12:14:55 UTC
 (In reply to comment #1)
> I had the same problem. Here is a some additional information.
> 
> This is actually happening for any kernel. The problem seems to be the images
> created by dracut. After I downgraded from dracut-005-2.fc12.noarch to
> dracut-002-13.4.git8f397a9b.fc12.noarch (the version provided at release time)
> and recreated the kernel boot image I was able to boot with
> 2.6.32.12-115.fc12.x86_64    

I agree with you, the offending code is in the file /usr/share/dracut/modules.d/99base/init:

190     # dirty hack for some cdrom drives,
191     # which report no medium for quiet
192     # some time.
193     for cdrom in /sys/block/sr*; do
194         [ -e "$cdrom" ] || continue
195         # skip, if cdrom medium was already found
196         strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \
197             ID_CDROM_MEDIA && continue
198         echo change > "$cdrom"        
199     done

In my system the command:

# udevadm info --query=env --path=/block/sr0 | grep MEDIA

return nothing if none media is in the drive during boot. But,after the boot, if I put a media in the drive the command return ID_CDROM_MEDIA=1. 

I am using the kernel 2.6.32.14-127.fc12.i686 from updates-testing.

English is not my native language, sorry by the poor spelling...

Comment 4 Eduardo 2010-06-04 21:27:16 UTC
Created attachment 421358 [details]
Checking if $cdrom is a directory

Thank you Rodrigo. That is exactly what is happening in my system.

I am not sure what echo change >$cdrom is trying to do but I do not think it is meant to be done when $cdrom is a directory, which it is in this case. I made the attached change and the new generated images are working fine now.

Comment 5 Rodrigo de Farias Gomes 2010-06-05 01:46:43 UTC
(In reply to comment #4)
> Created an attachment (id=421358) [details]
> Checking if $cdrom is a directory
> 
> Thank you Rodrigo. That is exactly what is happening in my system.
> 
> I am not sure what echo change >$cdrom is trying to do but I do not think it is
> meant to be done when $cdrom is a directory, which it is in this case. I made
> the attached change and the new generated images are working fine now.    

Aparently the "echo change >$cdrom" try "poke" the kernel about sr0. Maybe changing the offending code from:
 echo change > $cdrom
to:
 echo change > $cdrom 2> /dev/null
is enough.

Anyway, your patch work for me, thanks.

English is not my native language, sorry by the poor spelling...

Comment 7 Rodrigo de Farias Gomes 2010-06-11 19:51:40 UTC
(In reply to comment #6)
> Here is the correct fix:
> 
> http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=commitdiff;h=2937028c542f3ffc80f1c15968547c6a85bfdcac    

Works for me, thanks.

Comment 8 Eduardo 2010-06-11 22:24:25 UTC
(In reply to comment #6)
> Here is the correct fix:
> 
> 133http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=commitdiff;h=2937028c542f3ffc80f1c15968547c6a85bfdcac    

Works for me. Thank you!

Comment 9 Rodrigo de Farias Gomes 2010-06-12 12:16:14 UTC
Harald Hoyer, you can update the dracut package in F12 to version 005-3? According to changelog from F13 (http://koji.fedoraproject.org/koji/buildinfo?buildID=167964), this version have the fix shown in comment 6:


* Tue Apr 20 2010 Harald Hoyer <harald> 005-3
- fixed network with multiple nics
- fixed nfsidmap paths
- do not run blkid on non active container raids
- fixed cdrom polling mechanism
- update to latest git

Comment 10 Steve 2010-08-22 15:32:00 UTC
I'm getting a very similar error in FC 12 -- mine says

/init: 2: cannot create /sys/block/sr0: is a directory

(Note the 2 instead of the 3.)

This started happening once I connected a new hard drive (in JBOD mode) to a previously-unused RAID card.  I applied the change mentioned above in comment 6, but the error persists.

I can reboot the machine and sometimes it gets past this problem, other times it prevents the machine from booting at all.

I'm happy to provide any additional information if you need it.

Comment 11 Jeremy Whiting 2010-08-24 10:53:17 UTC
 On 20 Aug 2010 I installed updates and now getting the same message on boot.
 Have applied the patch to 99base/init and the boot process continues to fail every time.

Jeremy

Comment 12 Jeremy Whiting 2010-09-02 08:19:49 UTC
(In reply to comment #11)
>  On 20 Aug 2010 I installed updates and now getting the same message on boot.
>  Have applied the patch to 99base/init and the boot process continues to fail
> every time.
> 
> Jeremy

 The issue in my case is due to a bug in blkid that reports the wrong file system type for a partition. Nothing to do with the init script.

Comment 13 Harald Hoyer 2010-09-02 08:45:27 UTC
(In reply to comment #10)
> I'm getting a very similar error in FC 12 -- mine says
> 
> /init: 2: cannot create /sys/block/sr0: is a directory
> 
> (Note the 2 instead of the 3.)
> 
> This started happening once I connected a new hard drive (in JBOD mode) to a
> previously-unused RAID card.  I applied the change mentioned above in comment
> 6, but the error persists.
> 
> I can reboot the machine and sometimes it gets past this problem, other times
> it prevents the machine from booting at all.
> 
> I'm happy to provide any additional information if you need it.

The error message has nothing to do with your problem.

Comment 14 Fedora Update System 2010-09-23 15:31:35 UTC
dracut-005-4.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/dracut-005-4.fc13

Comment 15 Fedora Update System 2010-09-23 15:32:59 UTC
dracut-005-4.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/dracut-005-4.fc12

Comment 16 Fedora Update System 2010-09-24 20:38:39 UTC
dracut-005-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dracut'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/dracut-005-4.fc12

Comment 17 Fedora Update System 2010-10-27 22:53:31 UTC
dracut-005-5.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2010-10-30 23:38:08 UTC
dracut-005-5.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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