/dev/md0: Device or resource busy

/dev/md0: Device or resource busy

Post by dean gaude » Mon, 18 Mar 2002 10:50:06



i'm using 2.4.19-pre3-ac1 (on debian woody) and i was playing with md. it
appears impossible to "raidstop /dev/md0" when i'm using the 0xfd
autodetect partition type.

i have 3 other md devices which i can stop no problem (even with 0xfd
autodetection), just not /dev/md0.

% raidstop /dev/md0
/dev/md0: Device or resource busy

i don't have any filesystem mounted on md0, and "lsof | grep md" doesn't
show anything.

% dmesg | grep md0
md: created md0
md0: max total readahead window set to 124k
md0: 1 data-disks, max readahead per data-disk: 124k
raid1: raid set md0 active with 2 out of 2 mirrors
md: updating md0 RAID superblock on device
md: md0 still in use.

if i change the partition type to 0xda (is there something more
appropriate?), and let /etc/init.d/raid2 do the "raidstart /dev/md0" then
i can raidstop /dev/md0 no problem.

is there maybe a reference counting problem when 0xfd is in use?

note that my other md partitions are all 0xfd ... and i can raidstop them
just fine.  (although i have to do it in a particular order since /dev/md3
is a stripe of /dev/md{1,2}, which are mirrors. /dev/md1 happens to be
other partitions on the same disks as /dev/md0.)

-dean

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

/dev/md0: Device or resource busy

Post by Alan Co » Mon, 18 Mar 2002 12:20:06


Quote:> i have 3 other md devices which i can stop no problem (even with 0xfd
> autodetection), just not /dev/md0.

> % raidstop /dev/md0
> /dev/md0: Device or resource busy

> i don't have any filesystem mounted on md0, and "lsof | grep md" doesn't
> show anything.

lsof isnt always the most reliable to tools if a kernel thread or nfs
ran off with it. Is md0 doing anything else - like rebuilding. Is there
anything that has been triggered or run from it - paticularly kernel
threads
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

/dev/md0: Device or resource busy

Post by dean gaude » Mon, 18 Mar 2002 12:20:10



> > i have 3 other md devices which i can stop no problem (even with 0xfd
> > autodetection), just not /dev/md0.

> > % raidstop /dev/md0
> > /dev/md0: Device or resource busy

> > i don't have any filesystem mounted on md0, and "lsof | grep md" doesn't
> > show anything.

> lsof isnt always the most reliable to tools if a kernel thread or nfs
> ran off with it. Is md0 doing anything else - like rebuilding. Is there
> anything that has been triggered or run from it - paticularly kernel
> threads

nothing that i'm aware of -- i've never put these devices into fstab.  i
disabled smartsuite because it was holding /dev/hdN open, but that didn't
change anything.

i just tried a "linux init=/bin/sh" boot, and it's still saying Device or
resource busy:

init-2.05a# raidstop /dev/md0
md: md0 still in use.
/dev/md0: Device or resource busy
init-2.05a# mount /proc
init-2.05a# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1]
read_ahead 1024 sectors
md0 : active raid1 hdi1[1] hde1[0]
      131392 blocks [2/2] [UU]

md1 : active raid1 hdi2[1] hde2[0]
      78045824 blocks [2/2] [UU]

md2 : active raid1 hdk1[1] hdg1[0]
      78177344 blocks [2/2] [UU]

unused devices: <none>
init-2.05a# ps auxww
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  6.9  0.1  2312 1284 ?        S    11:11   0:07 init
root         2  0.0  0.0     0    0 ?        SW   11:11   0:00 [keventd]
root         3  0.0  0.0     0    0 ?        SWN  11:11   0:00 [ksoftirqd_CPU0]
root         4  0.0  0.0     0    0 ?        SWN  11:11   0:00 [ksoftirqd_CPU1]
root         5  0.0  0.0     0    0 ?        SW   11:11   0:00 [kswapd]
root         6  0.0  0.0     0    0 ?        SW   11:11   0:00 [bdflush]
root         7  0.0  0.0     0    0 ?        SW   11:11   0:00 [kupdated]
root         8  0.0  0.0     0    0 ?        SW   11:11   0:00 [mdrecoveryd]
root         9  0.0  0.0     0    0 ?        SW   11:11   0:00 [raid1d]
root        10  0.0  0.0     0    0 ?        SW   11:11   0:00 [raid1d]
root        11  0.0  0.0     0    0 ?        SW   11:11   0:00 [raid1d]
root        16  0.0  0.0  2600  792 ?        R    11:13   0:00 ps auxww

-dean

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

/dev/md0: Device or resource busy

Post by Robert Hayde » Mon, 18 Mar 2002 12:30:10


Alan et al,

I have this happen quite frequently as well, and only on /dev/md0.  I end up
having to reboot to single user to work with it in these situations.  The
other md devices (two others) stop and start just fine.

Quote:> lsof isnt always the most reliable to tools if a kernel thread or nfs
> ran off with it. Is md0 doing anything else - like rebuilding. Is there
> anything that has been triggered or run from it - paticularly kernel
> threads

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

/dev/md0: Device or resource busy

Post by Alan Co » Mon, 18 Mar 2002 12:30:12


Quote:> i just tried a "linux init=/bin/sh" boot, and it's still saying Device or
> resource busy:

> init-2.05a# raidstop /dev/md0
> md: md0 still in use.
> /dev/md0: Device or resource busy
> init-2.05a# mount /proc

Duplicated. Seems the md code deos indeed have a bug there

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

/dev/md0: Device or resource busy

Post by dean gaude » Mon, 18 Mar 2002 12:50:09



> > i just tried a "linux init=/bin/sh" boot, and it's still saying Device or
> > resource busy:

> > init-2.05a# raidstop /dev/md0
> > md: md0 still in use.
> > /dev/md0: Device or resource busy
> > init-2.05a# mount /proc

> Duplicated. Seems the md code deos indeed have a bug there

ACK!  sorry.  it's not the kernel code, it's raidstop.  it seems to open
/dev/md0 an extra time for what reason i'm not sure.  it even does it when
you're referring to other md devices.  for example:

# strace raidstop /dev/md3
...
open("/dev/md0", O_RDONLY)              = 4
ioctl(4, 0x800c0910, 0x804fd1c)         = 0
open("/dev/md3", O_RDWR)                = 5
fstat64(5, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 3), ...}) = 0
ioctl(5, 0x932, 0)                      = 0
...

mdctl doesn't have this problem.

fwiw dpkg tells me i've got raidtools 0.90.20010914-9

-dean

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

/dev/md0: Device or resource busy

Post by Eric Lammert » Mon, 18 Mar 2002 21:40:06



> ACK!  sorry.  it's not the kernel code, it's raidstop.  it seems to open
> /dev/md0 an extra time for what reason i'm not sure.  it even does it when
> you're referring to other md devices.  for example:

It does this for checking the md driver version. For some reason, the
close() was commented out. I alerted the Debian maintainer about this
a few days ago.

Quote:> fwiw dpkg tells me i've got raidtools 0.90.20010914-9

It's fixed in 0.90.20010914-11.

Eric

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. /dev/ttyS2 (/dev/cua2) reports "device or resource busy" on kernel 2.1.95

I have just upgraded my kernel from 2.1.77 to 2.1.95

I use isapnp tools to set the IRQ and I/O address of my modem, then
setserial
to tell the driver that /dev/ttyS2 is where it is.

This worked fine on 2.1.77 kernel but now I get the message that the
"device or resource busy", when I attempt to open it (with say, dip
or kermit). Nothing else is using the port.

What has changed between these two kernel releases that would cause
this?

(also tried /dev/cua2 (which is being 'deprecated') to the same
effect...
works on 2.1.77 and is busy on 2.1.95)

(remove the '__' before the address when replying please)
--
   |\      _,,,---,,_          Michael Katzmann  ( NV3Z / VK2BEA / G4NYV
)
   /,`.-'`'    -.  ;-;;,_              -  Broadcast Sports Technology
Inc.
  |,4-  ) )-,_. ,\ (  `'-'             -  Odenton, Maryland. U.S.A.

public key)

2. Compiling qt-1.44 under Linux-Mandrake 7.0

3. Floppy: /dev/fd0: Device or resource busy

4. Audio Recorder

5. mouse -> /dev/mouse "device or resource busy"

6. AHA-1542A

7. Sblaster Pro /dev/audio Resource or Device Busy?

8. creating external functions

9. /dev/modem: Device or resource busy

10. /dev/cua0: Device or Resource busy

11. DIP tty open (/dev/modem, RW):Device or resource busy???

12. Device or resource busy /dev/dsp?

13. /dev/dsp: Device or resource busy