Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

  1. #1
    Join Date
    Mar 2019
    Beans
    215

    Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    Hi,
    I've gotten some great suggestions on this forum so far, so I hope you won't mind if I ask yet another question about a code line that I found today in the system log of my Lenovo x230i with an Ubuntu 20.04 OS, desktop -- no server.

    I have not come across this particular code line before and would appreciate it if someone could explain what the following line means

    Code:
     Starting Remove Stale Online ext4 Metadata Check Snapshots
    I have come across this line in other people's logs posted online, but no one seems to have broken down what 1/ the function is of this removal, 2/ what exactly is being removed and 3/ why.

    Also, very importantly, 4/ what am I to understand by the word *online* in this code line?

    The sender of the code line was systemd.

    Anyone care to explain this ? Thanks.

  2. #2
    Join Date
    Aug 2016
    Location
    Wandering
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    The sender of the code line was systemd. (indeed it was)
    Do you have problems?
    Code:
     systemctl status -o short-precise e2scrub_reap.service
    ○ e2scrub_reap.service - Remove Stale Online ext4 Metadata Check Snapshots
         Loaded: loaded (/lib/systemd/system/e2scrub_reap.service; enabled; preset:>
         Active: inactive (dead) since Tue 2023-04-11 07:06:45 MDT; 4h 18min ago
           Docs: man:e2scrub_all(8)
       Main PID: 2193 (code=exited, status=0/SUCCESS)
            CPU: 14ms
    
    Apr 11 07:06:45.571086 me-Lenovo-Legion-5-15ARH05 systemd[1]: Starting e2scrub_>
    Apr 11 07:06:45.648801 me-Lenovo-Legion-5-15ARH05 systemd[1]: e2scrub_reap.serv>
    Apr 11 07:06:45.649127 me-Lenovo-Legion-5-15ARH05 systemd[1]: Finished e2scrub_>
    and:
    Code:
    time e2scrub_all -A -r 
    e2scrub_all must be run as root
    
    real	0m0.013s
    user	0m0.000s
    sys	0m0.004s
    FWIW: e2scrub is tied to lvm
    My thoughts on the Online question is that it is available to the system.
    With realization of one's own potential and self-confidence in one's ability, one can build a better world.
    Dalai Lama>>
    Code Tags | System-info | Forum Guide lines | Arch Linux, Debian Unstable, FreeBSD

  3. #3
    Join Date
    Mar 2019
    Beans
    215

    Re: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    Quote Originally Posted by 1fallen View Post
    Do you have problems?
    Yes, I have problems as I want to understand what is going on.

    Firstly, could you (or someone else) first help me understand why I have LVM on my laptop, with an Ubuntu 20.04 desktop installation, since I did not activate LVM?

    Most of the sites I googled discuss LVM for Ubuntu *Server* installation as on this site: https://packetpushers.net/ubuntu-ext...ult-lvm-space/

    The one example I found for using LVM for a desktop installation makes it clear that it is a multi-pronged process, involving a number of commands that need to be entered into the terminal, none of which I did (see https://askubuntu.com/questions/1362...-bios-hardware)

    True?

    Second, I'd still like to know what "stale online ext4 metadata check snapshots" are and what *online* means here.

  4. #4
    Join Date
    Dec 2014
    Beans
    2,614

    Re: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    e2scrub is basically a tool for finding file system corruption in ext[234] which can run while the storage is mounted and in use - which is what is meant by the word 'online' in this context. It only finds corruption but doesn't even try to fix it - that would be too risky to try while the system is using the file system. You still need to run e2fsck if e2scrub has found problems. To perform this minor miracle, it uses snapshots in LVM to 'freeze' the state of the file system in time. The systemd service e2scrub_reap removes old stale snapshots at boot. It removes them since they are a waste of storage. It seems this service is installed by default, even on systems which aren't using LVM. Since there are no snapshots to clean up, it just exits with a status of '0' aka 'success'.

    Holger
    Last edited by Holger_Gehrke; April 11th, 2023 at 09:45 PM.

  5. #5
    Join Date
    Mar 2019
    Beans
    215

    Re: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    Quote Originally Posted by Holger_Gehrke View Post
    e2scrub is basically a tool for finding file system corruption in ext[234] which can run while the storage is mounted and in use - which is what is meant by the word 'online' in this context. It only finds corruption but doesn't even try to fix it - that would be too risky to try while the system is using the file system. You still need to run e2fsck if e2scrub has found problems. To perform this minor miracle, it uses snapshots in LVM to 'freeze' the state of the file system in time. The systemd service e2scrub_reap removes old stale snapshots at boot. It removes them since they are a waste of storage. It seems this service is installed by default, even on systems which aren't using LVM. Since there are no snapshots to clean up, it just exits with a status of '0' aka 'success'.

    Holger
    OK, thanks for the detailed explanation.

    Is there a terminal command to check if a system has LVM?

  6. #6
    Join Date
    Aug 2016
    Location
    Wandering
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    Quote Originally Posted by bhubunt View Post
    OK, thanks for the detailed explanation.

    Is there a terminal command to check if a system has LVM?
    There is no need for that see the man page:
    Code:
    E2SCRUB(8)                  System Manager's Manual                 E2SCRUB(8)
    
    NAME
           e2scrub_all - check all mounted ext[234] file systems for errors.
    
    SYNOPSIS
           e2scrub_all [OPTION]
    
    DESCRIPTION
           Searches  the  system  for  all LVM logical volumes containing an ext2,
           ext3, or ext4 file system, and checks them for problems.  The  checking
           is  performed by invoking the e2scrub tool, which will look for corrup‐
           tions.  Corrupt file systems will be tagged as having  errors  so  that
           fsck  will  be invoked before the next mount.  If no errors are encoun‐
           tered, fstrim will be called on the file system if it is mounted.   See
           the  e2scrub manual page for more information about how the checking is
           performed.
    EDIT: Ok you win: by using the "lvdisplay" command. If you have any logical volumes they will appear as such.
    Last edited by 1fallen; April 11th, 2023 at 09:58 PM.
    With realization of one's own potential and self-confidence in one's ability, one can build a better world.
    Dalai Lama>>
    Code Tags | System-info | Forum Guide lines | Arch Linux, Debian Unstable, FreeBSD

  7. #7
    Join Date
    Mar 2019
    Beans
    215

    Re: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    Quote Originally Posted by 1fallen View Post
    There is no need for that see the man page:
    Code:
           Searches  the  system  for  all LVM logical volumes containing an ext2,
           ext3, or ext4 file system, and checks them for problems.  
    OK -- but this section from the man page seems to contradict what Holger just wrote: Holger said the scrub tool is active without LVM. Yet, this quote from the man page suggests that the scrub tool does search LVM logical volumes, so that it presupposes LVM...

    Also, my question from the previous post is still different: I'd like to know if there is a command one can enter into the terminal to see if LVM has been applied to the system. If so, what is that command?
    Last edited by bhubunt; April 11th, 2023 at 10:06 PM.

  8. #8
    Join Date
    Aug 2016
    Location
    Wandering
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    Quote Originally Posted by bhubunt View Post
    OK -- but this section from the man page seems to contradict what Holger just wrote: Holger said the scrub tool is active without LVM. Yet, this quote from the man page suggests that the scrub tool does search LVM logical systems, so that it presupposes LVM...
    maybe reread his post Holger seldom offers bad info.
    Quote Originally Posted by bhubunt View Post
    Also, my question from the previous post is still different: I'd like to know if there is a command one can enter into the terminal to see if LVM has been applied to the system. If so, what is that command?
    I just gave it to you in my previous post " "lvdisplay" is good tool for those who do use LVM:
    mine is:
    Code:
    lvm formats
      WARNING: Running as a non-root user. Functionality may be unavailable.
      lvm2
    more:
    Code:
    >> lvm devtypes
      WARNING: Running as a non-root user. Functionality may be unavailable.
      DevType       MaxParts Description                               
      VxDMP               16 Veritas Dynamic Multipathing              
      aoe                 16 ATA over Ethernet                         
      ataraid             16 ATA Raid                                  
      bcache               1 bcache block device cache                 
      blkext               1 Extended device partitions                
      cciss               16 Compaq CCISS array                        
      dac960               8 DAC960                                    
      dasd                 4 DASD disk (IBM S/390, zSeries)            
      device-mapper        1 Mapped device                             
      drbd                16 Distributed Replicated Block Device (DRBD)
      emcpower            16 EMC Powerpath                             
      fio                 16 Fusion IO                                 
      gnbd                 1 Network block device                      
      i2o_block           16 i2o Block Disk                            
      ida                 16 Compaq SMART2                             
      ide                 64 IDE disk                                  
      iseries/vd           8 iSeries disks                             
      loop                 1 Loop device                               
      md                   1 Multiple Disk (MD/SoftRAID)               
      mdp                  1 Partitionable MD                          
      mmc                 16 MMC block device                          
      mtip32xx            16 Micron PCIe SSD                           
      nbd                 16 Network Block Device                      
      nvme                64 NVM Express                               
      power2              16 EMC Powerpath                             
      ps3disk             16 PlayStation 3 internal disk               
      ramdisk              1 RAM disk                                  
      rbd                 16 Ceph rados object as a Linux block device 
      scm                  8 Storage Class Memory (IBM S/390)          
      sd                  16 SCSI disk                                 
      skd                 16 STEC                                      
      ubd                 16 User-mode virtual block device            
      vdisk                8 SUN's LDOM virtual block device           
      virtblk              8 VirtIO disk                               
      vtms                16 Violin Memory                             
      xvd                 16 Xen virtual block device                  
      zvol                16 ZFS Zvols
    Your compare to mine will help, I hope.
    With realization of one's own potential and self-confidence in one's ability, one can build a better world.
    Dalai Lama>>
    Code Tags | System-info | Forum Guide lines | Arch Linux, Debian Unstable, FreeBSD

  9. #9
    Join Date
    Mar 2019
    Beans
    215

    Re: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    OK, super. I'll enter those commands tomorrow.

    I didn't mean to question Holger's knowledge by any means!

    Holger's given superb explanations in other threads of mine.

    Rather, it seemed that the man page is incomplete as it does not mention that the scrub tool can also operate on a system without LVM. Perhaps that's mentioned somewhere else in other Linux manuals --not sure.
    Last edited by bhubunt; April 11th, 2023 at 10:18 PM.

  10. #10
    Join Date
    Dec 2014
    Beans
    2,614

    Re: Ubuntu 20.04 -- What are "stale online ext4 metadata check snapshots"

    e2scrub and e2scrub_all are part of the e2fsprogs package. They only make sense if you're using ext[234] file systems inside the Logical Volume Manager but they are installed nonetheless. If it gets called without LVM present it just exits with an exit code of 0 without doing anything. The systemd service is installed in a one size fits all manner - it doesn't do any harm if run without LVM because it just starts and exits without doing anything. The message you find in your log is produced by systemd, not by e2fsscrub which keeps to the old UNIX idea of 'no news is good news' and does no output if it succeeded (and in a way it does succeed - there are no stale snapshots on the system after it has run, since there are no snapshots without LVM ...). If you look in /usr/lib/systemd/system/e2scrub_reap.service you'll find the message - without the 'Starting ' at its beginning - is actually the description of the service.

    Holger

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •