Skip to content

markuschaaf/linux-delay_power_off

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linux-delay_power_off

A simple Linux kernel module delaying power-off and restart, to allow for proper shutdown of devices, e.g. SATA disks.

There is a potential race between SATA disks shutting down and Linux powering down the platform. Symptoms are increasing SMART counters like "Power-Off_Retract_Count" or "Unsafe_Shutdown_Count", and filesystems reporting not being unmounted. (They have, but some sectors were not written.) See also https://lore.kernel.org/lkml/[email protected]/

Installation

$ git clone 'https://github.com/markuschaaf/linux-delay_power_off.git'
$ cd linux-delay_power_off
$ sudo make dkms-install

If and how to load the module depends on your distribution. It is probably best to add it to initrd. If you are using an Arch-like distribution:

...
$ make PKGBUILD
$ makepkg -si
$ sudo modprobe delay_power_off
$ sudoedit /etc/mkinitcpio.conf # add MODULES=(... delay_power_off)
$ sudo mkinitcpio -P

About

A simple Linux kernel module delaying power-off and restart.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published