howto check disk

Having issues with your DietPi installation or found a bug? Post it here.
manilx
Posts: 59
Joined: Mon Dec 07, 2020 11:02 am

Re: howto check disk

Post by manilx »

MichaIng wrote: Fri Mar 12, 2021 5:13 pm Ah yeah sorry for my confusion:
  • If you have no other Linux system, you need to scan the root filesystem on reboot via dietpi-drive_manager option or by simply running > /forcefsck from console, then reboot. Result can be checked via cat /run/initramfs/fsck.log.
This is exactly what I have done. And the result is in the screenshot, which I don't quite understand.
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: howto check disk

Post by MichaIng »

Okay. It fails to mount the /boot partition, which is strange indeed. However, pressing Ctrl+D should allow you to continue boot. Let's see if you're about to mount the boot partition then: mount /boot
And of course to check the result of the fsck.
manilx
Posts: 59
Joined: Mon Dec 07, 2020 11:02 am

Re: howto check disk

Post by manilx »

^D continues to boot to the normal login prompt.

root@PlexServer:~# cat /run/initramfs/fsck.log
cat: /run/initramfs/fsck.log: No such file or directory
root@PlexServer:~# journalctl -t systemd-fsck
-- Logs begin at Thu 2019-02-14 10:11:58 WET, end at Fri 2021-03-12 16:42:48 WET. --
Mar 12 16:39:02 PlexServer systemd-fsck[128]: Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system
.
Mar 12 16:39:02 PlexServer systemd-fsck[128]: e2fsck 1.44.5 (15-Dec-2018)
Mar 12 16:39:02 PlexServer systemd-fsck[128]: Pass 1: Checking inodes, blocks, and sizes
Mar 12 16:39:52 PlexServer systemd-fsck[128]: Pass 2: Checking directory structure
Mar 12 16:40:41 PlexServer systemd-fsck[128]: fsck: Warning... fsck.ext4 for device /dev/sda2 exited with signal 13.
Mar 12 16:40:41 PlexServer systemd-fsck[128]: fsck failed with exit status 8.
Mar 12 16:40:41 PlexServer systemd-fsck[128]: Ignoring error.
Mar 12 16:40:43 PlexServer systemd-fsck[324]: Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system
.
Mar 12 16:40:44 PlexServer systemd-fsck[324]: fsck.fat 4.1 (2017-01-24)
Mar 12 16:40:44 PlexServer systemd-fsck[324]: /dev/sda1: 412 files, 106001/516190 clusters
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: howto check disk

Post by MichaIng »

It looks like the fstab entries are wrong. Can you paste:

Code: Select all

cat /etc/fstab
grep UUID /boot/boot.ini
lsblk -npo NAME,UUID,PARTUUID,MOUNTPOINT
manilx
Posts: 59
Joined: Mon Dec 07, 2020 11:02 am

Re: howto check disk

Post by manilx »

root@PlexServer:~# cat /etc/fstab
# You can use "dietpi-drive_manager" to setup mounts.
# NB: It overwrites and re-creates physical drive mount entries on use.
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------
//192.168.2.50/Video /mnt/qnap cifs username=,password=,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=3.1.1,nofail,noauto,x-systemd.automount

#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1938M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAPFILE
#----------------------------------------------------------------


#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=e8af6eb2-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=e8af6eb2-01 /boot vfat noatime,lazytime,rw 0 2
root@PlexServer:~# grep UUID /boot/boot.ini
grep: /boot/boot.ini: No such file or directory
root@PlexServer:~# lsblk -npo NAME,UUID,PARTUUID,MOUNTPOINT
/dev/sda
├─/dev/sda1 DC3E-E470 e8af6eb2-01 /boot
└─/dev/sda2 a7adb26a-8b87-4729-99c8-9f5ac069d51e e8af6eb2-02 /
root@PlexServer:~#
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: howto check disk

Post by MichaIng »

I'm still confused. Is this now an Odroid N2 or a Raspberry Pi 4?

Odroids by default use UUIDs and not the PARTUUIDs (the shorter ones present in our fstab) and of course must have /boot/boot.ini to be able to boot. However, the PARTUUIDs are correct.

If I remember right, on RPi 4, this mount on boot errors happen in combination with UAS, which is enabled by default on RPi 4 but not well compatible with all drives. Can you try to blacklist it:

Code: Select all

echo 'blacklist uas' > /etc/modprobe.d/disable-uas.conf
manilx
Posts: 59
Joined: Mon Dec 07, 2020 11:02 am

Re: howto check disk

Post by manilx »

I'm on my Pie4 now! Odroid has gone back to factory..... Sorry about the confusion! Has been a complicated few days....

I wanted to do a fs check on the pie.....


Anyway run the command you provided. Initiated the fs again.
Same problem as before. ^D continues boot.

root@PlexServer:~# journalctl -t systemd-fsck
-- Logs begin at Thu 2019-02-14 10:11:58 WET, end at Fri 2021-03-12 17:38:48 WET. --
Mar 12 17:36:40 PlexServer systemd-fsck[130]: Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system
.
Mar 12 17:36:40 PlexServer systemd-fsck[130]: e2fsck 1.44.5 (15-Dec-2018)
Mar 12 17:36:40 PlexServer systemd-fsck[130]: Pass 1: Checking inodes, blocks, and sizes
Mar 12 17:37:30 PlexServer systemd-fsck[130]: Pass 2: Checking directory structure
Mar 12 17:38:19 PlexServer systemd-fsck[130]: fsck: Warning... fsck.ext4 for device /dev/sda2 exited with signal 13.
Mar 12 17:38:19 PlexServer systemd-fsck[130]: fsck failed with exit status 8.
Mar 12 17:38:19 PlexServer systemd-fsck[130]: Ignoring error.
Mar 12 17:38:22 PlexServer systemd-fsck[327]: Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system
.
Mar 12 17:38:22 PlexServer systemd-fsck[327]: fsck.fat 4.1 (2017-01-24)
Mar 12 17:38:22 PlexServer systemd-fsck[327]: /dev/sda1: 412 files, 106001/516190 clusters
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: howto check disk

Post by MichaIng »

https://manpages.debian.org/buster/e2fs ... #EXIT_CODE
Edit code 8 == Operational error
But I have no idea what the signal 13 means. Cannot find something about it. It could be exit codes 8 + 4 + 1, but that would be the exit code itself.

However, do you actually face any issues on that RPi, or does dmesg -l emerg,altert,crit,err report any file system errors? Otherwise I'd leave it as is an check that partition on an external Linux system, e.g. when the Odroid is back there, or when you find time to spin up a VM, which is quite easy with out images ;).
manilx
Posts: 59
Joined: Mon Dec 07, 2020 11:02 am

Re: howto check disk

Post by manilx »

No critical error. I just wanted to check because I had a few powercycles withoit previous shutdown during the odroid mess.....


I have a dietpi VM lying around.....

So I connect that drive to it (has 2 partitions) mount it with dietpi-drive_manager, run a check on it and then unmount it. Is that it?
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: howto check disk

Post by MichaIng »

It does not need to be mounted, the "Check & Repair" option should be shown when it's still unmounted. A dry run is done first, so you can see found errors before anything is touched.
Post Reply