mirror of
https://github.com/AltraMayor/f3.git
synced 2025-09-09 07:09:35 -04:00
commit
8f96a03112
14
Dockerfile
14
Dockerfile
@ -2,13 +2,13 @@ FROM ubuntu:18.04
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
less \
|
||||
libparted0-dev \
|
||||
libudev1 \
|
||||
libudev-dev \
|
||||
make \
|
||||
udev
|
||||
gcc \
|
||||
less \
|
||||
libparted0-dev \
|
||||
libudev1 \
|
||||
libudev-dev \
|
||||
make \
|
||||
udev
|
||||
|
||||
COPY . /f3
|
||||
|
||||
|
8
LICENSE
8
LICENSE
@ -1,7 +1,7 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
|
@ -22,4 +22,3 @@ Indices and tables
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
|
@ -91,7 +91,7 @@ available space for data. Below the result on my fake card:
|
||||
Slightly changed: 0.00 Byte (0 sectors)
|
||||
Overwritten: 0.00 Byte (0 sectors)
|
||||
Average Reading speed: 9.54 MB/s
|
||||
|
||||
|
||||
|
||||
This report shows that my flash card is pretty much garbage since it can
|
||||
only hold 1.02GB. ``f3write`` only writes to free space, and will not
|
||||
@ -107,7 +107,7 @@ correctly written by ``f3write``, and figure out in which file the
|
||||
sector should be and in which position in that file the sector should
|
||||
be. Thus, if a sector is well formed, or with a few bits flipped, but
|
||||
read in an unexpected position, ``f3read`` counts it as overwritten.
|
||||
Slightly changed sectors, are sectors at right position with a fews bits
|
||||
Slightly changed sectors, are sectors at right position with a few bits
|
||||
flipped.
|
||||
|
||||
Notice that ``f3write`` doesn't overwrite sectors by itself, it's done
|
||||
@ -206,7 +206,7 @@ output running F3 on it:
|
||||
Slightly changed: 0.00 Byte (0 sectors)
|
||||
Overwritten: 0.00 Byte (0 sectors)
|
||||
Average Reading speed: 9.42 MB/s
|
||||
|
||||
|
||||
|
||||
Since ``f3write`` and ``f3read`` are independent, ``f3read`` can be used
|
||||
as many times as one wants, although ``f3write`` is needed only once.
|
||||
@ -256,22 +256,22 @@ capacity is less than 8GB:
|
||||
|
||||
$ ./f3write --end-at=16 /media/michel/DISK_IMG/ && ./f3read /media/michel/DISK_IMG/
|
||||
Free space: 124.97 GB
|
||||
Creating file 1.h2w ... OK!
|
||||
Creating file 2.h2w ... OK!
|
||||
Creating file 3.h2w ... OK!
|
||||
Creating file 4.h2w ... OK!
|
||||
Creating file 5.h2w ... OK!
|
||||
Creating file 6.h2w ... OK!
|
||||
Creating file 7.h2w ... OK!
|
||||
Creating file 8.h2w ... OK!
|
||||
Creating file 9.h2w ... OK!
|
||||
Creating file 10.h2w ... OK!
|
||||
Creating file 11.h2w ... OK!
|
||||
Creating file 12.h2w ... OK!
|
||||
Creating file 13.h2w ... OK!
|
||||
Creating file 14.h2w ... OK!
|
||||
Creating file 15.h2w ... OK!
|
||||
Creating file 16.h2w ... OK!
|
||||
Creating file 1.h2w ... OK!
|
||||
Creating file 2.h2w ... OK!
|
||||
Creating file 3.h2w ... OK!
|
||||
Creating file 4.h2w ... OK!
|
||||
Creating file 5.h2w ... OK!
|
||||
Creating file 6.h2w ... OK!
|
||||
Creating file 7.h2w ... OK!
|
||||
Creating file 8.h2w ... OK!
|
||||
Creating file 9.h2w ... OK!
|
||||
Creating file 10.h2w ... OK!
|
||||
Creating file 11.h2w ... OK!
|
||||
Creating file 12.h2w ... OK!
|
||||
Creating file 13.h2w ... OK!
|
||||
Creating file 14.h2w ... OK!
|
||||
Creating file 15.h2w ... OK!
|
||||
Creating file 16.h2w ... OK!
|
||||
Free space: 108.97 GB
|
||||
Average writing speed: 2.87 MB/s
|
||||
SECTORS ok/corrupted/changed/overwritten
|
||||
@ -298,7 +298,7 @@ capacity is less than 8GB:
|
||||
Slightly changed: 0.00 Byte (0 sectors)
|
||||
Overwritten: 0.00 Byte (0 sectors)
|
||||
Average reading speed: 12.73 MB/s
|
||||
|
||||
|
||||
|
||||
After disconnecting the drive and connecting it back, ``f3read``
|
||||
produced the following output:
|
||||
@ -330,7 +330,7 @@ produced the following output:
|
||||
Slightly changed: 0.00 Byte (0 sectors)
|
||||
Overwritten: 0.00 Byte (0 sectors)
|
||||
Average reading speed: 12.50 MB/s
|
||||
|
||||
|
||||
|
||||
Notice that file 16.h2w, that last file ``f3write`` wrote, has no longer
|
||||
good sectors. What happened is that the last sectors of 16.h2w were in
|
||||
@ -365,7 +365,7 @@ file system, and obtained puzzling free space at the end of
|
||||
Creating file 14.h2w ... OK!
|
||||
Free space: 755.80 MB
|
||||
Average writing speed: 13.77 MB/s
|
||||
|
||||
|
||||
|
||||
This happened because ext2 and some other file systems reserve space for
|
||||
special purposes. So they don't allow ``f3write`` to use that reserved
|
||||
@ -467,7 +467,7 @@ does exactly that:
|
||||
::
|
||||
|
||||
$ truncate --size=/1M /media/michel/6135-3363/30.h2w
|
||||
|
||||
|
||||
|
||||
If you want to exchange files with H2testw users often, check out the
|
||||
shell script
|
||||
@ -575,15 +575,15 @@ choose the drive, not a partition.
|
||||
|
||||
::
|
||||
|
||||
$ lsblk
|
||||
$ lsblk
|
||||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
|
||||
sda 8:0 0 232.9G 0 disk
|
||||
sda 8:0 0 232.9G 0 disk
|
||||
+-sda1 8:1 0 218G 0 part /
|
||||
+-sda2 8:2 0 1K 0 part
|
||||
+-sda2 8:2 0 1K 0 part
|
||||
+-sda5 8:5 0 15G 0 part [SWAP]
|
||||
sdb 8:16 1 15.3G 0 disk
|
||||
sdb 8:16 1 15.3G 0 disk
|
||||
+-sdb1 8:17 1 15.3G 0 part /media/michel/A902-D705
|
||||
sr0 11:0 1 1024M 0 rom
|
||||
sr0 11:0 1 1024M 0 rom
|
||||
|
||||
If you get confused between "sdb" and "sdb1", don't worry, ``f3probe``
|
||||
will report the mistake and point out the proper one. However, I cannot
|
||||
@ -597,7 +597,7 @@ in the example below (please use the correct device!):
|
||||
::
|
||||
|
||||
$ sudo ./f3probe --destructive --time-ops /dev/sdb
|
||||
[sudo] password for michel:
|
||||
[sudo] password for michel:
|
||||
F3 probe 8.0
|
||||
Copyright (C) 2010 Digirati Internet LTDA.
|
||||
This is free software; see the source for copying conditions.
|
||||
@ -672,7 +672,7 @@ outputs:
|
||||
::
|
||||
|
||||
$ sudo ./f3probe --time-ops /dev/sdc
|
||||
[sudo] password for michel:
|
||||
[sudo] password for michel:
|
||||
F3 probe 8.0
|
||||
Copyright (C) 2010 Digirati Internet LTDA.
|
||||
This is free software; see the source for copying conditions.
|
||||
@ -757,14 +757,14 @@ blocks with ``f3write/f3read``. The test of my card went as follows:
|
||||
|
||||
$ ./f3write /media/michel/8A34-CED2/
|
||||
Free space: 7.84 GB
|
||||
Creating file 1.h2w ... OK!
|
||||
Creating file 2.h2w ... OK!
|
||||
Creating file 3.h2w ... OK!
|
||||
Creating file 4.h2w ... OK!
|
||||
Creating file 5.h2w ... OK!
|
||||
Creating file 6.h2w ... OK!
|
||||
Creating file 7.h2w ... OK!
|
||||
Creating file 8.h2w ... OK!
|
||||
Creating file 1.h2w ... OK!
|
||||
Creating file 2.h2w ... OK!
|
||||
Creating file 3.h2w ... OK!
|
||||
Creating file 4.h2w ... OK!
|
||||
Creating file 5.h2w ... OK!
|
||||
Creating file 6.h2w ... OK!
|
||||
Creating file 7.h2w ... OK!
|
||||
Creating file 8.h2w ... OK!
|
||||
Free space: 0.00 Byte
|
||||
Average writing speed: 4.64 MB/s
|
||||
|
||||
|
@ -230,7 +230,7 @@ static const struct unit_test_item ftype_to_params[] = {
|
||||
/* Extreme case for memory usage (limbo drive). */
|
||||
{(1ULL<<20)+512,1ULL << 40, 40, 9, -1, false},
|
||||
|
||||
/* Geomerty of a real limbo drive with 256MB of strict cache. */
|
||||
/* Geometry of a real limbo drive with 256MB of strict cache. */
|
||||
{7600799744ULL, 67108864000ULL, 36, 9, 19, true},
|
||||
|
||||
/* The drive before with a non-strict cache. */
|
||||
|
4
f3read.c
4
f3read.c
@ -404,7 +404,7 @@ static void iterate_files(const char *path, const long *files,
|
||||
if (has_enough_measurements(&fw)) {
|
||||
pr_avg_speed(get_avg_speed(&fw));
|
||||
} else {
|
||||
/* If the drive is too fast for the measuments above,
|
||||
/* If the drive is too fast for the measurements above,
|
||||
* try a coarse approximation of the reading speed.
|
||||
*/
|
||||
int64_t total_time_ms = delay_ms(&t1, &t2);
|
||||
@ -426,7 +426,7 @@ int main(int argc, char **argv)
|
||||
.start_at = 0,
|
||||
.end_at = LONG_MAX - 1,
|
||||
.max_read_rate = 0,
|
||||
/* If stdout isn't a terminal, supress progress. */
|
||||
/* If stdout isn't a terminal, suppress progress. */
|
||||
.show_progress = isatty(STDOUT_FILENO),
|
||||
};
|
||||
|
||||
|
@ -320,7 +320,7 @@ static int fill_fs(const char *path, long start_at, long end_at,
|
||||
if (has_enough_measurements(&fw)) {
|
||||
pr_avg_speed(get_avg_speed(&fw));
|
||||
} else {
|
||||
/* If the drive is too fast for the measuments above,
|
||||
/* If the drive is too fast for the measurements above,
|
||||
* try a coarse approximation of the writing speed.
|
||||
*/
|
||||
int64_t total_time_ms = delay_ms(&t1, &t2);
|
||||
@ -360,7 +360,7 @@ int main(int argc, char **argv)
|
||||
.start_at = 0,
|
||||
.end_at = LONG_MAX - 1,
|
||||
.max_write_rate = 0,
|
||||
/* If stdout isn't a terminal, supress progress. */
|
||||
/* If stdout isn't a terminal, suppress progress. */
|
||||
.show_progress = isatty(STDOUT_FILENO),
|
||||
};
|
||||
|
||||
|
@ -580,13 +580,13 @@ static int wait_for_reset(struct udev *udev, const char *id_serial,
|
||||
action = udev_device_get_action(dev);
|
||||
new_size_byte = get_udev_dev_size_byte(dev);
|
||||
if (!strcmp(action, "add")) {
|
||||
/* Deal with the case in wich the user pulls
|
||||
/* Deal with the case in which the user pulls
|
||||
* the USB device.
|
||||
*
|
||||
* DO NOTHING.
|
||||
*/
|
||||
} else if (!strcmp(action, "change")) {
|
||||
/* Deal with the case in wich the user pulls
|
||||
/* Deal with the case in which the user pulls
|
||||
* the memory card from the card reader.
|
||||
*/
|
||||
|
||||
@ -712,7 +712,7 @@ static int bdev_manual_usb_reset(struct device *dev)
|
||||
bdev->fd = bdev_open(bdev->filename);
|
||||
if (bdev->fd < 0) {
|
||||
rc = - errno;
|
||||
warn("Can't REopen device `%s'", bdev->filename);
|
||||
warn("Can't reopen device `%s'", bdev->filename);
|
||||
goto usb_dev;
|
||||
}
|
||||
|
||||
@ -808,7 +808,7 @@ static int bdev_usb_reset(struct device *dev)
|
||||
bdev->fd = bdev_open(bdev->filename);
|
||||
if (bdev->fd < 0) {
|
||||
int rc = - errno;
|
||||
warn("Can't REopen device `%s'", bdev->filename);
|
||||
warn("Can't reopen device `%s'", bdev->filename);
|
||||
return rc;
|
||||
}
|
||||
return 0;
|
||||
|
@ -60,7 +60,7 @@ const char *dev_get_filename(struct device *dev);
|
||||
* batch writes or reads.
|
||||
*
|
||||
* It must be a power of 2 greater than, or equal to 2^20.
|
||||
* The current vaule is 1MB.
|
||||
* The current value is 1MB.
|
||||
*/
|
||||
#define BIG_BLOCK_SIZE_BYTE (1 << 20)
|
||||
|
||||
|
@ -193,7 +193,7 @@ static inline int is_rate_above(const struct flow *fw,
|
||||
static inline int is_rate_below(const struct flow *fw,
|
||||
uint64_t delay, double inst_speed)
|
||||
{
|
||||
/* We use logical and here to enforce both limist. */
|
||||
/* We use logical and here to enforce both limits. */
|
||||
return delay <= fw->delay_ms && inst_speed < fw->max_process_rate;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ struct flow {
|
||||
int progress;
|
||||
/* Block size in bytes. */
|
||||
int block_size;
|
||||
/* Delay intended between measurements in miliseconds. */
|
||||
/* Delay intended between measurements in milliseconds. */
|
||||
unsigned int delay_ms;
|
||||
/* Increment to apply to @blocks_per_delay. */
|
||||
int64_t step;
|
||||
|
@ -159,7 +159,7 @@ static int write_bisect_blocks(struct device *dev,
|
||||
|
||||
assert(n_blocks >= 1);
|
||||
|
||||
/* Find coeficients of function a*idx + b where idx <= max_idx. */
|
||||
/* Find coefficients of function a*idx + b where idx <= max_idx. */
|
||||
assert(left_pos < right_pos);
|
||||
assert(right_pos - left_pos >= 2);
|
||||
*pb = left_pos + 1;
|
||||
|
@ -209,7 +209,7 @@ void fill_buffer_with_block(void *buf, int block_order, uint64_t offset,
|
||||
|
||||
/* The offset is known by drives,
|
||||
* so one doesn't have to encrypt it.
|
||||
* Plese don't add @salt here!
|
||||
* Please don't add @salt here!
|
||||
*/
|
||||
int64_array[0] = offset;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user