Bug 593830 - Error on boot: /init: 3: cannot create /sys/block/sr0: Is a directory
Error on boot: /init: 3: cannot create /sys/block/sr0: Is a directory
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dracut (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Harald Hoyer
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-19 15:28 EDT by Gaetan Cambier
Modified: 2010-10-30 19:39 EDT (History)
11 users (show)

See Also:
Fixed In Version: dracut-005-5.fc12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-27 18:54:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Gaetan Cambier 2010-05-19 15:28:22 EDT
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 16:04:41 EDT
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 16:07:25 EDT
Punting over for some dracut eyeballs :)
Comment 3 Rodrigo de Farias Gomes 2010-06-03 08:14:55 EDT
 (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 17:27:16 EDT
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-04 21:46:43 EDT
(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 15:51:40 EDT
(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 18:24:25 EDT
(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 08:16:14 EDT
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@redhat.com> 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 11:32:00 EDT
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 06:53:17 EDT
 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 04:19:49 EDT
(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 04:45:27 EDT
(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 11:31:35 EDT
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 11:32:59 EDT
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 16:38:39 EDT
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 18:53:31 EDT
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 19:38:08 EDT
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.