Bug#725284: Bug#779412: block devices loosing state after resume: trigger udev rules to re-apply settings

Michael Biebl <[email protected]>
Newsgroups gmane.linux.debian.devel.bugs.general,gmane.linux.raid,gmane.linux.utilities.smartmontools
Message-ID <[email protected]>
Am 28.02.2015 um 09:30 schrieb Chris:
> (http://bugs.debian.org/779412 explanation)
> 
> There is a general problem with non-permanent block devices settings
> (hard disks, optical disks, usb storage, ...), that are not restored 
> when resuming from suspend (instead using factory defaults and 
> loosing all pre-suspend settings).
> 
> And as long as the ata/scsi command set drivers can not save and
> restore every state register a device may have (impossible?),
> systemd may ship a viable workaround for this:
> 
> A systemd unit file could trigger an udev change action upon resume for
> block devices. This way the same udev rules that set up the devices when
> they are first plugged, will re-apply their settings after resume.
> 
> Providing this centrally with the systemd package could avoid that 
> multiple packages ship their own files, resulting in multiple change 
> events triggerd on each resume.
> 
> Examples for very important (non-permanent) settings are with
> hdparm (i.e. the important -B hard disk wear settings)
> https://bugs.debian.org/725284
> smartctl/mdadm/lvm/btrfs/zfs/... (i.e. set error recovery timeouts to
> prevent controller resets and data loss)
> http://sourceforge.net/p/smartmontools/mailman/message/33501936/
> 

I don't think working around this in udev/systemd is a good idea.
After all, most of those custom settings aren't applied via udev rules
anyway. This should be fixed in the kernel properly (or the individual
services) and not be papered over in systemd.

Marco, what do you think?

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJU8X6DAAoJEGrh3w1gjyLcWqQP/3wNj6WPHlRaCS+skY5fdZBv
2/ToQbPFqha5wol7qu+g8gbnJ7yPMXYpdb8dKGbZYE4S7n+hTN2VueI4cqcHvZnV
AbMmdDZk95U4ac6yD2B3j24fb0ZK2U+N7PqmXDQFxuQMqtvccSn0pqe/s9eGwcVi
/Bjy52EYk1A0NkLYO85vokWcTiHkOuKsuSAwiVkOE/PmSkYG8rlMC1U9qL8xskIo
xCqFc7P2rU9LecgUZxET3AirJDKgwwXheQled+NscbEzcMgt7Hgyi9W7VQivXHUv
QTfAz3oODnObukQ7623VfSfKPAAtgu+jnbilYb/i55KvMsU1wf3tIJh86EKW2HCg
bAm7CvNhS0DB8nS+nz0FHFLsozf39DnVTBzV4dRyLel3JYLAGpvtV7/vFOXbmgCF
JNkYTU59bhzF70BiVTQxlPRfrz3KIaBjKRiqkal4rLJiXkJJz+i12UJWws0DjpGR
Ex5xSZFg27OdRdWIwutJ1DdhdBIp7YUQOCDi6klI4awtsOv6TOir9zb1N3Ysbfof
9q/ujQM09jjG6Wqg7cw4VNAjRY2761oKXR830ot7H6sPnNqHaRp9uYg9SP3rLaju
Uj8bUFjo9jICaNNo+fuMoy8DFOnQkxVHWCksY1iou42FMnTySwTFGARI1hr6gQAs
h5irqC1/V/33HWoV3Xg0
=SS7l
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.