Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
shutdown problem with / on raid device
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
bendy
Apprentice
Apprentice


Joined: 18 May 2002
Posts: 274
Location: Gloucester, UK

PostPosted: Thu Mar 12, 2009 7:21 pm    Post subject: shutdown problem with / on raid device Reply with quote

Hi,

I have gentoo installed with /boot on a regular disk partition and everything else on raid partitions. My /etc/fstab:
Code:
/dev/sda2               /boot           ext2            noauto,noatime  1 2
/dev/md1                /               ext3            noatime         0 1
/dev/sda3               none            swap            sw              0 0
/dev/md2                /home           ext3            noatime         0 0
/dev/md3                /var            reiserfs        noatime,notail  0 0
tmpfs                   /tmp            tmpfs           defaults,nosuid,size=1024M,mode=1777 0 0
/dev/md5                /work           xfs             noatime         0 0
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro       0 0
/dev/fd0                /mnt/floppy     auto            noauto          0 0

and my /etc/mdadm.conf:
Code:
ARRAY /dev/md1 level=raid0 num-devices=2 UUID=bc3bbaf3:6628c7ba:2b02e604:8457fd23
ARRAY /dev/md2 level=raid0 num-devices=2 UUID=b1cea3ab:38398ed5:e0899131:e0e10697
ARRAY /dev/md3 level=raid0 num-devices=2 UUID=54c94f7c:ef16bbe1:19e5e8a0:2413d932
ARRAY /dev/md4 level=raid0 num-devices=2 UUID=d6dbfe2b:fb028dde:2238324a:d30b674d
ARRAY /dev/md5 level=raid0 num-devices=2 UUID=a9989cd6:2d88afe3:fad10696:9af35823

This has been working fine for quite some time. However I recently decided to run my system ~arch as I had so many packages added to package.keywords file. This included an upgrade to gentoo-sources-2.6.28-r2, which I compiled with raid auto-detection.

The problem is that my system will no longer shut-down cleanly. I get:
Code:
* mdraid uses addon code which is deprecated
* and may not be available in the future.
* shutting down RAID devices (mdadm)...
mdadm : stopped /dev/md2
mdadm : stopped /dev/md3
mdadm : stopped /dev/md4
mdadm : stopped /dev/md5
mdadm: fail to stop array /dev/md1: Device or resource busy
Perhaps a running process, mounted filesystem or active volume group?
* ERROR: mdraid failed to stop
.
.
.
* Remounting remaining filesystems read-only...
* Remounting / read only...
INIT: no more processes left in this runlevel.

Then it freezes, although I can force it with alt-sysreq-u and alt-sysreq-b.

Anyone got any ideas what changed recently to stop my machine shutting down properly?

Thanks!
Back to top
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Fri Apr 17, 2009 1:40 pm    Post subject: Reply with quote

Hi,

This is just a warning that / can't be unmounted as its currently in use... I get this too, its nothing to worry about.

To get your system to power off you need to compile your APM or ACPI options as static rather than modules.

Hope this helps,

Rich
Back to top
View user's profile Send private message
JanSteen
n00b
n00b


Joined: 13 Feb 2005
Posts: 11
Location: Amsterdam/NL

PostPosted: Sat Apr 18, 2009 6:50 am    Post subject: shutdown problem with / on raid device Reply with quote

Hi,

Same problem here, started occurring very recently, since my last update I presume. Before, already for some months, I seem to remember that warning you also get,
Code:
* mdraid uses addon code which is deprecated
* and may not be available in the future.

It could be that that warning started appearing since I switched to OpenRC? Not sure.

Anyhow, lately my machine also refuses to power off, even though I do have (and already had) all ACPI options compiled into the kernel instead of as modules.

I'll post a reply if I find a solution; anybody else with the same trouble?

CS
Back to top
View user's profile Send private message
snailhead
n00b
n00b


Joined: 13 Nov 2006
Posts: 5

PostPosted: Sun May 10, 2009 4:25 am    Post subject: Re: shutdown problem with / on raid device Reply with quote

bendy wrote:
Hi,

I have gentoo installed with /boot on a regular disk partition and everything else on raid partitions. My /etc/fstab:
Code:
/dev/sda2               /boot           ext2            noauto,noatime  1 2
/dev/md1                /               ext3            noatime         0 1
/dev/sda3               none            swap            sw              0 0
/dev/md2                /home           ext3            noatime         0 0
/dev/md3                /var            reiserfs        noatime,notail  0 0
tmpfs                   /tmp            tmpfs           defaults,nosuid,size=1024M,mode=1777 0 0
/dev/md5                /work           xfs             noatime         0 0
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro       0 0
/dev/fd0                /mnt/floppy     auto            noauto          0 0

and my /etc/mdadm.conf:
Code:
ARRAY /dev/md1 level=raid0 num-devices=2 UUID=bc3bbaf3:6628c7ba:2b02e604:8457fd23
ARRAY /dev/md2 level=raid0 num-devices=2 UUID=b1cea3ab:38398ed5:e0899131:e0e10697
ARRAY /dev/md3 level=raid0 num-devices=2 UUID=54c94f7c:ef16bbe1:19e5e8a0:2413d932
ARRAY /dev/md4 level=raid0 num-devices=2 UUID=d6dbfe2b:fb028dde:2238324a:d30b674d
ARRAY /dev/md5 level=raid0 num-devices=2 UUID=a9989cd6:2d88afe3:fad10696:9af35823

This has been working fine for quite some time. However I recently decided to run my system ~arch as I had so many packages added to package.keywords file. This included an upgrade to gentoo-sources-2.6.28-r2, which I compiled with raid auto-detection.

The problem is that my system will no longer shut-down cleanly. I get:
Code:
* mdraid uses addon code which is deprecated
* and may not be available in the future.
* shutting down RAID devices (mdadm)...
mdadm : stopped /dev/md2
mdadm : stopped /dev/md3
mdadm : stopped /dev/md4
mdadm : stopped /dev/md5
mdadm: fail to stop array /dev/md1: Device or resource busy
Perhaps a running process, mounted filesystem or active volume group?
* ERROR: mdraid failed to stop
.
.
.
* Remounting remaining filesystems read-only...
* Remounting / read only...
INIT: no more processes left in this runlevel.

Then it freezes, although I can force it with alt-sysreq-u and alt-sysreq-b.

Anyone got any ideas what changed recently to stop my machine shutting down properly?

Thanks!




If I were guess, the script /lib/rcscripts/addons/raid-stop.sh changed, with the key line using mdadm -Ss (scan the config file and shutdown the listed raid devices). I would presume that using mdadm is the "new school"

Code:
[ -f /proc/mdstat ] || exit 0

# Stop software raid with mdadm (new school)
mdadm_conf="/etc/mdadm/mdadm.conf"
[ -e /etc/mdadm.conf ] && mdadm_conf="/etc/mdadm.conf"
if [ -x /sbin/mdadm -a -f "${mdadm_conf}" ] ; then
   ebegin "Shutting down RAID devices (mdadm)"
   output=$(mdadm -Ss 2>&1)
   ret=$?
   [ ${ret} -ne 0 ] && echo "${output}"
   eend ${ret}
fi





This is a pretty simple script called by halt.sh. I propose the following script instead, but it isn't simpler :?

Code:
[ -f /proc/mdstat ] || exit 0

# Stop software raid with mdadm, but check for md on root

mdadm_conf="/etc/mdadm/mdadm.conf"
[ -e /etc/mdadm.conf ] && mdadm_conf="/etc/mdadm.conf"
if [ -x /sbin/mdadm -a -f "${mdadm_conf}" ] ; then
   ebegin "Shutting down RAID devices (mdadm)"
   for i in `ls -t /dev/md` ; do
      mounted=`mount | egrep "md${i} on / "`
      if [ -n "${mounted}" ] ; then
         echo /dev/md${i} is mounted on root and should *not* be stopped
         ret=0
      fi
      if [ -z "${mounted}" ] ; then
         active=`cat /proc/mdstat | egrep active | egrep md${i}`
         ret=0
         if [ -n "${active}" ] ; then
            output=$(mdadm -S /dev/md${i})
            ret=$?
         fi
      fi
      [ ${ret} -ne 0 ] && echo "${output}" && return=$?
   done
   eend ${return}
fi
Back to top
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Sun May 10, 2009 9:45 am    Post subject: Reply with quote

Hi snailhead,

That new script would make more sense.

I don't list any md devices in my /etc/mdadm.conf file... come to think of it, I've never edited that file on any raid system I manage.

Perhaps you could submit a bug request for the relevant package and see if we can get this changed?

Rich.
Back to top
View user's profile Send private message
ClientAlive
n00b
n00b


Joined: 07 Jul 2011
Posts: 33

PostPosted: Mon Nov 28, 2011 11:31 pm    Post subject: Reply with quote

Me too but my system is a little more complex in how it's set up. I'm having difficulty finding related info.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum