-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writeback enabled in OS boot and data not are being written in OS shutdown #69
Comments
another detail. |
That is because there is no procedure to flush the data to the backing store. I automatically do this in the "unmap" routine but that may not be possible in such a setup. You may need to write and configure a shutdown script such as an rc or systemd service file to run a command like this:
|
All right with you ? I wait that yes. A long reply. VM using 1.28 GB with a 10 GB installed Lubuntu 20.04.3 kernel 5.11. sda1 8 mb bios-grub Lines added in rapiddisk_hookmanual_add_modules dm-writecache rapiddisk_sub.orig#!/bin/sh modprobe -v rapiddisk rapiddisk -a RAMDISKSIZE exit 0 Rapiddisk was correctly installed and configurated in initramfs. I have created the script below to flush data. All commands work in terminal. Script named K99 -- exit 0 -- After created a script to flush data doing executable and root owner being copied to /etc/rc0.d/ and /etc/rc6.d/ waiting to flush cache in restart and shutdown. Thus had recovered a VM image backup. Not copying the flush data script to /etc/rc0.d/ and /etc/rc6.d/ and only done install_initrd.sh. After the OS is started running rapiddisk -l shown all cache was created in OS startup. The message from previous screenshot is to be ignored ? Running dmsetup ls I have done tests installing some softwares and restarting the OS the data not was flushed meaning the writecache is working. Rapiddisk repository not is the local to create questions about how create script thus I had searched how to create a script to run in restart and shutdown. Very much wrong informations and users posting how "doing it" scripts "works". Users trying to do good actions with wrong information. Please I need information about questions below to do more tests and thus report any information. 1 ) In screenshot have the message unsupported sectors In dm-writecache block size
About the "unsupported sectors" is to be ignored ? If not the dm-writecache block size need to be configured when creating the writecache buffer ? 2 ) In screenshot below rapiddiskd.service not is running, but the writecache is working. Rapiddisk writecache need rapiddiskd.service running to avoid any problem ? 3 ) What task does rapiddisk when the writeback cache is full ? The data is flushed ? If yes is totally ? If not the filesystem metadata is being updated even not flushed totally the file in disk ? That information help to understand because happen issues when restarting the OS not being possible complete the OS startup. 4 ) About the script below have anything wrong ? The script is executable and root owner. Any simple reply help to search how fix. File name K99 -- #!/bin/bash exit 0 -- 5 ) Seeing in have information how configure the writecache, but not have any information in what command line to do any option. Thanks very much for your reply. |
To date, rapiddisk-cache does not support 4K block sizes. Dm-writecache may support it. I will check that out in my environment and if it does, I will adjust both the documentation and user space utility to reflect that. I look at logical block size reported by the underlying block subsystem.
No, rapiddiskd.service is not required to get the cache running. The daemon or service is only used for network management. It provides a REST API for external management of the rapiddisk suite. Now, I am not sure why it is not running in your environment (unless you never started/enabled it). But again, it is not a requirement.
I am not sure when it does its flushing. I did not write dm-writecache. I only wrote the other modules. The module documentation provides a little bit more information: https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/writecache.html
I am not sure why you are using suspend. A flush should be the only thing required.
Again, the module documentation provides more details: https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/writecache.html BUT I did not add any tunable functions to my implementation. That enhancement request is already captured in your ticket: #62 |
Thanks very much for reply. "To date, rapiddisk-cache does not support 4K block sizes. Dm-writecache may support it. I will check that out in my environment and if it does, I will adjust both the documentation and user space utility to reflect that. I look at logical block size reported by the underlying block subsystem." "The daemon or service is only used for network management. It provides a REST API for external management of the rapiddisk suite. Now, I am not sure why it is not running in your environment (unless you never started/enabled it)" "I am not sure when it does its flushing. I did not write dm-writecache. I only wrote the other modules. The module documentation provides a little bit more information: https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/writecache.html" "I am not sure why you are using suspend. A flush should be the only thing required." "BUT I did not add any tunable functions to my implementation. That enhancement request is already captured in your ticket:" I only want to do some tests using virtual machines to figure how load writeback cache in OS startup and also how flush cache, but had happened issues thus I need to do test to figure how avoid the issues and report here to others users. I see in #68 being install script updated, but i not understand if creating a wa and wb caches in same root partition can damage the file system. In moment trying figure because script not is running in shutdown and restart. I will to do more test and report any information here. Thanks very much. |
Tested in several VMs images. Created a script and systemd to run in OS restart and shutdown. The script "flush.sh" saved in /home/user #!/bin/bash exit 0 The systemd service run in shutdown and restart saved in /etc/systemd/system/flush.service [Unit] [Service] [Install] After run the commands Few tests showing all caches was flushed. Have two problems happening :
Is how if /opt not is being mounted. Trying figure a solution to 2 problems above after need create a script systemd that automatically read the rapiddisk_sub.orig inside commands creating a script and systemd service. |
The 2 issues in previous reply not are happening in real machine, but have another problem. |
Thank you for doing this research. |
@pkoutoupis I have tested for few day with not issues using flush script when shutdown, but had happened a problem when the machine had entered stand by power mode. Need remove nvidia suspend service and add in script to run before stand by mode. |
@Augusto7743 I noticed that rapiddisk writeback mode used in conjunction with LVM seems not to suffer of the missing "last flush" on shutdown - I am not sure though, I just noticed this behaviour on a virtual machine once, but I didn't do any further tests and maybe I am totally off topic... |
Editing
rapiddisk_hook
adding in line 31
manual_add_modules dm-writecache
and in file rapiddisk_sub.orig
adding in line 5
modprobe -v dm-writecache
and add in line7
rapiddisk -a 128
rapiddisk -a 256
rapiddisk -m rd0 -b /dev/sda2 -p wb
rapiddisk -m rd0 -b /dev/sda3 -p wb
and after running the script install_initrd.sh rapiddisk cache and dm-writeback are loaded in OS startup.
The problem is data not are being written in disk when the OS shutdown.
I had installed a Lubuntu (Ubuntu) 20.04.3 in VirtualBox for testing thus being
sda1 ext4 boot
sda2 btrfs root
sda3 btrfs home
BTRFS not is configured to compress and disabled internal writeback (not really work).
In OS boot log is displayed
"
ERROR unsupported sector size 4096 on /dev/dm-1.
ERROR unsupported sector size 4096 on /dev/dm-0.
"
I not understand if has any detail related with not written data or if user need only ignore the message.
Running the command is displayed
systemctl status rapiddiskd.service
Loaded: loaded (/etc/systemd/system/rapiddiskd.service; disabled; vendor preset: enabled
Active: inactive (dead)
Strange even done systemctl enable rapiddiskd.service is displayed the status message above.
For the systemctl status display module being active need run systemctl start rapiddiskd.service.
I not understand if rapiddisk service is really running or user need ignore that message.
Running command below display
rapiddisk -l
List of rapiddisk device
rd0 131072
rd1 262144
List of rapiddisk-cache mapping
dm-writecache Target 1: rc-wb_sda2 Cache: rd0 Target sda2 (WRITEBACK)
dm-writecache Target 2: rc-wb_sda3 Cache: rd1 Target sda3 (WRITEBACK)
For test I had installed one software (Stacer).
In Stacer is displayed since OS was started only 4 MB was written on disk.
Doing a OS shutdown or restart the software Stacer not is listed how being installed.
Files not are being written on disk.
Seeing in task manager Htop RAM usage is more high when trying write data on disk thus means rapiddisk is working.
Have any command or configuration for Rapiddisk flush data on disk or need configure or a command in dm-writecache for flush data on disk ?
Thanks for your reply.
Have a nice day.
The text was updated successfully, but these errors were encountered: