07-03-2012
Alright, I get your point. I though that using /dev/sdb1 moves to position 0
AFAIK hdparm only gives you the speed of the disk and not the time of reading a given amount of data.
So far with my tests I find that reading 16kb takes about the same time as reading 512b. I need this information to set the optimal page size of my system (oracle and mysql suggest these sizes)
Can you elaborate on why dropping the caches is a bad idea?
How about this sudo procedure:
- drop_caches
- flush disk-cache with hdparm
- make sure dd is in memory
- position the read head randomly on disk
- with DD: read X amount of bytes from the beginning of my file (this is timed)
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Im looking to get the statistics on a machine
memory, cpu speed drive size etc
thanks in advance (3 Replies)
Discussion started by: simplimarvelous
3 Replies
2. Solaris
Hi ......
I have file system problem when i try to mount get the following message :
mount: /dev/rdsk/c1t4d0s7 not a block device ....
I run fsck it's ok ,,,, after run
newfs -N /dev/dsk/c1t4d0s7 and
fsck -o b=535952 /dev/dsk/c1t4d0s7 .............it's ok ........
At the and when i try... (2 Replies)
Discussion started by: tt155
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I am triying to make sure that there exists only one file with the pattern abc* in path /path/. This directory is having many huge files. If there is only one file then I have to take its complete name only to use furter in my script.
I am planning to do like this:
if ; then... (2 Replies)
Discussion started by: new_learner
2 Replies
4. Linux
We are intending to protect a set of user specified files using LVM mirroring where the protected space on which the user files are stored is mirrored on an LV on a different disk. Our problem is that for a user with a custom layout has installed linux with 2 partitons for swap and / and there is... (0 Replies)
Discussion started by: kickdgrass
0 Replies
5. Red Hat
Hi friends,
I wanna know how to block USB devices in my RedHat flavor Operating system.
regards,
Prakash (3 Replies)
Discussion started by: prakashkumar41
3 Replies
6. Shell Programming and Scripting
I talked with this guy who seems to think loop mounting a fs ext3 image on a directory, as opposed to just using the underlying filesystem, will work better as far as IO conflicts. I have no idea why this would be better? I haven't been able to contact him.
Basically we have a daemon that... (0 Replies)
Discussion started by: stevenswj
0 Replies
7. Linux
I use CentOS
I talked with this guy who seems to think loop mounting a fs ext3 image on a directory, as opposed to just using the underlying filesystem, will work better as far as IO conflicts. I have no idea why this would be better? I haven't been able to contact him.
Basically we have a... (1 Reply)
Discussion started by: stevenswj
1 Replies
8. Shell Programming and Scripting
Hello everyone
I am finishing a script allowing me to purge logs on multiple servers, i have one last pb with the ssh command.........it is throwing me the following error :
tcgetattr: Inappropriate ioctl for device (full screen in attached file 1, full script in attached file 2)
It... (15 Replies)
Discussion started by: jimmy75_13
15 Replies
9. UNIX for Advanced & Expert Users
Currently I am using this laborious command
lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}'
Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies
10. OS X (Apple)
Mac Version 10.15.2 (macOS Catalina)
Does anyone know how to change the name of a connected bluetooth device from the command line on macOS?
I am having trouble with various bluetooth devices which I cannot get the "rename" option in the GUI to "save" properly and so I cannot rename a few... (0 Replies)
Discussion started by: Neo
0 Replies
FSYNC(2) Linux Programmer's Manual FSYNC(2)
NAME
fsync, fdatasync - synchronize a file's in-core state with storage device
SYNOPSIS
#include <unistd.h>
int fsync(int fd);
int fdatasync(int fd);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
fsync(): _BSD_SOURCE || _XOPEN_SOURCE
|| /* since glibc 2.8: */ _POSIX_C_SOURCE >= 200112L
fdatasync(): _POSIX_C_SOURCE >= 199309L || _XOPEN_SOURCE >= 500
DESCRIPTION
fsync() transfers ("flushes") all modified in-core data of (i.e., modified buffer cache pages for) the file referred to by the file
descriptor fd to the disk device (or other permanent storage device) so that all changed information can be retrieved even after the system
crashed or was rebooted. This includes writing through or flushing a disk cache if present. The call blocks until the device reports that
the transfer has completed. It also flushes metadata information associated with the file (see stat(2)).
Calling fsync() does not necessarily ensure that the entry in the directory containing the file has also reached disk. For that an
explicit fsync() on a file descriptor for the directory is also needed.
fdatasync() is similar to fsync(), but does not flush modified metadata unless that metadata is needed in order to allow a subsequent data
retrieval to be correctly handled. For example, changes to st_atime or st_mtime (respectively, time of last access and time of last modi-
fication; see stat(2)) do not require flushing because they are not necessary for a subsequent data read to be handled correctly. On the
other hand, a change to the file size (st_size, as made by say ftruncate(2)), would require a metadata flush.
The aim of fdatasync() is to reduce disk activity for applications that do not require all metadata to be synchronized with the disk.
RETURN VALUE
On success, these system calls return zero. On error, -1 is returned, and errno is set appropriately.
ERRORS
EBADF fd is not a valid open file descriptor.
EIO An error occurred during synchronization.
EROFS, EINVAL
fd is bound to a special file which does not support synchronization.
CONFORMING TO
4.3BSD, POSIX.1-2001.
AVAILABILITY
On POSIX systems on which fdatasync() is available, _POSIX_SYNCHRONIZED_IO is defined in <unistd.h> to a value greater than 0. (See also
sysconf(3).)
NOTES
On some UNIX systems (but not Linux), fd must be a writable file descriptor.
In Linux 2.2 and earlier, fdatasync() is equivalent to fsync(), and so has no performance advantage.
The fsync() implementations in older kernels and lesser used filesystems does not know how to flush disk caches. In these cases disk
caches need to be disabled using hdparm(8) or sdparm(8) to guarantee safe operation.
SEE ALSO
bdflush(2), open(2), sync(2), sync_file_range(2), hdparm(8), mount(8), sync(8), update(8)
COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2012-02-27 FSYNC(2)