Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] mdadm & acpi S3: what are the options
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
jpsollie
Guru
Guru


Joined: 17 Aug 2013
Posts: 324

PostPosted: Sat Aug 19, 2023 4:45 am    Post subject: [SOLVED] mdadm & acpi S3: what are the options Reply with quote

I'd like to set a gentoo-based NAS device in acpi S3 during the night (and send a magic packet when I need it again) to save power.
Unfortunately, there's an issue with one of the drives when resuming:
Code:

[  140.017840] md/raid:md1: Disk failure on sdan, disabling device.
[  140.017843] md/raid:md1: Operation continuing on 9 devices.
[  140.017879] md1_raid6: attempt to access beyond end of device
               sdaq: rw=395265, sector=8, nr_sectors = 1 limit=0
[  140.017892] md: super_written gets error=-5
[  140.017894] md/raid:md1: Disk failure on sdaq, disabling device.
[  140.017896] md/raid:md1: Operation continuing on 9 devices.
[  140.017919] md1_raid6: attempt to access beyond end of device
               sdap: rw=395265, sector=8, nr_sectors = 1 limit=0
[  140.017922] md: super_written gets error=-5
[  140.017923] md/raid:md1: Disk failure on sdap, disabling device.
[  140.017925] md/raid:md1: Operation continuing on 8 devices.

it looks like md subsystem is trying to access the disks before they are actually ready. It kicks out the device, whereas it should simply wait a bit and it will be ok.
Anybody who knows some tricks here to "guide" the kernel when resuming from S3?
_________________
The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img]


Last edited by jpsollie on Thu Aug 24, 2023 10:25 am; edited 1 time in total
Back to top
View user's profile Send private message
jpsollie
Guru
Guru


Joined: 17 Aug 2013
Posts: 324

PostPosted: Thu Aug 24, 2023 10:24 am    Post subject: Reply with quote

I kinda found a solution myself. Just posting here in case anybody would like to see:

elogind has a way to specify what needs to be done before and after suspend.
So I made sure all arrays are properly unmounted before and afterwards remounted:

Code:

linuxserver # cat /lib64/elogind/system-sleep/hddtimings.sh
#!/bin/bash
case $1/$2 in
  pre/*)
    # the HP disk doesn't like "sync" before when it's still in "sleep" state, so power it on first
        sg_start /dev/disk/by-id/ata-MB4000GDUPB_55S6K0ZAF17A
#umount filesystems attached to raid volumes
        /etc/init.d/nfs stop
        umount /data/md0
        umount /data/md1
        /etc/init.d/mdraid stop
    ;;
  post/*)
    # first, we rescan _EVERYTHING_  related to disk drives on the system: all controllers, all disks, ... everything needs to be rescanned:
        for i in /sys/class/scsi_host/host*/scan; do echo "- - -" > $i; done
        for i in /sys/block/sd*/device/rescan; do echo 1 > $i; done
 #rebuild the raid arrays
        /etc/init.d/mdraid start
        mount /data/md1
        mount /data/m0
        /etc/init.d/nfs start
    ;;
esac


but: do not forget to deactivate the mdraid rules in udev! as long as udev starts assembling them on resume, this won't help a lot.
you'll unfortunately need to specify everything in mdadm.conf from now on, but no pain no gain
_________________
The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img]
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