forked from rmarabini/scipionboxBenchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.sh
More file actions
20 lines (14 loc) · 694 Bytes
/
Copy pathclean.sh
File metadata and controls
20 lines (14 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
sync
for DISK in /dev/sd?
do
echo $DISK
echo 3 > /proc/sys/vm/drop_caches
blockdev --flushbufs $DISK
hdparm -F $DISK
done
#Explanation:
#sync: From the man page: flush file system buffers. Force changed blocks to disk, update the super block.
#echo 3 > /proc/sys/vm/drop_cache: from the kernel docs this will cause the kernel to drop clean caches
#blockdev --flushbufs /dev/sda: from the man page: call block device ioctls [to] flush buffers.
#hdparm -F /dev/sda: from the man page: Flush the on-drive write cache buffer (older drives may not implement this)
#Although the blockdev and hdparm commands look similar according to an answer above they issue different ioctls to the device.