Forums Search Login Register
New Posts Todays Posts Find Users Posts Unanswered Threads Help Mark Forums as Read

Thread Options  Subscribe to this thread Subscribed Users  Add Reply 
Posts: 1,393
I have tried to create a script to flush writecache buffer.
All commands works in terminal.

Tested in a VM installed Lubuntu 20.04.3.

The script was named K99 being executable and owner root.
The script was copied to /etc/init.d/ and created symbolic link to /etc/rc0.d/ and /etc/rc6.d/

The script is
sudo dmsetup message /dev/mapper/rc-wb_sda3 0 flush
sudo dmsetup suspend /dev/mapper/rc-wb_sda3
sudo dmsetup message /dev/mapper/rc-wb_sda4 0 flush
sudo dmsetup suspend /dev/mapper/rc-wb_sda4
sudo dmsetup message /dev/mapper/rc-wb_sda5 0 flush
sudo dmsetup suspend /dev/mapper/rc-wb_sda5
sudo dmsetup message /dev/mapper/rc-wb_sda6 0 flush
sudo dmsetup suspend /dev/mapper/rc-wb_sda6

exit 0


After copying the script and creating symbolic links was done shutdown command and GUI was finalized showing only the "shutdown screen terminal command" with the OS halted not being possible shutdown.
Thus I had forced a power off shutdown.
I next OS starting was done shutdown command. The OS not was halted, but running commands several times in "shutdown screen terminal command" and repeating the same commands not being possible shutdown the OS.

The script is correct ? All steps was correct ? Need more actions to work ?
I had searched in internet how create a script to run command in restart and shutdown, but unhappily is very much wrong information that not work.

Thanks for reply.
11-25-2021, 07:15 AM
Subscribe to this thread Subscribed Users  Add Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [ubuntu] How can I tell which architecture I'm running? ggiselamcgrrhe 0 8 11-13-2021 01:18 PM
Last Post: ggiselamcgrrhe
  [ubuntu] apache2 init script AshelyP1955 0 4 11-13-2021 05:16 AM
Last Post: AshelyP1955
  nike zapatillas mujer running Geraldine 0 7 11-13-2021 03:55 AM
Last Post: Geraldine
  How enable dm-writecache flush when OS shutdown ? oonnnasantosi 0 4 11-12-2021 08:19 PM
Last Post: oonnnasantosi
  Have any script does a command when a software loaded ? jindymas11 0 6 11-11-2021 05:23 AM
Last Post: jindymas11
  Trouble running updates on Rasberry PI Hoppytramp 0 18 11-04-2021 07:38 PM
Last Post: Hoppytramp
  icons of running wine apps do not appear on Dash after migration to 21.04 jindymas11 0 17 11-04-2021 05:43 AM
Last Post: jindymas11
  [ubuntu] linux is running but can't be rebooted meloygoodwinq 0 24 10-21-2021 07:20 AM
Last Post: meloygoodwinq
  [lubuntu] Computer won't shutdown Dogg the Booty Hunter 0 27 10-15-2021 11:52 AM
Last Post: Dogg the Booty Hunter
  Please assist with getting Psiphon Server running ftishabergers 0 31 09-20-2021 04:14 AM
Last Post: ftishabergers

Forum Jump:

User(s) browsing this thread: 1 Guest(s)

Contact Us Privacy Policy Top RSS
Forum Software By: MyBB, © 2002-2021