LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-06-2010, 02:50 PM   #1
q630
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Rep: Reputation: 0
mdadm raid1 partially works, however device or resource busy when adding sda1


My question is how to add /dev/sda1 to raid1 md0 if I am getting device/resource busy errors?

I tried searching google and forums here but haven't quite found what I am looking for. I've got a box running Untangle based off of Debian linux. I wanted to run raid1 and followed the guide herehttp://www.howtoforge.com/software-r...ot-debian-etch
I have md0,md1, and md2. md1,md2 are working no problems, however I can't seem to add /dev/sda1 to md0. I checked and I do not have dmraid or lvm running. At this point I am wondering if it would be better to simply remove sda from the raid altogether and follow the above guide to add it back. Thanks in advance.
Code:
 uname -a                                               [root @ hostname]
Linux hostname.example.com 2.6.26-1-untangle-686 #1 SMP Tue Jan 27 17:51:54 PST 2009 i686 GNU/Linux
Code:
 mdadm --add /dev/md0 /dev/sda1                         [root @ hostname]
mdadm: Cannot open /dev/sda1: Device or resource busy
Code:
 mdadm --zero-superblock /dev/sda1                     [root @ hostname]
mdadm: Couldn't open /dev/sda1 for write - not zeroing
Code:
 cat /proc/mdstat                                       [root @ hostname]
Personalities : [raid1]
md2 : active raid1 sda5[0] sdb5[1]
      895985088 blocks [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
      2650624 blocks [2/2] [UU]

md0 : active raid1 sdb1[1]
      78123968 blocks [2/1] [_U]

unused devices: <none>
Code:
 fdisk -l                                               [root @ hostname]

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0004d5e5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        9726    78124063+  fd  Linux raid autodetect
/dev/sda2            9727       10056     2650725   fd  Linux raid autodetect
/dev/sda3           10057      121601   895985212+   5  Extended
/dev/sda5           10057      121601   895985181   fd  Linux raid autodetect

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        9726    78124063+  fd  Linux raid autodetect
/dev/sdb2            9727       10056     2650725   fd  Linux raid autodetect
/dev/sdb3           10057      121601   895985212+   5  Extended
/dev/sdb5           10057      121601   895985181   fd  Linux raid autodetect

Disk /dev/md0: 79.9 GB, 79998943232 bytes
2 heads, 4 sectors/track, 19530992 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/md1: 2714 MB, 2714238976 bytes
2 heads, 4 sectors/track, 662656 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x26210fa4

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md2: 917.4 GB, 917488730112 bytes
2 heads, 4 sectors/track, 223996272 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md2 doesn't contain a valid partition table
Code:
 mount                                                 [root @ hostname]
/dev/md0 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/md2 on /data type ext3 (rw)
EDIT:
Found fuser command and here is output.
Does this mean I'll need to boot from a LIVE cd to add? I don't understand why sda1 is in use! D:
Code:
fuser -vm /dev/sda1                                       [root @ hostname]
                     USER        PID ACCESS COMMAND
/dev/sda1:           root          1 .rce. init
                     root          2 .rc.. kthreadd
                     root          3 .rc.. migration/0
                     root          4 .rc.. ksoftirqd/0
                     root          5 .rc.. watchdog/0
                     root          6 .rc.. events/0
                     root          7 .rc.. khelper
                     root         39 .rc.. kblockd/0
                     root         41 .rc.. kacpid
                     root         42 .rc.. kacpi_notify
                     root        121 .rc.. kseriod
                     root        158 .rc.. pdflush
                     root        159 .rc.. pdflush
                     root        160 .rc.. kswapd0
etc. etc.

Last edited by q630; 07-06-2010 at 03:25 PM. Reason: More info
 
Old 07-07-2010, 08:20 AM   #2
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 96
look at menu.lst
 
Old 07-07-2010, 04:58 PM   #3
q630
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Heh, I just noticed its missing a bunch of parameters for the one I boot off of. But I don't think those settings would affect the raid.
Here is my UUID's
Code:
 blkid                                            [root @ hostname]
/dev/sda1: UUID="657d47ff-72fa-45a9-abdb-8fc43c72877a" TYPE="ext3"
/dev/sda2: TYPE="swap" UUID="371fca33-dc30-470e-b6e2-d1fdc9560c26"
/dev/sda5: UUID="1569212f-1e5b-4dea-815f-c789ffc0265c" TYPE="ext3" SEC_TYPE="ext2"
/dev/sdb1: UUID="883387f7-5ea1-24be-144b-6e2c08b0b3f5" TYPE="mdraid"
/dev/sdb2: UUID="194de9fc-0664-df3e-144b-6e2c08b0b3f5" TYPE="mdraid"
/dev/sdb5: UUID="a8109704-1853-04ba-144b-6e2c08b0b3f5" TYPE="mdraid"
/dev/md0: UUID="bc2cac48-ac26-45e9-8e5e-ebf1b36e843a" TYPE="ext3" SEC_TYPE="ext2"
/dev/md1: TYPE="swap" UUID="371fca33-dc30-470e-b6e2-d1fdc9560c26"
/dev/md2: UUID="1569212f-1e5b-4dea-815f-c789ffc0265c" TYPE="ext3"
And my grub config
Code:
/boot/grub # cat ./menu.lst                                   [root @ hostname]
# Untangle Server grub configuration
# Do not remove the next line without removing the package:
# ***Installed by untangle-linux-config package***

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 6
fallback 5

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout     5

# Use the Untangle splash for the grub menu
splashimage=(hd0,0)/boot/grub/utsplash.xpm.gz

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret


#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST


### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 lang=us apm=power-off screen=1024x768 nomce nodhcp nofstab panic=5
# kopt_2_6_26=root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 panic=5 hpet=disable

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=vga=791 quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(video safe mode) vga=791 quiet splash ut-video
# altoptions=(hardware safe mode) acpi=off noapic
# altoptions=(recovery mode) ut-restore

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=true

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=true

## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.32-bpo.5-686
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-bpo.5-686 root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 lang=us apm=power-off screen=1024x768 nomce nodhcp nofstab panic=5 vga=791 quiet splash
initrd          /boot/initrd.img-2.6.32-bpo.5-686
savedefault

title           Debian GNU/Linux, kernel 2.6.32-bpo.5-686 (video safe mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-bpo.5-686 root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 lang=us apm=power-off screen=1024x768 nomce nodhcp nofstab panic=5 vga=791 quiet splash ut-video
initrd          /boot/initrd.img-2.6.32-bpo.5-686
savedefault

title           Debian GNU/Linux, kernel 2.6.32-bpo.5-686 (hardware safe mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-bpo.5-686 root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 lang=us apm=power-off screen=1024x768 nomce nodhcp nofstab panic=5 acpi=off noapic
initrd          /boot/initrd.img-2.6.32-bpo.5-686
savedefault

title           Debian GNU/Linux, kernel 2.6.32-bpo.5-686 (recovery mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-bpo.5-686 root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 lang=us apm=power-off screen=1024x768 nomce nodhcp nofstab panic=5 ut-restore
initrd          /boot/initrd.img-2.6.32-bpo.5-686
savedefault

title           Debian GNU/Linux, kernel 2.6.26-1-untangle-686
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-untangle-686 root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 panic=5 hpet=disable vga=791 quiet splash
initrd          /boot/initrd.img-2.6.26-1-untangle-686
savedefault

title           Debian GNU/Linux, kernel 2.6.26-1-untangle-686 (video safe mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-untangle-686 root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 panic=5 hpet=disable vga=791 quiet splash ut-video
initrd          /boot/initrd.img-2.6.26-1-untangle-686
savedefault

title           Debian GNU/Linux, kernel 2.6.26-1-untangle-686 (video safe mode and RAID1)
root            (hd1,0)
kernel          /boot/vmlinuz-2.6.26-1-untangle-686 root=bc2cac48-ac26-45e9-8e5e-ebf1b36e843a
initrd          /boot/initrd.img-2.6.26-1-untangle-686
savedefault

title           Debian GNU/Linux, kernel 2.6.26-1-untangle-686 (hardware safe mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-untangle-686 root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 panic=5 hpet=disable acpi=off noapic
initrd          /boot/initrd.img-2.6.26-1-untangle-686
savedefault

title           Debian GNU/Linux, kernel 2.6.26-1-untangle-686 (recovery mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-untangle-686 root=UUID=657d47ff-72fa-45a9-abdb-8fc43c72877a ro ramdisk_size=100000 panic=5 hpet=disable ut-restore
initrd          /boot/initrd.img-2.6.26-1-untangle-686
savedefault

### END DEBIAN AUTOMAGIC KERNELS LIST
EDIT:
For the sake of troubleshooting I changed the 6th entry and still have the same symptoms
Code:
title           Debian GNU/Linux, kernel 2.6.26-1-untangle-686 (video safe mode and RAID1)
root            (hd1,0)
kernel          /boot/vmlinuz-2.6.26-1-untangle-686 root=UUID=bc2cac48-ac26-45e9-8e5e-ebf1b36e843a ro ramdisk_size=100000 panic=5 hpet=disable vga=791 quiet splash ut-video
initrd          /boot/initrd.img-2.6.26-1-untangle-686
savedefault

Last edited by q630; 07-07-2010 at 05:27 PM. Reason: Config change
 
Old 07-08-2010, 02:51 AM   #4
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 96
your "fuser -vm /dev/sda1" says your system is booted from /dev/sda1... If not menu.lst then fstab
 
Old 07-08-2010, 06:58 PM   #5
q630
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Original Poster
Rep: Reputation: 0
troop it appears you are correct. I commented out all the bootable options in the menu.lst except for the RAID1 option. On boot it says missing file line #15. So....q630<-linux newb, if I am booting from sda1 instead of md0 and md0 is not booting because of missing files, how do I get files from sda1 to md0 so that it will boot correctly? And once the files are there, since md0 contains /boot then I should be ok right? Cuz it seems like I'm doing the grub boot loader correctly, its just that it fails when pointing to md0.
 
Old 07-08-2010, 11:19 PM   #6
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 96
Quote:
Originally Posted by q630 View Post
if I am booting from sda1 instead of md0 and md0 is not booting because of missing files, how do I get files from sda1 to md0 so that it will boot correctly?
for example:
Code:
mkdir /mnt/old
mkdir /mnt/new
mount /dev/sda1 /mnt/old
mount /dev/md0 /mnt/new
cp -dpr /mnt/old /mnt/new
Quote:
Originally Posted by q630 View Post
And once the files are there, since md0 contains /boot then I should be ok right?
yes
 
Old 07-13-2010, 08:11 PM   #7
q630
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Original Poster
Rep: Reputation: 0
I'm sorry I haven't replied right away, been busy. I did exactly as you said for the mkdir and cp. Then I tried booting off the raid option, it gets further this time but seems like it hangs right after booting into the kernel and hardware detection. I DO believe my original question has been answered. My setup was STILL booting off of sda1 and thus the reason sda1 was busy and unable to add to md0. I'm sure I blew something up in a config or don't have proper mount points now so even though you gave me SOUND advice on copying the contents to md0, booting off my md0 fails. Guess I'll be reviewing Untangle's docs to figure out the original setup and mount points. Thanks Troop!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Device or resource busy oehq Linux - Hardware 1 01-20-2010 08:47 AM
Error opening PCM device Device or resource busy Herbivore Linux - Newbie 2 08-23-2008 01:45 AM
mdadm: device is busy yet not busy? disbeliever Linux - Server 7 07-24-2008 04:38 PM
Can't open audio device. Device or resource busy. deepumnit Linux - Software 2 06-16-2008 09:36 AM
Device or resource busy teeno Linux - Newbie 3 03-09-2004 10:12 AM


All times are GMT -5. The time now is 03:17 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration