[SOLVED] Re: Riddling activity on encrypted and mounted partition

2020-09-29 Thread Thomas Schmitt
Hi,

Andy Smith wrote:
> your reply doesn't make it clear to me whether the
> lazy init was the cause of your writes or not.

It seems so.

The disk is mounted without i/o being counted in /sys/block/sda/sda2/stat .

If only half of the 733702 write ops of mkfs.ext4 were due to lazy_*=0,
then they would keep with lazy_*=1 the disk busy for more than 6 hours at
16 ops per second. This matches my initial observation that it lasted for
at least one hour.

But in the end i can only say for sure that the drive LED behaves like
before i mounted the lazily created ext4 in its encrypted partition.
I had ext4 before. So my suspicions were rather directed towards the
encryption, which is new for me. Now the whole story matches lazy ext4
creation, regardless of encryption.


Have a nice day :)

Thomas



Re: [SOLVED] Re: Riddling activity on encrypted and mounted partition

2020-09-29 Thread Andy Smith
On Tue, Sep 29, 2020 at 01:02:35PM +0200, Thomas Schmitt wrote:
> Andy Smith wrote:
> > Create with:
> >mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0
> 
> This lasts significantly longer than my first mkfs run.
> The drive makes ~ 1950 write operations per second. So i estimate that
> the job would have lasted hours with ~ 16 writes per second.
> In the end mkfs.ext4 caused 733702 write ops on the 3.6 TB partition.
> 
> Ok. New UUID into fstab ... mount ... mkdir ... touch ... Yay !
> 
> The i/o is still lazy (no wonder with 32 GB RAM), but after about a minute
> i see no newly counted writes.
> 
> Thanks a lot !

No problem, but your reply doesn't make it clear to me whether the
lazy init was the cause of your writes or not. Maybe I just lack the
reading comprehension.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



[SOLVED] Re: Riddling activity on encrypted and mounted partition

2020-09-29 Thread Thomas Schmitt
Hi,

Andy Smith wrote:
> Could it possibly be the lazy init feature of ext4, which is enabled
> by default and can sometimes result in several minutes of background
> writes to a newly-created fs?

Well, the blinking went on for at least an hour.


> Create with:
>mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0

This lasts significantly longer than my first mkfs run.
The drive makes ~ 1950 write operations per second. So i estimate that
the job would have lasted hours with ~ 16 writes per second.
In the end mkfs.ext4 caused 733702 write ops on the 3.6 TB partition.

Ok. New UUID into fstab ... mount ... mkdir ... touch ... Yay !

The i/o is still lazy (no wonder with 32 GB RAM), but after about a minute
i see no newly counted writes.

Thanks a lot !


Have a nice day :)

Thomas



Re: Riddling activity on encrypted and mounted partition

2020-09-29 Thread Andy Smith
Hello,

On Tue, Sep 29, 2020 at 10:24:44AM +0200, Thomas Schmitt wrote:
> i have encrypted my HDD's (*) data partition. Now the disk access LED is
> blinking rapidly as soon as i mount it.

Could it possibly be the lazy init feature of ext4, which is enabled
by default and can sometimes result in several minutes of background
writes to a newly-created fs?


https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bfff68738f1cb5c93dab1114634cea02aae9e7ba
https://www.thomas-krenn.com/en/wiki/Ext4_Filesystem#Lazy_Initialization

Create with:

mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 …

to avoid this sort of thing.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Riddling activity on encrypted and mounted partition

2020-09-29 Thread Thomas Schmitt
Hi,

i have encrypted my HDD's (*) data partition. Now the disk access LED is
blinking rapidly as soon as i mount it.

Is this normal ?

I did:

  cryptsetup -v -y luksFormat --type luks2 /dev/sda2
  cryptsetup open /dev/sda2 daten
  dd if=/dev/zero bs=512 count=7679784591 status=progress of=/dev/mapper/daten

Some hours later i did:

  mkfs -t ext4 /dev/mapper/daten

In /etc/fstab i wrote a line with the new filesystem's UUID:

  UUID=... /daten  ext4defaults,noauto

Manual mounting

  mount /daten

works fine, but also causes the disk activity. Unmounting ends it.

The activity seems real:

  cat /sys/block/sda/sda2/stat ; sleep 10 ; cat /sys/block/sda/sda2/stat

yields

 797 117464313 3626 45984161 7636044108 7724077703 78712595 
   0 22193356 78716222000000
 797 117464313 3626 45984321 7636044111 7724237503 78713043 
   0 22193688 78716669000000

which according to
  https://www.kernel.org/doc/Documentation/block/stat.txt
shows activity with write fields:

  write I/Os 160   (  45984321 -   45984161)
  write merges 3   (7636044111 - 7636044108)
  write sectors   159800   (7724237503 - 7724077703)
  write ticks448   (  78713043 -   78712595)

The disk was supposed to be idle in those 10 seconds. Its ext4 contains
only 6 directories and 1 data file. Not much stuff to play with.

The data partiton of my SSD, which holds the active system, shows much less
activity during 10 seconds:

  write I/Os   7
  write merges 1
  write sectors   64
  write ticks117

The disk is still the replaced WD WD4003FRYZ, now in a 5.25" noise reduction
cage, which makes its periodic knocking sound unhearable unless i press my
ear at the computer's side.

The disk additionally holds a 64 GB swap partition. But swapoff /dev/sda1
does not influence the disk traffic on /dev/sda2. Only umount does.


Have nice day :)

Thomas