Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Obscure filesystem error in dmesg?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1602
Location: Fayetteville, NC, USA

PostPosted: Sat Jul 25, 2020 5:33 pm    Post subject: Obscure filesystem error in dmesg? Reply with quote

I am checking some things on the new laptop and have some very odd errors in dmesg.
Code:

 , invalid namelen(0), ino:0, run fsck to fix.

This is repeated four or five times, then another one with a large number behind the "ino:". The laptop has been powered on and NOT improperly turned off. In fact, the laptop just finished building my new Gentoo system. It has been on for multiple days while it build the entire Plasma desktop, Chromium, LibreOffice, and VirtualBox. Nothing has been unmounted or anything. I formatted the partitions, did the live CD portion of creating the kernel, installing GRUB, and doing basic tasks, rebooted, built the system, and now I am seeing this. How did I get errors out of the blue? What partition or device are the errors on?
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2014

PostPosted: Sat Jul 25, 2020 6:06 pm    Post subject: Reply with quote

The message appears to come from an f2fs filesystem. I expect it's your root fs as passed to the kernel by your boot manager (grub, rEFInd, whatever). When do these messages appear? It looks like soon after boot. There seems to be a problem with fsck on f2fs drives at boot; for some reason, the fsck.f2fs won't run if the drive is mounted r/o, so you either need an initramfs script that checks it before being mounted, or to check when booting from say a USB key. (This explanation may be wrong, I've never fully understood f2fs's problem.)

It would help if you posted the dmesg output (but not on the forums, it's too large) - for example, use pastebin.
If you can't because the system won't connect to the internet, I guess you need to boot your installation medium, and run fsck.f2fs -a on all f2fs drives on that machine.

f2fs records the kernel version information for the last successful fsck, so now that you're booting a your installed kernel, it will want to do a full check, and for some reason, that's not happening - possibly because of the mounting issue I mentioned above. One possible issue is that your installation media were old, in which case the drive was formatted with an old version of f2fs. fsck would then be upgrading the filesystem, and maybe that's why it's issuing the messages. Note that fsck on f2fs is comparatively slow - about 10 seconds on my 256 GB partition on my Samsung NVMe device on my desktop machine, presumably slower on a laptop.
_________________
Greybeard
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1602
Location: Fayetteville, NC, USA

PostPosted: Tue Jul 28, 2020 7:24 pm    Post subject: Reply with quote

You cannot set the fstab entry for a root F2FS filesystem to 1, or it will fail to check and bork your system at each boot. The filesystems are fine and I have yet to have any further issues, but whomever designed it to be checked offline so it cannot be checked during boot, and then went further and designed it to record kernel versions so you cannot boot and check it with a live CD, needs to be sent back to logic training. If I boot system rescue CD and check it and all is god but then boot my system, it wants to check because system rescue CD had a different kernel version. Due to it not being able to be checked while mounted, this makes checking it with my kernel impossible. Seems crazy. Love the system, but this is a flawed design.
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2014

PostPosted: Thu Jul 30, 2020 11:17 am    Post subject: Reply with quote

FWIW, here's my initramfs' init script. There's a section for fsck.f2fs - you have to pass boot parameters such as:
Code:
rootfstype=f2fs rootfs=LABEL=gentoo fsck.f2fs=-a settimeout mdadm

and here's the script. Better examples are almost certainly available:
Code:
#!/bin/busybox sh

# Error trap and rescue shell routine - starts a busybox shell session
rescue_shell()
{
    echo "<4> initramfs: $@" > /dev/kmsg
    echo "$@"
    echo "Something went wrong. Dropping you to a shell."
    echo "initramfs parameter string syntax:"
    echo "   [mdadm] rootfs=[UUID=|LABEL=]<id> [init=<init>] [level=<init parameter>] [rescue]"

    busybox --install -s
    exec /bin/sh
}

# Copy INFO messages to both stderr and the system log.
info()
{
    #  Like logger, but writes to /proc/kmsg, so syslog-ng can handle it later
    echo "<6> initramfs: $@" > /dev/kmsg
    # echo $@ --- used to need to echo to console, but since about kernel 3.8 /dev/kmsg seems to do that
}

# Main line code - need proc mounted before calling info()
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devtmpfs none /dev

# set initial/default values
rootfs=""
initscript="/sbin/init"
level=""

cmdline=$(cat /proc/cmdline)
info "Processing parameters $cmdline"
for param in $cmdline
  do
    case $param in
      pause)
   pause=pause
   ;;
      rootfs=UUID=*)
   info "rootfs - locating with UUID"
   rootfs=$(findfs ${param#rootfs=}) || rescue_shell "Unable to findfs $param"
   ;;
      rootfs=LABEL=*)
   info "rootfs - locating with LABEL"
   rootfs=$(findfs ${param#rootfs=}) || rescue_shell "Unable to findfs $param"
   ;;
      rootfs=*)
   info "rootfs - setting device name"
   rootfs=${param#rootfs=}
   ;;
      mdadm)
   info "mdadm - initializing RAID"
   mdadm --assemble --scan || rescue_shell "Error assembling RAID array"
   # mdadm needs another command before it creates devices for partitioned arrays
   mdadm --brief --detail --scan
   ;;
      init=*)
   info "init - setting init script name"
   initscript=${param#init=}
   ;;
      level=*)
   info "level - setting init script parameter"
   level=${param#level=}
   ;;
      rescue)
   rescue_shell "'rescue' parameter passed"
   ;;
      fsck*=*)
   cmd="${param%=*}"
   info "$cmd ${param#*=} checking rootfs device $rootfs"
   # Run the fsck and grab its output
   output=$($cmd ${param#*=} $rootfs)
   # Echo its output to syslog
        oldIFS=$IFS
        IFS=$(printf "\n\b")
   for line in $output
   do
      info $cmd - $line
   done
   IFS=$oldIFS
   ;;
     settimeout)
   info "settimeout - setting drive timeouts"
   for i in /dev/sd?
   do
                  dev="${i#/dev/}"
      timeout="/sys/block/$dev/device/timeout"
      old="$(cat $timeout)"
                info "$i does NOT support SCT/ERC - changing timeout from $old to 180"
      echo "180" > $timeout
   done
   ;;
      *)
   info "Ignored parameter $param"
    esac
  done

if [ "" = "$rootfs" ]
then rescue_shell "'rootfs' is unset"
fi

info "Mounting rootfs $rootfs read-only"

mount $rootfs /mnt/root || rescue_shell "Error mounting rootfs"

info "Switch root to: $rootfs $initscript $level"

[ $pause ] && read -p "Pausing; press enter to continue" junk

# Leave unmounting as late as possible to let printk work
for dir in sys dev proc
do
   mount -o move /$dir /mnt/root/$dir
done

exec switch_root /mnt/root $initscript $level

_________________
Greybeard
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1602
Location: Fayetteville, NC, USA

PostPosted: Sat Aug 01, 2020 8:07 pm    Post subject: Reply with quote

Thanks for sharing. I do not use an initrd and haven't since I began using Gentoo. I believe in baking all of the drivers for hardware which cannot possibly change on my systems into the kernel and as such, I do not need one. Would this be possible without an initrd?
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1602
Location: Fayetteville, NC, USA

PostPosted: Tue Aug 04, 2020 10:39 pm    Post subject: Reply with quote

OK, I am beginning to believe that F2FS is not ready for prime-time. The laptop has never been improperly shutdown, but at each boot, even if I run fsck on the partitions, I get this output in my log.

F2FS Output

I don't even know what it means but if I google search it all I find are posts about broken filesystems. I love the speed this system offers, but I may have to slow down to ext4 speeds if this thing can't even run on a battery-backed device (laptop) without randomly failing. Is this an error message I am getting or some kind of cryptic "everything is OK" message?
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2014

PostPosted: Wed Aug 05, 2020 11:35 am    Post subject: Reply with quote

Not seen that message.
I've been using F2FS for a few years now, initially on SD cards for a Raspberry Pi, and currently on my desktop's NVMe. Not seen any problem, but my usage is hardly demanding (apart from emerge, of course :-) ). The only F2FS messages in my log come from the "fsck.f2fs -a" performed (as above) by my initramfs script:
Code:
 Aug  4 11:35:10 initramfs: fsck.f2fs -a checking rootfs device /dev/nvme0n1p3
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: Fix the reported corruption.
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: Segments per section = 1
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: Sections per zone = 1
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: sector size = 512
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: total sectors = 534771712 (261119 MB)
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: MKFS version
 Aug  4 11:35:10 initramfs: fsck.f2fs -   "Linux version 4.19.97-gentoo-x86_64 (root@catalyst) (gcc version 9.2.0 (Gentoo 9.2.0-r2 p3)) #1 SMP Mon Jan 27 03:16:05 UTC 2020"
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: FSCK version
 Aug  4 11:35:10 initramfs: fsck.f2fs -   from "Linux version 5.7.11-gentoo-ryzen (root@acer) (gcc version 9.3.0 (Gentoo 9.3.0-r1 p3), GNU ld (Gentoo 2.33.1 p2) 2.33.1) #1 SMP Thu Jul 30 11:35:46 BST 2020"
 Aug  4 11:35:10 initramfs: fsck.f2fs -     to "Linux version 5.7.11-gentoo-ryzen (root@acer) (gcc version 9.3.0 (Gentoo 9.3.0-r1 p3), GNU ld (Gentoo 2.33.1 p2) 2.33.1) #1 SMP Thu Jul 30 11:35:46 BST 2020"
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: superblock features = 0 :
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: total FS sectors = 534771712 (261119 MB)
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: CKPT version = 1c8479b4
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: checkpoint state = 45 :  crc compacted_summary unmount
 Aug  4 11:35:10 initramfs: fsck.f2fs - Info: No error was reported
 Aug  4 11:35:10 kernel: F2FS-fs (nvme0n1p3): Mounted with checkpoint version = 1c8479b4

This is the "steady state" version after it's done the fuller check on change of kernel version, which takes about 10 seconds. It's probably overkill, and the usual fstab process with counters/ages would probably be better, if only it worked.

From what I recall, there were various attempts at getting fsck.f2fs to work variously with the file system mounted r/o or r/w, so it might be worth passing either as a boot time kernel parameter. I've no idea what nat bits are or whether they're important!
_________________
Greybeard
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2038
Location: United Kingdom

PostPosted: Wed Aug 05, 2020 2:21 pm    Post subject: Reply with quote

NAT = Node Address Table

Is the message 'Found nat_bits in checkpoint' an error message or simply a status message?:

http://lkml.iu.edu/hypermail/linux/kernel/1702.1/04140.html

If there were a problem with the filesystem, presumably you'd get the error message 'NAT is corrupt, run fsck to fix it':

https://lkml.org/lkml/2019/11/1/517
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1602
Location: Fayetteville, NC, USA

PostPosted: Wed Aug 05, 2020 7:30 pm    Post subject: Reply with quote

OK, if it is a status message I am good then. I really like F2FS but the lack of documentation I have found is bothersome. I'll give it a shot and see how it does. I have backups on and off-site so I can always go to something else.
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum