Hi curaga
I've made the following changes:
1. The arbitration logic still queues up multiple scripts, but after the first script
exits, any scripts waiting in the queue will exit instead of processing fstab again.
2. I removed the test for 98) # User-mode virtual block devices. If someone creates
one of these devices and it contains a file system, the section labeled
### Loop through block devices will pick it up.
3. Added ext4 to ext2|ext3) OPTIONS="${OPTIONS},relatime" ;; test.
4. blkid now only gets called once with a filtered device list to process.
For consistency, I cleared the cache and ran the script 3 times with a fixed delay
for each benchmark.
Timing on Dell E310 desktop TC10 x86
rebuildfstab from git, shebang changed to bash so it would run under TC10:
tc@E310:~/rebuildfstab$ time sudo ./rebuildfstab.git; sleep 1; echo; time sudo ./rebuildfstab.git; sleep 1; echo; time sudo ./rebuildfstab.git
real 0m 1.02s
user 0m 0.18s
sys 0m 0.53s
real 0m 0.77s
user 0m 0.16s
sys 0m 0.37s
real 0m 0.83s
user 0m 0.15s
sys 0m 0.39s
My version of rebuildfstab:
tc@E310:~/rebuildfstab$ time sudo ./rebuildfstab.devlist; sleep 1; echo; time sudo ./rebuildfstab.devlist; sleep 1; echo; time sudo ./rebuildfstab.devlist
real 0m 0.48s
user 0m 0.04s
sys 0m 0.05s
real 0m 0.08s
user 0m 0.03s
sys 0m 0.04s
real 0m 0.13s
user 0m 0.03s
sys 0m 0.05s
The execution times have improved over my previous version:
... My version of rebuildfstab:
tc@E310:~/rebuildfstab$ time sudo ./rebuildfstab.rewrite
real 0m 0.72s
user 0m 0.06s
sys 0m 0.12s
tc@E310:~/rebuildfstab$ time sudo ./rebuildfstab.rewrite
real 0m 0.16s
user 0m 0.09s
sys 0m 0.06s
tc@E310:~/rebuildfstab$ time sudo ./rebuildfstab.rewrite
real 0m 0.23s
user 0m 0.07s
sys 0m 0.11s
...
A copy of the new version of the script is attached if anyone
wants to do any testing.