LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to unmount raid array or unable to stop raid array (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-unmount-raid-array-or-unable-to-stop-raid-array-4175469028/)

karthik-naren 07-09-2013 12:50 PM

unable to unmount raid array or unable to stop raid array
 
i have created three raid enabled partitions
sda{8,9,10,11}

partprobe

mdadm -C /dev/md0 -n4 /dev/sda{8,9,10,11} -l5

mkfs.ext3 /dev/md0

mkdir /raid

mount /dev/md0 /raid

vi /etc/fstab

mount -a

cp -rvf /lib /raid

cd /raid

dd if=/dev/zero of=bingo bs=1024 count=100000


mdadm -f /dev/md0 /dev/sda10

mdadm -D /dev/md0

Code:

/dev/md0:
        Version : 0.90
  Creation Time : Tue Jul  9 21:47:31 2013
    Raid Level : raid5
    Array Size : 602112 (588.10 MiB 616.56 MB)
  Used Dev Size : 200704 (196.03 MiB 205.52 MB)
  Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Tue Jul  9 22:25:50 2013
          State : clean, degraded
 Active Devices : 3
Working Devices : 3
 Failed Devices : 1
  Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 64K

          UUID : 2fb404f1:e83d88da:a2724c44:4c722220
        Events : 0.4

    Number  Major  Minor  RaidDevice State
      0      8        8        0      active sync  /dev/sda8
      1      8        9        1      active sync  /dev/sda9
      2      0        0        2      removed
      3      8      11        3      active sync  /dev/sda11

      4      8      10        -      faulty spare  /dev/sda10

watch cat /proc/mdstat

mdadm -r /dev/md0 /dev/sda10

mdadm -D /dev/md0

Code:

/dev/md0:
        Version : 0.90
  Creation Time : Tue Jul  9 21:47:31 2013
    Raid Level : raid5
    Array Size : 602112 (588.10 MiB 616.56 MB)
  Used Dev Size : 200704 (196.03 MiB 205.52 MB)
  Raid Devices : 4
  Total Devices : 3
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Tue Jul  9 22:30:03 2013
          State : clean, degraded
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 64K

          UUID : 2fb404f1:e83d88da:a2724c44:4c722220
        Events : 0.6

    Number  Major  Minor  RaidDevice State
      0      8        8        0      active sync  /dev/sda8
      1      8        9        1      active sync  /dev/sda9
      2      0        0        2      removed
      3      8      11        3      active sync  /dev/sda11

fdisk /dev/sda
partprobe
fdisk -l
mkfs.ext3 /dev/sda12


mdadm -a /dev/md0 /dev/sda12

mdadm -D /dev/md0

Code:

/dev/md0:
        Version : 0.90
  Creation Time : Tue Jul  9 21:47:31 2013
    Raid Level : raid5
    Array Size : 602112 (588.10 MiB 616.56 MB)
  Used Dev Size : 200704 (196.03 MiB 205.52 MB)
  Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Tue Jul  9 22:36:21 2013
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 64K

          UUID : 2fb404f1:e83d88da:a2724c44:4c722220
        Events : 0.8

    Number  Major  Minor  RaidDevice State
      0      8        8        0      active sync  /dev/sda8
      1      8        9        1      active sync  /dev/sda9
      2      8      12        2      active sync  /dev/sda12
      3      8      11        3      active sync  /dev/sda11

As I try to unmount,stop raid array this is the message i get

umount /raid

Code:

umount: /raid: device is busy
umount: /raid: device is busy

mdadm -S /dev/md0

Code:

mdadm: fail to stop array /dev/md0: Device or resource busy
Perhaps a running process, mounted filesystem or active volume group?


TB0ne 07-09-2013 01:14 PM

Quote:

Originally Posted by karthik-naren (Post 4987142)
i have created three raid enabled partitions sda{8,9,10,11}


As I try to unmount,stop raid array this is the message i get
umount /raid
Code:

umount: /raid: device is busy
umount: /raid: device is busy

mdadm -S /dev/md0

Code:

mdadm: fail to stop array /dev/md0: Device or resource busy
Perhaps a running process, mounted filesystem or active volume group?


Ok...so what's the problem? There's obviously a process/user that is accessing the mounted file system. So, either stop the process or log the user off.

karthik-naren 07-09-2013 01:25 PM

Quote:

Originally Posted by TB0ne (Post 4987156)
Ok...so what's the problem? There's obviously a process/user that is accessing the mounted file system. So, either stop the process or log the user off.


iam a newbie
could you please give detailed explaination.
i have logged in as root.

TB0ne 07-09-2013 01:54 PM

Quote:

Originally Posted by karthik-naren (Post 4987163)
iam a newbie
could you please give detailed explaination.

Not much more detail to add. As said, you cannot unmount a file system if something/someone is accessing it. So, either find the process that's accessing the disk, or make sure no one else is logged in. Since you've got the file system mounted as /raid, run "lsof /raid". That will list all the open files on that file system. The second column is the PID you need to kill if you want to unmount the file system.

If you have a terminal window open and you're in the /raid path somewhere, type in "cd /".
Quote:

i have logged in as root.
...which is NEVER a good idea, unless you're doing something that specifically requires it. Only log in as root sparingly, and use sudo whenever possible.


All times are GMT -5. The time now is 02:29 PM.