LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-05-2014, 07:23 PM   #1
narnie
Member
 
Registered: Jan 2010
Distribution: Linux Mint, Ubuntu Netbook Edition, et al
Posts: 108

Rep: Reputation: 17
How to fail software raid partition but errors saying device busy


I have the following software raid made using mdadm:

Code:
dell-desktop dev # cat /proc/mdstat 
Personalities : [raid1] 
md0 : active raid1 sdb6[1]
      717040448 blocks super 1.2 [2/1] [_U]
      
unused devices: <none>
I have a failed drive I am replacing (which no longer appears above. It was /dev/sda1), and need to fail the /dev/sdb6 device so I can do some work on it (won't get into that), re-add it, then add the new hard disk to the array.

Also,

Code:
dell-desktop dev # fdisk -l

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00011318

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    41945087    20971520   83  Linux
/dev/sdb2        41945088  1953523711   955789312    5  Extended
/dev/sdb5        41947136    54530047     6291456   82  Linux swap / Solaris
/dev/sdb6       519178240  1953523711   717172736   fd  Linux raid autodetect

Disk /dev/md0: 734.2 GB, 734249418752 bytes
2 heads, 4 sectors/track, 179260112 cylinders, total 1434080896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table
/dev/md0 is not mounted. I get the following response running:

Code:
dell-desktop dev # mdadm --fail /dev/md0 /dev/sdb6
mdadm: set device faulty failed for /dev/sdb6:  Device or resource busy
I can't figure out what has the device busy.

Running lsof, fuser, and losetup shows nothing is using the device (as expected since it is a fresh boot and nothing is mounted regarding it). There are no exports on this, but I have no way I know of to check to see if a kernel module is holding onto it.

How can I find out what has it busy, fix that, and fail the device so I can remove it from the system, work on it, then re-add it?

Oddly, I can do:

Code:
# mdadmin -S /dev/md0
Successfully, despite the report that /dev/sdb6 is busy.

This makes me actually think it is /dev/md0 that is latching onto it since it doesn't have another raid device to hold onto so it is "desperately clinging to it."

With thanks for the help ...

Last edited by narnie; 01-05-2014 at 07:27 PM.
 
Old 01-05-2014, 09:50 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
I don't think you can fail the last drive of a raidset. You can stop the array with
Code:
mdadm -S /dev/md0
This will not hurt the data on it. When you are ready, assemble it back to the same state:
Code:
mdadm -A /dev/md0 /dev/sdb6
You might be better off to add and resync the new drive before you work on sdb so you have a backup.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] mdadm raid inactive, assemble fails with Device or resource busy blackman890 Linux - Server 7 12-14-2014 04:43 PM
Failed to stop array: device or resource busy RAID/DMCrypt eponymous Linux - Software 0 12-08-2012 04:45 PM
md device fail in raid ananthkadalur Linux - Server 3 07-08-2011 08:23 AM
LXer: Device Or Resource Busy Errors In Linux LXer Syndicated Linux News 0 03-06-2010 09:40 AM
umount drive partition: device is busy? lefty.crupps Ubuntu 8 06-22-2006 08:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration