Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: USB crucial file recovery
Date: Thu, 01 Sep 2016 12:41:54
Message-Id: 1937527.eYMtyCFksh@serenity
In Reply to: Re: [gentoo-user] Re: USB crucial file recovery by Alan McKinnon
1 On Wednesday, August 31, 2016 11:45:15 PM Alan McKinnon wrote:
2 > On 31/08/2016 17:25, Grant wrote:
3 > >> Which NTFS system are you using?
4 > >>
5 > >> ntfs kernel module? It's quite dodgy and unsafe with writes
6 > >> ntfs-ng on fuse? I find that one quite solid
7 > >
8 > > I'm using ntfs-ng as opposed to the kernel option(s).
9 >
10 > I'm offering 10 to 1 odds that your problems came from ... one that you
11 > yanked too soon
12
13 (pardon the in-line snip, while I get on my soap box)
14
15 The likelihood of this happening can be greatly reduced by setting
16 vm.dirty_bytes to something like 2097125 and vm.dirty_background_bytes to
17 something like 1048576. This prevents the kernel from queuing up as much data
18 for sending to disk. The application doing the copy or write will normally
19 report "complete" long before writes to slow media are actually...complete.
20 Setting vm.dirty_bytes to something low prevents the kernel's backlog of data
21 from getting so long.
22
23 vm.dirty_bytes has another, closely-related setting, vm.dirty_bytes_ratio.
24 vm.dirty_bytes_ratio is a percentage of RAM that is used for dirty bytes. If
25 vm.dirty_bytes_ratio is set, vm.dirty_bytes will read 0. If vm.dirty_bytes is
26 set, vm.dirty_bytes_ratio will read 0.
27
28 The default is for vm.dirty_bytes_ratio to be 20, which means up to 20% of
29 your memory can find itself used as a write buffer for data on its way to a
30 filesystem. On a system with only 2GiB of RAM, that's 409MiB of data that the
31 kernel may still be waiting to push through the filesystem layer! If you're
32 writing to, say, a class 10 SDHC card, the data may not be at rest for another
33 40s after the application reports the copy operation is complete!
34
35 If you've got a system with 8GiB of memory, multiply all that by four.
36
37 The defaults for vm.dirty_bytes and vm.dirty_background_bytes are, IMO, badly
38 broken and an insidious source of problems for both regular Linux users and
39 system administrators.
40
41 --
42 :wq

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Re: USB crucial file recovery Rich Freeman <rich0@g.o>
Re: [gentoo-user] Re: USB crucial file recovery "J. Roeleveld" <joost@××××××××.org>