mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* /dev/md0: Device or resource busy
@ 2002-03-17  1:44 dean gaudet
  2002-03-17  3:26 ` Alan Cox
  0 siblings, 1 reply; 7+ messages in thread
From: dean gaudet @ 2002-03-17  1:44 UTC (permalink / raw)
  To: linux-kernel

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: /dev/md0: Device or resource busy
  2002-03-17  3:26 ` Alan Cox
@ 2002-03-17  3:17   ` dean gaudet
  2002-03-17  3:41     ` Alan Cox
  2002-03-17  3:21   ` Robert Hayden
  1 sibling, 1 reply; 7+ messages in thread
From: dean gaudet @ 2002-03-17  3:17 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

On Sun, 17 Mar 2002, Alan Cox wrote:

> > 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: /dev/md0: Device or resource busy
  2002-03-17  3:26 ` Alan Cox
  2002-03-17  3:17   ` dean gaudet
@ 2002-03-17  3:21   ` Robert Hayden
  1 sibling, 0 replies; 7+ messages in thread
From: Robert Hayden @ 2002-03-17  3:21 UTC (permalink / raw)
  To: alan; +Cc: dean-list-linux-kernel, linux-kernel

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. 

> 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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: /dev/md0: Device or resource busy
  2002-03-17  1:44 /dev/md0: Device or resource busy dean gaudet
@ 2002-03-17  3:26 ` Alan Cox
  2002-03-17  3:17   ` dean gaudet
  2002-03-17  3:21   ` Robert Hayden
  0 siblings, 2 replies; 7+ messages in thread
From: Alan Cox @ 2002-03-17  3:26 UTC (permalink / raw)
  To: dean gaudet; +Cc: linux-kernel

> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: /dev/md0: Device or resource busy
  2002-03-17  3:17   ` dean gaudet
@ 2002-03-17  3:41     ` Alan Cox
  2002-03-17  3:43       ` dean gaudet
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Cox @ 2002-03-17  3:41 UTC (permalink / raw)
  To: dean gaudet; +Cc: Alan Cox, linux-kernel, mingo

> 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: /dev/md0: Device or resource busy
  2002-03-17  3:41     ` Alan Cox
@ 2002-03-17  3:43       ` dean gaudet
  2002-03-17 12:28         ` Eric Lammerts
  0 siblings, 1 reply; 7+ messages in thread
From: dean gaudet @ 2002-03-17  3:43 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, mingo

On Sun, 17 Mar 2002, Alan Cox wrote:

> > 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: /dev/md0: Device or resource busy
  2002-03-17  3:43       ` dean gaudet
@ 2002-03-17 12:28         ` Eric Lammerts
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Lammerts @ 2002-03-17 12:28 UTC (permalink / raw)
  To: dean gaudet; +Cc: Alan Cox, linux-kernel, mingo


On Sat, 16 Mar 2002, dean gaudet wrote:
> 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.

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

It's fixed in 0.90.20010914-11.

Eric


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-03-17 12:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-17  1:44 /dev/md0: Device or resource busy dean gaudet
2002-03-17  3:26 ` Alan Cox
2002-03-17  3:17   ` dean gaudet
2002-03-17  3:41     ` Alan Cox
2002-03-17  3:43       ` dean gaudet
2002-03-17 12:28         ` Eric Lammerts
2002-03-17  3:21   ` Robert Hayden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®